From 9445f86b9d5ee0ca161528a45d700dbd6a1effe8 Mon Sep 17 00:00:00 2001 From: Patrick Ohly Date: Wed, 8 Jun 2022 12:12:42 +0200 Subject: [PATCH 001/239] Generate go.work files This creates go.work and enables Go Workspaces. This is a file that includes info on k/k and all the staging modules. This depends on go 1.22 and setting FORCE_HOST_GO=true (for kube scripts, which try to be hermetic). Make this part of the normal update/verify sequence. The top-level go.work file contains no replace statements. Instead, the replace statements in the individual go.mod files are used. For this to work, replace statements in the individual go.mod files have to be consistent. hack/tools has different dependencies and can't be in the main workspace, so this adds a go.work just for that. Without this, go tries to consider all deps in all modules and pick one that works for all. This is problematic because there are so many of them that it is difficult to manage. Likewise for k8s.io/code-generator/examples and k8s.io/kms/internal/plugins/_mock - add trivial go.work files. For example k/k depends on an older version of a lib that gloangci-lint needs (transitively) and it breaks. This also updates vendor (needed to make go happy), and removes vendor'ed symlinks. This breaks a LOT of our build tools, which will be fixed subsequently. Result: `go` commands work across modules: Before: ``` $ go list ./pkg/proxy/iptables/ ./staging/src/k8s.io/api/core/v1/ main module (k8s.io/kubernetes) does not contain package k8s.io/kubernetes/staging/src/k8s.io/api/core/v1 $ go build ./pkg/proxy/iptables/ ./staging/src/k8s.io/api main module (k8s.io/kubernetes) does not contain package k8s.io/kubernetes/staging/src/k8s.io/api $ go test ./pkg/proxy/iptables/ ./staging/src/k8s.io/api main module (k8s.io/kubernetes) does not contain package k8s.io/kubernetes/staging/src/k8s.io/api ``` After: ``` $ go list ./pkg/proxy/iptables/ ./staging/src/k8s.io/api/core/v1/ k8s.io/kubernetes/pkg/proxy/iptables k8s.io/api/core/v1 $ go build ./pkg/proxy/iptables/ ./staging/src/k8s.io/api $ go test ./pkg/proxy/iptables/ ./staging/src/k8s.io/api ok k8s.io/kubernetes/pkg/proxy/iptables 0.360s ok k8s.io/api 2.302s ``` Result: `make` fails: ``` $ make go version go1.22rc1 linux/amd64 +++ [0106 12:11:03] Building go targets for linux/amd64 k8s.io/kubernetes/cmd/kube-proxy (static) k8s.io/kubernetes/cmd/kube-apiserver (static) k8s.io/kubernetes/cmd/kube-controller-manager (static) k8s.io/kubernetes/cmd/kubelet (non-static) k8s.io/kubernetes/cmd/kubeadm (static) k8s.io/kubernetes/cmd/kube-scheduler (static) k8s.io/component-base/logs/kube-log-runner (static) k8s.io/kube-aggregator (static) k8s.io/apiextensions-apiserver (static) k8s.io/kubernetes/cluster/gce/gci/mounter (static) k8s.io/kubernetes/cmd/kubectl (static) k8s.io/kubernetes/cmd/kubectl-convert (static) github.com/onsi/ginkgo/v2/ginkgo (non-static) k8s.io/kubernetes/test/e2e/e2e.test (test) k8s.io/kubernetes/test/conformance/image/go-runner (non-static) k8s.io/kubernetes/cmd/kubemark (static) github.com/onsi/ginkgo/v2/ginkgo (non-static) k8s.io/kubernetes/test/e2e_node/e2e_node.test (test) test/e2e/e2e.go:35:2: cannot find package "k8s.io/api/apps/v1" in any of: /home/thockin/src/kubernetes/_output/local/go/src/k8s.io/kubernetes/vendor/k8s.io/api/apps/v1 (vendor tree) /home/thockin/src/kubernetes/_output/local/.gimme/versions/go1.22rc1.linux.amd64/src/k8s.io/api/apps/v1 (from $GOROOT) /home/thockin/src/kubernetes/_output/local/go/src/k8s.io/api/apps/v1 (from $GOPATH) ... more ... ... more ... ... more ... !!! [0106 12:13:41] Call tree: !!! [0106 12:13:41] 1: /home/thockin/src/kubernetes/hack/lib/golang.sh:948 kube::golang::build_binaries_for_platform(...) !!! [0106 12:13:41] 2: hack/make-rules/build.sh:27 kube::golang::build_binaries(...) !!! [0106 12:13:41] Call tree: !!! [0106 12:13:41] 1: hack/make-rules/build.sh:27 kube::golang::build_binaries(...) !!! [0106 12:13:41] Call tree: !!! [0106 12:13:41] 1: hack/make-rules/build.sh:27 kube::golang::build_binaries(...) make: *** [Makefile:96: all] Error 1 ``` Again, this requires go 1.22 (e.g. gotip), as go 1.21.x does not have `go work vendor` support. TO REPEAT: ( \ ./hack/update-go-workspace.sh; \ ./hack/update-vendor.sh; \ ./hack/update-go-workspace.sh; \ ) Kubernetes-commit: 65b841c077e0d3282d28b9199aec72d23d045104 --- go.mod | 11 ++++++----- go.sum | 14 ++++++++++---- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index 6b199235f..ac89cd38f 100644 --- a/go.mod +++ b/go.mod @@ -2,7 +2,7 @@ module k8s.io/client-go -go 1.21 +go 1.22.0 require ( github.com/evanphx/json-patch v4.12.0+incompatible @@ -24,8 +24,8 @@ require ( golang.org/x/term v0.17.0 golang.org/x/time v0.3.0 google.golang.org/protobuf v1.31.0 - k8s.io/api v0.0.0-20240228104440-d6ea7e8f9bfc - k8s.io/apimachinery v0.0.0-20240229214048-6362b69e393e + 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-20231113174909-778a5567bc1e k8s.io/utils v0.0.0-20230726121419-3b25d923346b @@ -61,6 +61,7 @@ require ( ) replace ( - k8s.io/api => k8s.io/api v0.0.0-20240228104440-d6ea7e8f9bfc - k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20240229214048-6362b69e393e + k8s.io/api => ../api + k8s.io/apimachinery => ../apimachinery + k8s.io/client-go => ../client-go ) diff --git a/go.sum b/go.sum index 70eaa1f74..77a50bf0c 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= @@ -97,13 +102,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.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= 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.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= 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= @@ -140,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/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.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= @@ -157,10 +166,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-20240228104440-d6ea7e8f9bfc h1:7IBpQCcIsPKGiK8R2xVKsFYdcqvt5UIiA4ARPHdlUoQ= -k8s.io/api v0.0.0-20240228104440-d6ea7e8f9bfc/go.mod h1:kCYq4mrNBxRaHCZeTveL6//1FveIDm3wxJZeFNKF6b8= -k8s.io/apimachinery v0.0.0-20240229214048-6362b69e393e h1:2XgAKNuD1VSLa8SmR/BCQR6MX6xHn1SyB29fBYaBpcI= -k8s.io/apimachinery v0.0.0-20240229214048-6362b69e393e/go.mod h1:/862Kkwje5hhHGJWPKiaHuov2c6mw6uCXWikV9kOIP4= +k8s.io/gengo v0.0.0-20230829151522-9cce18d56c01/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= 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-20231113174909-778a5567bc1e h1:snPmy96t93RredGRjKfMFt+gvxuVAncqSAyBveJtr4Q= From 79c893df5ad31e0fe487b40615d977ad2bf59cc6 Mon Sep 17 00:00:00 2001 From: Claudiu Belu Date: Wed, 15 Jun 2022 15:17:24 +0300 Subject: [PATCH 002/239] 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 dd5f91806..261dcacb5 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 31f896316..2cd213ccb 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 fbc452838..778ef03ca 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 785e19661f801a65c1ee5203b713e221b7436006 Mon Sep 17 00:00:00 2001 From: John Howard Date: Fri, 31 Mar 2023 15:57:18 -0700 Subject: [PATCH 003/239] client-go: allow adding indexes after informer starts Kubernetes-commit: d96a9858d396d7f418d24ea47bdc92ef8429f707 --- tools/cache/index.go | 3 +- tools/cache/shared_informer.go | 4 +- tools/cache/shared_informer_test.go | 78 ++++++++++++++++++++++++ tools/cache/thread_safe_store.go | 92 ++++++++++++++++++----------- 4 files changed, 138 insertions(+), 39 deletions(-) diff --git a/tools/cache/index.go b/tools/cache/index.go index b78d3086b..c5819fb6f 100644 --- a/tools/cache/index.go +++ b/tools/cache/index.go @@ -50,8 +50,7 @@ type Indexer interface { // GetIndexers return the indexers GetIndexers() Indexers - // AddIndexers adds more indexers to this store. If you call this after you already have data - // in the store, the results are undefined. + // AddIndexers adds more indexers to this store. This supports adding indexes after the store already has items. AddIndexers(newIndexers Indexers) error } diff --git a/tools/cache/shared_informer.go b/tools/cache/shared_informer.go index b3f37431d..a06df6e6e 100644 --- a/tools/cache/shared_informer.go +++ b/tools/cache/shared_informer.go @@ -540,8 +540,8 @@ func (s *sharedIndexInformer) AddIndexers(indexers Indexers) error { s.startedLock.Lock() defer s.startedLock.Unlock() - if s.started { - return fmt.Errorf("informer has already started") + if s.stopped { + return fmt.Errorf("indexer was not added because it has stopped already") } return s.indexer.AddIndexers(indexers) diff --git a/tools/cache/shared_informer_test.go b/tools/cache/shared_informer_test.go index 459f257f9..1e4ed9d56 100644 --- a/tools/cache/shared_informer_test.go +++ b/tools/cache/shared_informer_test.go @@ -26,6 +26,9 @@ import ( "testing" "time" + "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + "github.com/stretchr/testify/assert" v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -117,6 +120,81 @@ func isRegistered(i SharedInformer, h ResourceEventHandlerRegistration) bool { return s.processor.getListener(h) != nil } +func TestIndexer(t *testing.T) { + assert := assert.New(t) + // source simulates an apiserver object endpoint. + source := fcache.NewFakeControllerSource() + pod1 := &v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "pod1", Labels: map[string]string{"a": "a-val", "b": "b-val1"}}} + pod2 := &v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "pod2", Labels: map[string]string{"b": "b-val2"}}} + pod3 := &v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "pod3", Labels: map[string]string{"a": "a-val2"}}} + source.Add(pod1) + source.Add(pod2) + + // create the shared informer and resync every 1s + informer := NewSharedInformer(source, &v1.Pod{}, 1*time.Second).(*sharedIndexInformer) + err := informer.AddIndexers(map[string]IndexFunc{ + "labels": func(obj interface{}) ([]string, error) { + res := []string{} + for k := range obj.(*v1.Pod).Labels { + res = append(res, k) + } + return res, nil + }, + }) + if err != nil { + t.Fatal(err) + } + stop := make(chan struct{}) + defer close(stop) + + go informer.Run(stop) + WaitForCacheSync(stop, informer.HasSynced) + + cmpOps := cmpopts.SortSlices(func(a, b any) bool { + return a.(*v1.Pod).Name < b.(*v1.Pod).Name + }) + + // We should be able to lookup by index + res, err := informer.GetIndexer().ByIndex("labels", "a") + assert.NoError(err) + if diff := cmp.Diff([]any{pod1}, res); diff != "" { + t.Fatal(diff) + } + + // Adding an item later is fine as well + source.Add(pod3) + // Event is async, need to poll + assert.Eventually(func() bool { + res, _ := informer.GetIndexer().ByIndex("labels", "a") + return cmp.Diff([]any{pod1, pod3}, res, cmpOps) == "" + }, time.Second*3, time.Millisecond) + + // Adding an index later is also fine + err = informer.AddIndexers(map[string]IndexFunc{ + "labels-again": func(obj interface{}) ([]string, error) { + res := []string{} + for k := range obj.(*v1.Pod).Labels { + res = append(res, k) + } + return res, nil + }, + }) + assert.NoError(err) + + // Should be immediately available + res, err = informer.GetIndexer().ByIndex("labels-again", "a") + assert.NoError(err) + if diff := cmp.Diff([]any{pod1, pod3}, res, cmpOps); diff != "" { + t.Fatal(diff) + } + if got := informer.GetIndexer().ListIndexFuncValues("labels"); !sets.New(got...).Equal(sets.New("a", "b")) { + t.Fatalf("got %v", got) + } + if got := informer.GetIndexer().ListIndexFuncValues("labels-again"); !sets.New(got...).Equal(sets.New("a", "b")) { + t.Fatalf("got %v", got) + } +} + func TestListenerResyncPeriods(t *testing.T) { // source simulates an apiserver object endpoint. source := fcache.NewFakeControllerSource() diff --git a/tools/cache/thread_safe_store.go b/tools/cache/thread_safe_store.go index 145e93ee5..7a4df0e1b 100644 --- a/tools/cache/thread_safe_store.go +++ b/tools/cache/thread_safe_store.go @@ -52,8 +52,7 @@ type ThreadSafeStore interface { ByIndex(indexName, indexedValue string) ([]interface{}, error) GetIndexers() Indexers - // AddIndexers adds more indexers to this store. If you call this after you already have data - // in the store, the results are undefined. + // AddIndexers adds more indexers to this store. This supports adding indexes after the store already has items. AddIndexers(newIndexers Indexers) error // Resync is a no-op and is deprecated Resync() error @@ -135,50 +134,66 @@ func (i *storeIndex) addIndexers(newIndexers Indexers) error { return nil } -// updateIndices modifies the objects location in the managed indexes: +// updateSingleIndex modifies the objects location in the named index: // - for create you must provide only the newObj // - for update you must provide both the oldObj and the newObj // - for delete you must provide only the oldObj -// updateIndices must be called from a function that already has a lock on the cache -func (i *storeIndex) updateIndices(oldObj interface{}, newObj interface{}, key string) { +// updateSingleIndex must be called from a function that already has a lock on the cache +func (i *storeIndex) updateSingleIndex(name string, oldObj interface{}, newObj interface{}, key string) { var oldIndexValues, indexValues []string - var err error - for name, indexFunc := range i.indexers { - if oldObj != nil { - oldIndexValues, err = indexFunc(oldObj) - } else { - oldIndexValues = oldIndexValues[:0] - } + indexFunc, ok := i.indexers[name] + if !ok { + // Should never happen. Caller is responsible for ensuring this exists, and should call with lock + // held to avoid any races. + panic(fmt.Errorf("indexer %q does not exist", name)) + } + if oldObj != nil { + var err error + oldIndexValues, err = indexFunc(oldObj) if err != nil { panic(fmt.Errorf("unable to calculate an index entry for key %q on index %q: %v", key, name, err)) } + } else { + oldIndexValues = oldIndexValues[:0] + } - if newObj != nil { - indexValues, err = indexFunc(newObj) - } else { - indexValues = indexValues[:0] - } + if newObj != nil { + var err error + indexValues, err = indexFunc(newObj) if err != nil { panic(fmt.Errorf("unable to calculate an index entry for key %q on index %q: %v", key, name, err)) } + } else { + indexValues = indexValues[:0] + } - index := i.indices[name] - if index == nil { - index = Index{} - i.indices[name] = index - } + index := i.indices[name] + if index == nil { + index = Index{} + i.indices[name] = index + } - if len(indexValues) == 1 && len(oldIndexValues) == 1 && indexValues[0] == oldIndexValues[0] { - // We optimize for the most common case where indexFunc returns a single value which has not been changed - continue - } + if len(indexValues) == 1 && len(oldIndexValues) == 1 && indexValues[0] == oldIndexValues[0] { + // We optimize for the most common case where indexFunc returns a single value which has not been changed + return + } - for _, value := range oldIndexValues { - i.deleteKeyFromIndex(key, value, index) - } - for _, value := range indexValues { - i.addKeyToIndex(key, value, index) - } + for _, value := range oldIndexValues { + i.deleteKeyFromIndex(key, value, index) + } + for _, value := range indexValues { + i.addKeyToIndex(key, value, index) + } +} + +// updateIndices modifies the objects location in the managed indexes: +// - for create you must provide only the newObj +// - for update you must provide both the oldObj and the newObj +// - for delete you must provide only the oldObj +// updateIndices must be called from a function that already has a lock on the cache +func (i *storeIndex) updateIndices(oldObj interface{}, newObj interface{}, key string) { + for name := range i.indexers { + i.updateSingleIndex(name, oldObj, newObj, key) } } @@ -339,11 +354,18 @@ func (c *threadSafeMap) AddIndexers(newIndexers Indexers) error { c.lock.Lock() defer c.lock.Unlock() - if len(c.items) > 0 { - return fmt.Errorf("cannot add indexers to running index") + if err := c.index.addIndexers(newIndexers); err != nil { + return err + } + + // If there are already items, index them + for key, item := range c.items { + for name := range newIndexers { + c.index.updateSingleIndex(name, nil, item, key) + } } - return c.index.addIndexers(newIndexers) + return nil } func (c *threadSafeMap) Resync() error { From 7f07a956f8650ec42f426098a855fdeb6ae486ae Mon Sep 17 00:00:00 2001 From: cpanato Date: Wed, 8 Nov 2023 08:46:15 -0600 Subject: [PATCH 004/239] update go.mod Signed-off-by: cpanato Kubernetes-commit: 9e5b8402bb95eb82541099e77c3a8b0ccd31297f --- go.mod | 11 ++++++----- go.sum | 12 ++++++++---- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index dac0fd219..676594d64 100644 --- a/go.mod +++ b/go.mod @@ -2,7 +2,7 @@ module k8s.io/client-go -go 1.21.3 +go 1.21 require ( github.com/evanphx/json-patch v4.12.0+incompatible @@ -24,8 +24,8 @@ require ( golang.org/x/term v0.13.0 golang.org/x/time v0.3.0 google.golang.org/protobuf v1.31.0 - k8s.io/api v0.0.0-20231104011324-cca653eefe74 - k8s.io/apimachinery v0.0.0-20231104004456-12dc3f82eb47 + k8s.io/api v0.0.0 + k8s.io/apimachinery v0.0.0 k8s.io/klog/v2 v2.110.1 k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 k8s.io/utils v0.0.0-20230726121419-3b25d923346b @@ -61,6 +61,7 @@ require ( ) replace ( - k8s.io/api => k8s.io/api v0.0.0-20231104011324-cca653eefe74 - k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20231104004456-12dc3f82eb47 + k8s.io/api => ../api + k8s.io/apimachinery => ../apimachinery + k8s.io/client-go => ../client-go ) diff --git a/go.sum b/go.sum index b5f0e7372..2bf96f534 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= @@ -102,8 +106,10 @@ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9dec golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= 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.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= 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= @@ -140,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.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= @@ -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-20231104011324-cca653eefe74 h1:A/WZDLAcaGLXkFBbekgwUWKJBuRtPShuANcONbv3OrA= -k8s.io/api v0.0.0-20231104011324-cca653eefe74/go.mod h1:6Z3XP8HABddpcRWQa0OQUhKH7fQ9DkfDiAfwsZYoav8= -k8s.io/apimachinery v0.0.0-20231104004456-12dc3f82eb47 h1:wWtw59NclKzCKEt2E5e65INhGVzoUW0ll6X2AyDrsVU= -k8s.io/apimachinery v0.0.0-20231104004456-12dc3f82eb47/go.mod h1:yFk3nwBh/jXlkMvRKH7BKtX7saT1lRmmGV6Ru0cTSUA= +k8s.io/gengo v0.0.0-20230829151522-9cce18d56c01/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= k8s.io/klog/v2 v2.110.1 h1:U/Af64HJf7FcwMcXyKm2RPM22WZzyR7OSpYj5tg3cL0= k8s.io/klog/v2 v2.110.1/go.mod h1:YGtd1984u+GgbuZ7e08/yBuAfKLSO0+uR1Fhi6ExXjo= k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 h1:aVUu9fTY98ivBPKR9Y5w/AuzbMm96cd3YHRTU83I780= From 84a6fe7e4032ae1b8bc03b5208e771c5f7103549 Mon Sep 17 00:00:00 2001 From: Kubernetes Publisher Date: Mon, 13 Nov 2023 16:15:44 +0100 Subject: [PATCH 005/239] Merge pull request #121808 from cpanato/go-update-main [go] Bump images, dependencies and versions to go 1.21.4 Kubernetes-commit: 6ba7258a0f3f73629560fc30016b2e35c8e7ae9c --- go.mod | 9 ++++----- go.sum | 12 ++++-------- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/go.mod b/go.mod index 676594d64..82edc71da 100644 --- a/go.mod +++ b/go.mod @@ -24,8 +24,8 @@ require ( golang.org/x/term v0.13.0 golang.org/x/time v0.3.0 google.golang.org/protobuf v1.31.0 - k8s.io/api v0.0.0 - k8s.io/apimachinery v0.0.0 + k8s.io/api v0.0.0-20231113171418-a95c725cd890 + k8s.io/apimachinery v0.0.0-20231113171157-fa98d6eaedb4 k8s.io/klog/v2 v2.110.1 k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 k8s.io/utils v0.0.0-20230726121419-3b25d923346b @@ -61,7 +61,6 @@ require ( ) replace ( - k8s.io/api => ../api - k8s.io/apimachinery => ../apimachinery - k8s.io/client-go => ../client-go + k8s.io/api => k8s.io/api v0.0.0-20231113171418-a95c725cd890 + k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20231113171157-fa98d6eaedb4 ) diff --git a/go.sum b/go.sum index 2bf96f534..89a68b717 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= @@ -106,10 +102,8 @@ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9dec golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= 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.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= 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 +140,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.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= @@ -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 v0.0.0-20230829151522-9cce18d56c01/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= +k8s.io/api v0.0.0-20231113171418-a95c725cd890 h1:SHs5i2ucK0WbfIRTL1VEpojQ/mGUVFESrxZH8/8V3/c= +k8s.io/api v0.0.0-20231113171418-a95c725cd890/go.mod h1:euD11hUzyWUaDInuGcZw8dn3W3PlBwQ7JFbZZjNho5s= +k8s.io/apimachinery v0.0.0-20231113171157-fa98d6eaedb4 h1:OtyUMcIK9+uygefKf9MzU2XzrWQV8IwrEv6vI3PJ7xw= +k8s.io/apimachinery v0.0.0-20231113171157-fa98d6eaedb4/go.mod h1:eVBxQ/cwiJxH58eK/jd/vAk4mrxmVlnpBH5J2GbMeis= k8s.io/klog/v2 v2.110.1 h1:U/Af64HJf7FcwMcXyKm2RPM22WZzyR7OSpYj5tg3cL0= k8s.io/klog/v2 v2.110.1/go.mod h1:YGtd1984u+GgbuZ7e08/yBuAfKLSO0+uR1Fhi6ExXjo= k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 h1:aVUu9fTY98ivBPKR9Y5w/AuzbMm96cd3YHRTU83I780= From e9d1484a8ecf6b018a56d2dd295d028040a3a3d3 Mon Sep 17 00:00:00 2001 From: Tim Hockin Date: Mon, 13 Nov 2023 10:59:57 -0800 Subject: [PATCH 006/239] Re-vendor k8s.io/kube-openapi ./hack/pin-dependency.sh k8s.io/kube-openapi 778a5567bc1edaed92a4de9c07f90199c67953fa ./hack/update-vendor.sh Kubernetes-commit: 1f55357d9937f076f532a2c1aa104593b9f6c49a --- go.mod | 11 ++++++----- go.sum | 16 ++++++++++------ 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/go.mod b/go.mod index a74c5dd6f..67c5b28a8 100644 --- a/go.mod +++ b/go.mod @@ -24,10 +24,10 @@ require ( golang.org/x/term v0.13.0 golang.org/x/time v0.3.0 google.golang.org/protobuf v1.31.0 - k8s.io/api v0.0.0-20231213211702-6a8b8cdcd535 - k8s.io/apimachinery v0.0.0-20231113171157-fa98d6eaedb4 + k8s.io/api v0.0.0 + k8s.io/apimachinery v0.0.0 k8s.io/klog/v2 v2.110.1 - k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 + k8s.io/kube-openapi v0.0.0-20231113174909-778a5567bc1e 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 @@ -61,6 +61,7 @@ require ( ) replace ( - k8s.io/api => k8s.io/api v0.0.0-20231213211702-6a8b8cdcd535 - k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20231113171157-fa98d6eaedb4 + k8s.io/api => ../api + k8s.io/apimachinery => ../apimachinery + k8s.io/client-go => ../client-go ) diff --git a/go.sum b/go.sum index 0ea022900..6cc2d59c7 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= @@ -102,8 +106,10 @@ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9dec golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= 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.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= 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= @@ -140,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.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= @@ -157,14 +164,11 @@ 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-20231213211702-6a8b8cdcd535 h1:Io0oxmcx72uFM6xMjshxcQFRd9CclDTKhWd+hBsI5JQ= -k8s.io/api v0.0.0-20231213211702-6a8b8cdcd535/go.mod h1:euD11hUzyWUaDInuGcZw8dn3W3PlBwQ7JFbZZjNho5s= -k8s.io/apimachinery v0.0.0-20231113171157-fa98d6eaedb4 h1:OtyUMcIK9+uygefKf9MzU2XzrWQV8IwrEv6vI3PJ7xw= -k8s.io/apimachinery v0.0.0-20231113171157-fa98d6eaedb4/go.mod h1:eVBxQ/cwiJxH58eK/jd/vAk4mrxmVlnpBH5J2GbMeis= +k8s.io/gengo v0.0.0-20230829151522-9cce18d56c01/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= k8s.io/klog/v2 v2.110.1 h1:U/Af64HJf7FcwMcXyKm2RPM22WZzyR7OSpYj5tg3cL0= k8s.io/klog/v2 v2.110.1/go.mod h1:YGtd1984u+GgbuZ7e08/yBuAfKLSO0+uR1Fhi6ExXjo= -k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 h1:aVUu9fTY98ivBPKR9Y5w/AuzbMm96cd3YHRTU83I780= -k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00/go.mod h1:AsvuZPBlUDVuCdzJ87iajxtXuR9oktsTctW/R9wwouA= +k8s.io/kube-openapi v0.0.0-20231113174909-778a5567bc1e h1:snPmy96t93RredGRjKfMFt+gvxuVAncqSAyBveJtr4Q= +k8s.io/kube-openapi v0.0.0-20231113174909-778a5567bc1e/go.mod h1:AsvuZPBlUDVuCdzJ87iajxtXuR9oktsTctW/R9wwouA= k8s.io/utils v0.0.0-20230726121419-3b25d923346b h1:sgn3ZU783SCgtaSJjpcVVlRqd6GSnlTLKgpAAttJvpI= k8s.io/utils v0.0.0-20230726121419-3b25d923346b/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= From 3c7c00d2d6bb9aa674923050016ab57c62f4ed58 Mon Sep 17 00:00:00 2001 From: Eric Lin Date: Sat, 25 Nov 2023 22:04:32 +0000 Subject: [PATCH 007/239] leaderelection: optimistically update leader lock Signed-off-by: Eric Lin Kubernetes-commit: 1d9f7fd516b4787f5ef32692711d5ae3031e794e --- tools/leaderelection/leaderelection.go | 30 +++- tools/leaderelection/leaderelection_test.go | 167 +++++++++++++++++++- 2 files changed, 188 insertions(+), 9 deletions(-) diff --git a/tools/leaderelection/leaderelection.go b/tools/leaderelection/leaderelection.go index c1151baf2..af840c4a2 100644 --- a/tools/leaderelection/leaderelection.go +++ b/tools/leaderelection/leaderelection.go @@ -325,7 +325,22 @@ func (le *LeaderElector) tryAcquireOrRenew(ctx context.Context) bool { AcquireTime: now, } - // 1. obtain or create the ElectionRecord + // 1. fast path for the leader to update optimistically assuming that the record observed + // last time is the current version. + if le.IsLeader() && le.isLeaseValid(now.Time) { + oldObservedRecord := le.getObservedRecord() + leaderElectionRecord.AcquireTime = oldObservedRecord.AcquireTime + leaderElectionRecord.LeaderTransitions = oldObservedRecord.LeaderTransitions + + err := le.config.Lock.Update(ctx, leaderElectionRecord) + if err == nil { + le.setObservedRecord(&leaderElectionRecord) + return true + } + klog.Errorf("Failed to update lock optimitically: %v, falling back to slow path", err) + } + + // 2. obtain or create the ElectionRecord oldLeaderElectionRecord, oldLeaderElectionRawRecord, err := le.config.Lock.Get(ctx) if err != nil { if !errors.IsNotFound(err) { @@ -342,24 +357,23 @@ func (le *LeaderElector) tryAcquireOrRenew(ctx context.Context) bool { return true } - // 2. Record obtained, check the Identity & Time + // 3. Record obtained, check the Identity & Time if !bytes.Equal(le.observedRawRecord, oldLeaderElectionRawRecord) { le.setObservedRecord(oldLeaderElectionRecord) le.observedRawRecord = oldLeaderElectionRawRecord } - if len(oldLeaderElectionRecord.HolderIdentity) > 0 && - le.observedTime.Add(time.Second*time.Duration(oldLeaderElectionRecord.LeaseDurationSeconds)).After(now.Time) && - !le.IsLeader() { + if len(oldLeaderElectionRecord.HolderIdentity) > 0 && le.isLeaseValid(now.Time) && !le.IsLeader() { klog.V(4).Infof("lock is held by %v and has not yet expired", oldLeaderElectionRecord.HolderIdentity) return false } - // 3. We're going to try to update. The leaderElectionRecord is set to it's default + // 4. 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 + le.metrics.slowpathExercised(le.config.Name) } else { leaderElectionRecord.LeaderTransitions = oldLeaderElectionRecord.LeaderTransitions + 1 } @@ -400,6 +414,10 @@ func (le *LeaderElector) Check(maxTolerableExpiredLease time.Duration) error { return nil } +func (le *LeaderElector) isLeaseValid(now time.Time) bool { + return le.observedTime.Add(time.Second * time.Duration(le.getObservedRecord().LeaseDurationSeconds)).After(now) +} + // setObservedRecord will set a new observedRecord and update observedTime to the current time. // Protect critical sections with lock. func (le *LeaderElector) setObservedRecord(observedRecord *rl.LeaderElectionRecord) { diff --git a/tools/leaderelection/leaderelection_test.go b/tools/leaderelection/leaderelection_test.go index 02fa6a1d4..8c94b35a2 100644 --- a/tools/leaderelection/leaderelection_test.go +++ b/tools/leaderelection/leaderelection_test.go @@ -610,14 +610,18 @@ func testReleaseOnCancellation(t *testing.T, objectType string) { objectType: objectType, reaction: func(action fakeclient.Action) (handled bool, ret runtime.Object, err error) { updates++ + // Skip initial two fast path renews + if updates%2 == 1 && updates < 5 { + return true, nil, context.Canceled + } // Second update (first renew) should return our canceled error // FakeClient doesn't do anything with the context so we're doing this ourselves - if updates == 2 { + if updates == 4 { close(onRenewCalled) <-onRenewResume return true, nil, context.Canceled - } else if updates == 3 { + } else if updates == 5 { // We update the lock after the cancellation to release it // This wg is to avoid the data race on lockObj defer wg.Done() @@ -668,8 +672,12 @@ func testReleaseOnCancellation(t *testing.T, objectType string) { objectType: objectType, reaction: func(action fakeclient.Action) (handled bool, ret runtime.Object, err error) { updates++ + // Always skip fast path renew + if updates%2 == 1 { + return true, nil, context.Canceled + } // Second update (first renew) should release the lock - if updates == 2 { + if updates == 4 { // We update the lock after the cancellation to release it // This wg is to avoid the data race on lockObj defer wg.Done() @@ -813,3 +821,156 @@ func assertEqualEvents(t *testing.T, expected []string, actual <-chan string) { } } } + +func TestFastPathLeaderElection(t *testing.T) { + objectType := "leases" + var ( + lockObj runtime.Object + updates int + lockOps []string + cancelFunc func() + ) + resetVars := func() { + lockObj = nil + updates = 0 + lockOps = []string{} + cancelFunc = nil + } + lec := LeaderElectionConfig{ + LeaseDuration: 15 * time.Second, + RenewDeadline: 2 * time.Second, + RetryPeriod: 1 * time.Second, + + Callbacks: LeaderCallbacks{ + OnNewLeader: func(identity string) {}, + OnStoppedLeading: func() {}, + OnStartedLeading: func(context.Context) { + }, + }, + } + + tests := []struct { + name string + reactors []Reactor + expectedLockOps []string + }{ + { + name: "Exercise fast path after lock acquired", + reactors: []Reactor{ + { + verb: "get", + objectType: objectType, + reaction: func(action fakeclient.Action) (handled bool, ret runtime.Object, err error) { + lockOps = append(lockOps, "get") + if lockObj != nil { + return true, lockObj, nil + } + return true, nil, errors.NewNotFound(action.(fakeclient.GetAction).GetResource().GroupResource(), action.(fakeclient.GetAction).GetName()) + }, + }, + { + verb: "create", + objectType: objectType, + reaction: func(action fakeclient.Action) (handled bool, ret runtime.Object, err error) { + lockOps = append(lockOps, "create") + lockObj = action.(fakeclient.CreateAction).GetObject() + return true, lockObj, nil + }, + }, + { + verb: "update", + objectType: objectType, + reaction: func(action fakeclient.Action) (handled bool, ret runtime.Object, err error) { + updates++ + lockOps = append(lockOps, "update") + if updates == 2 { + cancelFunc() + } + lockObj = action.(fakeclient.UpdateAction).GetObject() + return true, lockObj, nil + }, + }, + }, + expectedLockOps: []string{"get", "create", "update", "update"}, + }, + { + name: "Fallback to slow path after fast path fails", + reactors: []Reactor{ + { + verb: "get", + objectType: objectType, + reaction: func(action fakeclient.Action) (handled bool, ret runtime.Object, err error) { + lockOps = append(lockOps, "get") + if lockObj != nil { + return true, lockObj, nil + } + return true, nil, errors.NewNotFound(action.(fakeclient.GetAction).GetResource().GroupResource(), action.(fakeclient.GetAction).GetName()) + }, + }, + { + verb: "create", + objectType: objectType, + reaction: func(action fakeclient.Action) (handled bool, ret runtime.Object, err error) { + lockOps = append(lockOps, "create") + lockObj = action.(fakeclient.CreateAction).GetObject() + return true, lockObj, nil + }, + }, + { + verb: "update", + objectType: objectType, + reaction: func(action fakeclient.Action) (handled bool, ret runtime.Object, err error) { + updates++ + lockOps = append(lockOps, "update") + switch updates { + case 2: + return true, nil, errors.NewConflict(action.(fakeclient.UpdateAction).GetResource().GroupResource(), "fake conflict", nil) + case 4: + cancelFunc() + } + lockObj = action.(fakeclient.UpdateAction).GetObject() + return true, lockObj, nil + }, + }, + }, + expectedLockOps: []string{"get", "create", "update", "update", "get", "update", "update"}, + }, + } + + for i := range tests { + test := &tests[i] + t.Run(test.name, func(t *testing.T) { + resetVars() + + 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, err := rl.New("leases", "foo", "bar", c.CoreV1(), c.CoordinationV1(), resourceLockConfig) + if err != nil { + t.Fatal("resourcelock.New() = ", err) + } + + lec.Lock = lock + elector, err := NewLeaderElector(lec) + if err != nil { + t.Fatal("Failed to create leader elector: ", err) + } + + ctx, cancel := context.WithCancel(context.Background()) + cancelFunc = cancel + + elector.Run(ctx) + assert.Equal(t, test.expectedLockOps, lockOps, "Expected lock ops %q, got %q", test.expectedLockOps, lockOps) + }) + } +} From 2a48f1ee021e873628f92337b9eaee13d5798375 Mon Sep 17 00:00:00 2001 From: Eric Lin Date: Mon, 27 Nov 2023 13:10:24 +0000 Subject: [PATCH 008/239] leaderelection: Instrument for when slowpath is exercised Signed-off-by: Eric Lin Kubernetes-commit: 1e54c050936be1a1e3e5758718ebca86096dbaea --- tools/leaderelection/leaderelection_test.go | 2 ++ tools/leaderelection/metrics.go | 30 ++++++++++++++------- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/tools/leaderelection/leaderelection_test.go b/tools/leaderelection/leaderelection_test.go index 8c94b35a2..de481e0ad 100644 --- a/tools/leaderelection/leaderelection_test.go +++ b/tools/leaderelection/leaderelection_test.go @@ -315,6 +315,7 @@ func testTryAcquireOrRenew(t *testing.T, objectType string) { observedRawRecord: observedRawRecord, observedTime: test.observedTime, clock: clock, + metrics: globalMetricsFactory.newLeaderMetrics(), } if test.expectSuccess != le.tryAcquireOrRenew(context.Background()) { if test.retryAfter != 0 { @@ -491,6 +492,7 @@ func testReleaseLease(t *testing.T, objectType string) { observedRawRecord: observedRawRecord, observedTime: test.observedTime, clock: clock.RealClock{}, + metrics: globalMetricsFactory.newLeaderMetrics(), } if !le.tryAcquireOrRenew(context.Background()) { t.Errorf("unexpected result of tryAcquireOrRenew: [succeeded=%v]", true) diff --git a/tools/leaderelection/metrics.go b/tools/leaderelection/metrics.go index 65917bf88..7438345fb 100644 --- a/tools/leaderelection/metrics.go +++ b/tools/leaderelection/metrics.go @@ -26,24 +26,26 @@ import ( type leaderMetricsAdapter interface { leaderOn(name string) leaderOff(name string) + slowpathExercised(name string) } -// GaugeMetric represents a single numerical value that can arbitrarily go up -// and down. -type SwitchMetric interface { +// LeaderMetric instruments metrics used in leader election. +type LeaderMetric interface { On(name string) Off(name string) + SlowpathExercised(name string) } type noopMetric struct{} -func (noopMetric) On(name string) {} -func (noopMetric) Off(name string) {} +func (noopMetric) On(name string) {} +func (noopMetric) Off(name string) {} +func (noopMetric) SlowpathExercised(name string) {} // defaultLeaderMetrics expects the caller to lock before setting any metrics. type defaultLeaderMetrics struct { // leader's value indicates if the current process is the owner of name lease - leader SwitchMetric + leader LeaderMetric } func (m *defaultLeaderMetrics) leaderOn(name string) { @@ -60,19 +62,27 @@ func (m *defaultLeaderMetrics) leaderOff(name string) { m.leader.Off(name) } +func (m *defaultLeaderMetrics) slowpathExercised(name string) { + if m == nil { + return + } + m.leader.SlowpathExercised(name) +} + type noMetrics struct{} -func (noMetrics) leaderOn(name string) {} -func (noMetrics) leaderOff(name string) {} +func (noMetrics) leaderOn(name string) {} +func (noMetrics) leaderOff(name string) {} +func (noMetrics) slowpathExercised(name string) {} // MetricsProvider generates various metrics used by the leader election. type MetricsProvider interface { - NewLeaderMetric() SwitchMetric + NewLeaderMetric() LeaderMetric } type noopMetricsProvider struct{} -func (_ noopMetricsProvider) NewLeaderMetric() SwitchMetric { +func (noopMetricsProvider) NewLeaderMetric() LeaderMetric { return noopMetric{} } From 8468c261bc55d5e30f520d2dc85c35cdfab8abcc Mon Sep 17 00:00:00 2001 From: Patrick Ohly Date: Fri, 1 Dec 2023 09:00:59 +0100 Subject: [PATCH 009/239] client-go events: also support context for NewEventBroadcasterAdapter 27a68aee3a4834 introduced context support. In order to use that also with NewEventBroadcasterAdapter, a variant of the call is needed to allow the caller to specify the context. The `logcheck:context` comment ensures that code which is meant to be contextual uses the new call. Kubernetes-commit: f8e25eff926c640c86daa46222bfaf8d625e75d7 --- tools/events/event_broadcaster.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tools/events/event_broadcaster.go b/tools/events/event_broadcaster.go index e0164f301..94c2012b8 100644 --- a/tools/events/event_broadcaster.go +++ b/tools/events/event_broadcaster.go @@ -404,7 +404,15 @@ type eventBroadcasterAdapterImpl struct { // NewEventBroadcasterAdapter creates a wrapper around new and legacy broadcasters to simplify // migration of individual components to the new Event API. +// +//logcheck:context // NewEventBroadcasterAdapterWithContext should be used instead because record.NewBroadcaster is called and works better when a context is supplied (contextual logging, cancellation). func NewEventBroadcasterAdapter(client clientset.Interface) EventBroadcasterAdapter { + return NewEventBroadcasterAdapterWithContext(context.Background(), client) +} + +// NewEventBroadcasterAdapterWithContext creates a wrapper around new and legacy broadcasters to simplify +// migration of individual components to the new Event API. +func NewEventBroadcasterAdapterWithContext(ctx context.Context, client clientset.Interface) EventBroadcasterAdapter { eventClient := &eventBroadcasterAdapterImpl{} if _, err := client.Discovery().ServerResourcesForGroupVersion(eventsv1.SchemeGroupVersion.String()); err == nil { eventClient.eventsv1Client = client.EventsV1() @@ -414,7 +422,7 @@ func NewEventBroadcasterAdapter(client clientset.Interface) EventBroadcasterAdap // we create it unconditionally because its overhead is minor and will simplify using usage // patterns of this library in all components. eventClient.coreClient = client.CoreV1() - eventClient.coreBroadcaster = record.NewBroadcaster() + eventClient.coreBroadcaster = record.NewBroadcaster(record.WithContext(ctx)) return eventClient } From 12b0e099db0772e1f9bcb14a4dd9b348db0277e0 Mon Sep 17 00:00:00 2001 From: Ricardo Lopes Date: Thu, 14 Dec 2023 06:26:45 +0000 Subject: [PATCH 010/239] Migrate client-go/metadata to contextual logging (#122225) * client-go: migrate metadata to contextual logging Signed-off-by: Ricardo Lopes * client-go: test for metadata contextual logs Signed-off-by: Ricardo Lopes * refactor: extract context for table driven testing Signed-off-by: Ricardo Lopes * refactor: pass context as first parameter Signed-off-by: Ricardo Lopes --------- Signed-off-by: Ricardo Lopes Kubernetes-commit: 86ab185fa1e98e249fe3e380217099832fe22a4e --- metadata/metadata.go | 4 ++-- metadata/metadata_test.go | 34 ++++++++++++++++++---------------- 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/metadata/metadata.go b/metadata/metadata.go index 8152aa124..2cc7e22ad 100644 --- a/metadata/metadata.go +++ b/metadata/metadata.go @@ -191,7 +191,7 @@ func (c *client) Get(ctx context.Context, name string, opts metav1.GetOptions, s } obj, err := result.Get() if runtime.IsNotRegisteredError(err) { - klog.V(5).Infof("Unable to retrieve PartialObjectMetadata: %#v", err) + klog.FromContext(ctx).V(5).Info("Could not retrieve PartialObjectMetadata", "err", err) rawBytes, err := result.Raw() if err != nil { return nil, err @@ -227,7 +227,7 @@ func (c *client) List(ctx context.Context, opts metav1.ListOptions) (*metav1.Par } obj, err := result.Get() if runtime.IsNotRegisteredError(err) { - klog.V(5).Infof("Unable to retrieve PartialObjectMetadataList: %#v", err) + klog.FromContext(ctx).V(5).Info("Could not retrieve PartialObjectMetadataList", "err", err) rawBytes, err := result.Raw() if err != nil { return nil, err diff --git a/metadata/metadata_test.go b/metadata/metadata_test.go index ff52b5a12..8e2069265 100644 --- a/metadata/metadata_test.go +++ b/metadata/metadata_test.go @@ -32,6 +32,7 @@ import ( "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/client-go/rest" + "k8s.io/klog/v2/ktesting" ) func TestClient(t *testing.T) { @@ -55,7 +56,7 @@ func TestClient(t *testing.T) { testCases := []struct { name string handler func(t *testing.T, w http.ResponseWriter, req *http.Request) - want func(t *testing.T, client *Client) + want func(ctx context.Context, t *testing.T, client *Client) }{ { name: "GET is able to convert a JSON object to PartialObjectMetadata", @@ -77,8 +78,8 @@ func TestClient(t *testing.T) { }, }) }, - want: func(t *testing.T, client *Client) { - obj, err := client.Resource(gvr).Namespace("ns").Get(context.TODO(), "name", metav1.GetOptions{}) + want: func(ctx context.Context, t *testing.T, client *Client) { + obj, err := client.Resource(gvr).Namespace("ns").Get(ctx, "name", metav1.GetOptions{}) if err != nil { t.Fatal(err) } @@ -125,8 +126,8 @@ func TestClient(t *testing.T) { }, }) }, - want: func(t *testing.T, client *Client) { - objs, err := client.Resource(gvr).Namespace("ns").List(context.TODO(), metav1.ListOptions{}) + want: func(ctx context.Context, t *testing.T, client *Client) { + objs, err := client.Resource(gvr).Namespace("ns").List(ctx, metav1.ListOptions{}) if err != nil { t.Fatal(err) } @@ -167,8 +168,8 @@ func TestClient(t *testing.T) { }, }) }, - want: func(t *testing.T, client *Client) { - obj, err := client.Resource(gvr).Namespace("ns").Get(context.TODO(), "name", metav1.GetOptions{}) + want: func(ctx context.Context, t *testing.T, client *Client) { + obj, err := client.Resource(gvr).Namespace("ns").Get(ctx, "name", metav1.GetOptions{}) if err == nil || !runtime.IsMissingKind(err) { t.Fatal(err) } @@ -196,8 +197,8 @@ func TestClient(t *testing.T) { }, }) }, - want: func(t *testing.T, client *Client) { - obj, err := client.Resource(gvr).Namespace("ns").Get(context.TODO(), "name", metav1.GetOptions{}) + want: func(ctx context.Context, t *testing.T, client *Client) { + obj, err := client.Resource(gvr).Namespace("ns").Get(ctx, "name", metav1.GetOptions{}) if err == nil || !runtime.IsMissingVersion(err) { t.Fatal(err) } @@ -224,8 +225,8 @@ func TestClient(t *testing.T) { ObjectMeta: metav1.ObjectMeta{}, }) }, - want: func(t *testing.T, client *Client) { - obj, err := client.Resource(gvr).Namespace("ns").Get(context.TODO(), "name", metav1.GetOptions{}) + want: func(ctx context.Context, t *testing.T, client *Client) { + obj, err := client.Resource(gvr).Namespace("ns").Get(ctx, "name", metav1.GetOptions{}) if err == nil || !strings.Contains(err.Error(), "object does not appear to match the ObjectMeta schema") { t.Fatal(err) } @@ -254,8 +255,8 @@ func TestClient(t *testing.T) { } writeJSON(t, w, statusOK) }, - want: func(t *testing.T, client *Client) { - err := client.Resource(gvr).Namespace("ns").Delete(context.TODO(), "name", metav1.DeleteOptions{}) + want: func(ctx context.Context, t *testing.T, client *Client) { + err := client.Resource(gvr).Namespace("ns").Delete(ctx, "name", metav1.DeleteOptions{}) if err != nil { t.Fatal(err) } @@ -282,8 +283,8 @@ func TestClient(t *testing.T) { writeJSON(t, w, statusOK) }, - want: func(t *testing.T, client *Client) { - err := client.Resource(gvr).Namespace("ns").DeleteCollection(context.TODO(), metav1.DeleteOptions{}, metav1.ListOptions{}) + want: func(ctx context.Context, t *testing.T, client *Client) { + err := client.Resource(gvr).Namespace("ns").DeleteCollection(ctx, metav1.DeleteOptions{}, metav1.ListOptions{}) if err != nil { t.Fatal(err) } @@ -296,9 +297,10 @@ func TestClient(t *testing.T) { s := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { tt.handler(t, w, req) })) defer s.Close() + _, ctx := ktesting.NewTestContext(t) cfg := ConfigFor(&rest.Config{Host: s.URL}) client := NewForConfigOrDie(cfg).(*Client) - tt.want(t, client) + tt.want(ctx, t, client) }) } } From c609c97b33553d2ad162475462ff4e0d3f2d37a2 Mon Sep 17 00:00:00 2001 From: weilaaa Date: Fri, 15 Dec 2023 15:09:11 +0800 Subject: [PATCH 011/239] use build-in max and min func to instead of k8s.io/utils/integer funcs Kubernetes-commit: eb8f3f194fed16484162aebdaab69168e02f8cb4 --- util/flowcontrol/backoff.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/util/flowcontrol/backoff.go b/util/flowcontrol/backoff.go index 3ef88dbdb..82e4c4c40 100644 --- a/util/flowcontrol/backoff.go +++ b/util/flowcontrol/backoff.go @@ -23,7 +23,6 @@ import ( "k8s.io/utils/clock" testingclock "k8s.io/utils/clock/testing" - "k8s.io/utils/integer" ) type backoffEntry struct { @@ -100,7 +99,7 @@ func (p *Backoff) Next(id string, eventTime time.Time) { } else { delay := entry.backoff * 2 // exponential delay += p.jitter(entry.backoff) // add some jitter to the delay - entry.backoff = time.Duration(integer.Int64Min(int64(delay), int64(p.maxDuration))) + entry.backoff = min(delay, p.maxDuration) } entry.lastUpdate = p.Clock.Now() } From abce78fd54d1dca86633625eedb30b08b5211579 Mon Sep 17 00:00:00 2001 From: Patrick Ohly Date: Tue, 19 Dec 2023 16:16:02 +0100 Subject: [PATCH 012/239] dependencies: gomega v1.30.0 + ginkgo v2.13.2 The new gomega.BeTrueBecause and gomega.BeFalseBecause are going to be useful for https://github.com/kubernetes/kubernetes/issues/105678. Kubernetes-commit: c8f9ebfb72b6569b4e2ec9733f6998afc6602135 --- go.mod | 11 ++++++----- go.sum | 28 ++++++++++++++++------------ 2 files changed, 22 insertions(+), 17 deletions(-) diff --git a/go.mod b/go.mod index fe54d37cb..1dfd5ac63 100644 --- a/go.mod +++ b/go.mod @@ -24,8 +24,8 @@ require ( golang.org/x/term v0.13.0 golang.org/x/time v0.3.0 google.golang.org/protobuf v1.31.0 - k8s.io/api v0.0.0-20231218211704-fa9b0f032aab - k8s.io/apimachinery v0.0.0-20231214011457-e2f405af78de + k8s.io/api v0.0.0 + k8s.io/apimachinery v0.0.0 k8s.io/klog/v2 v2.110.1 k8s.io/kube-openapi v0.0.0-20231113174909-778a5567bc1e k8s.io/utils v0.0.0-20230726121419-3b25d923346b @@ -52,7 +52,7 @@ 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.13.0 // indirect + golang.org/x/sys v0.14.0 // indirect golang.org/x/text v0.13.0 // indirect google.golang.org/appengine v1.6.7 // indirect gopkg.in/inf.v0 v0.9.1 // indirect @@ -61,6 +61,7 @@ require ( ) replace ( - k8s.io/api => k8s.io/api v0.0.0-20231218211704-fa9b0f032aab - k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20231214011457-e2f405af78de + k8s.io/api => ../api + k8s.io/apimachinery => ../apimachinery + k8s.io/client-go => ../client-go ) diff --git a/go.sum b/go.sum index c01b8cbb5..f295045cf 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= @@ -74,10 +78,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.13.0 h1:0jY9lJquiL8fcf3M4LAXN5aMlS/b2BV86HFFPCPMgE4= -github.com/onsi/ginkgo/v2 v2.13.0/go.mod h1:TE309ZR8s5FsKKpuB1YAQYBzCaAfUgatB/xlT/ETL/o= -github.com/onsi/gomega v1.29.0 h1:KIA/t2t5UBzoirT4H9tsML45GEbo3ouUnBHsCfD2tVg= -github.com/onsi/gomega v1.29.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ= +github.com/onsi/ginkgo/v2 v2.13.2 h1:Bi2gGVkfn6gQcjNjZJVO8Gf0FHzMPf2phUei9tejVMs= +github.com/onsi/ginkgo/v2 v2.13.2/go.mod h1:XStQ8QcGwLyF4HdfcZB8SFOS/MWCgDuXMSBe6zrvLgM= +github.com/onsi/gomega v1.30.0 h1:hvMK7xYz4D3HapigLTeGdId/NcfQx1VHMJc60ew99+8= +github.com/onsi/gomega v1.30.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ= 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= @@ -102,8 +106,10 @@ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9dec golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= 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.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= 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= @@ -119,8 +125,8 @@ 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.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= -golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q= +golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.13.0 h1:bb+I9cTfFazGW51MZqBVmZy7+JEJMouUHTUSKVQLBek= golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -134,12 +140,13 @@ golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGm 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.12.0 h1:YW6HUoUmYBpwSgyaGaZq1fHjrBjX1rlpZ54T6mu2kss= -golang.org/x/tools v0.12.0/go.mod h1:Sc0INKfu04TlqNoRA1hgpFZbhYXHPr4V5DzpSBTPqQM= +golang.org/x/tools v0.14.0 h1:jvNa2pY0M4r62jkRQ6RwEZZyPcymeL9XZMLBbV7U2nc= +golang.org/x/tools v0.14.0/go.mod h1:uYBEerGOWcJyEORxN+Ek8+TT266gXkNlHdJBwexUsBg= golang.org/x/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/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.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= @@ -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-20231218211704-fa9b0f032aab h1:pLXSv38simFZcg/4cgOv9APOSfGPb8nosA11RQNgzBE= -k8s.io/api v0.0.0-20231218211704-fa9b0f032aab/go.mod h1:3qapnEMm0F6dC2quMZEkgRdY1XZO9qCO3VJfYdAZMhg= -k8s.io/apimachinery v0.0.0-20231214011457-e2f405af78de h1:gOF2Xlsae9C8Cp7Te7Pxw2D0i4m8ddqrsX8lAvfsOrE= -k8s.io/apimachinery v0.0.0-20231214011457-e2f405af78de/go.mod h1:djf1C8dGXS7Htg00o2kMGnUD7h6rmK/5k36U8AzZRSw= +k8s.io/gengo v0.0.0-20230829151522-9cce18d56c01/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= k8s.io/klog/v2 v2.110.1 h1:U/Af64HJf7FcwMcXyKm2RPM22WZzyR7OSpYj5tg3cL0= k8s.io/klog/v2 v2.110.1/go.mod h1:YGtd1984u+GgbuZ7e08/yBuAfKLSO0+uR1Fhi6ExXjo= k8s.io/kube-openapi v0.0.0-20231113174909-778a5567bc1e h1:snPmy96t93RredGRjKfMFt+gvxuVAncqSAyBveJtr4Q= From 96e9c8d6f10a7c40a7bd95e0723b18808227b315 Mon Sep 17 00:00:00 2001 From: Kubernetes Publisher Date: Wed, 20 Dec 2023 09:43:17 +0100 Subject: [PATCH 013/239] Merge pull request #122395 from pohly/ginkgo-gomega-update dependencies: gomega v1.30.0 + ginkgo v2.13.2 Kubernetes-commit: 7897910469aa091ebf6576740d055a7137fa147c --- go.mod | 9 ++++----- go.sum | 12 ++++-------- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/go.mod b/go.mod index 1dfd5ac63..ce69fb5a1 100644 --- a/go.mod +++ b/go.mod @@ -24,8 +24,8 @@ require ( golang.org/x/term v0.13.0 golang.org/x/time v0.3.0 google.golang.org/protobuf v1.31.0 - k8s.io/api v0.0.0 - k8s.io/apimachinery v0.0.0 + k8s.io/api v0.0.0-20231220091747-b3fafe75341f + k8s.io/apimachinery v0.0.0-20231220091526-8bd2c20b5393 k8s.io/klog/v2 v2.110.1 k8s.io/kube-openapi v0.0.0-20231113174909-778a5567bc1e k8s.io/utils v0.0.0-20230726121419-3b25d923346b @@ -61,7 +61,6 @@ require ( ) replace ( - k8s.io/api => ../api - k8s.io/apimachinery => ../apimachinery - k8s.io/client-go => ../client-go + k8s.io/api => k8s.io/api v0.0.0-20231220091747-b3fafe75341f + k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20231220091526-8bd2c20b5393 ) diff --git a/go.sum b/go.sum index f295045cf..0a48ae085 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= @@ -106,10 +102,8 @@ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9dec golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= 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.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= 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 +140,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.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= @@ -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 v0.0.0-20230829151522-9cce18d56c01/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= +k8s.io/api v0.0.0-20231220091747-b3fafe75341f h1:MWFeee5ekUhC0MQrctagitdrP3VqrdQWOz2JnErMSAU= +k8s.io/api v0.0.0-20231220091747-b3fafe75341f/go.mod h1:3uGod102/aazADRMvSW3cxxK6uGcQlg4iiO9XVOuHDY= +k8s.io/apimachinery v0.0.0-20231220091526-8bd2c20b5393 h1:RDU2rESl7W4JAuoni0+np9rf0E30jYgnJWgnZktd4ao= +k8s.io/apimachinery v0.0.0-20231220091526-8bd2c20b5393/go.mod h1:zeo+CJvOSDqHuPUwqnrkKc7QvcWZ5biQad5gW1uZRh0= k8s.io/klog/v2 v2.110.1 h1:U/Af64HJf7FcwMcXyKm2RPM22WZzyR7OSpYj5tg3cL0= k8s.io/klog/v2 v2.110.1/go.mod h1:YGtd1984u+GgbuZ7e08/yBuAfKLSO0+uR1Fhi6ExXjo= k8s.io/kube-openapi v0.0.0-20231113174909-778a5567bc1e h1:snPmy96t93RredGRjKfMFt+gvxuVAncqSAyBveJtr4Q= From 4106282f90358061b73a561a2f42fd6913e0197b Mon Sep 17 00:00:00 2001 From: Madhav Jivrajani Date: Wed, 20 Dec 2023 14:31:31 +0530 Subject: [PATCH 014/239] .*: bump golang.org/x/tools to v0.16.1 Bumping tools to include the fix for a nil pointer deref error in go/types. See golang/go#64812 for more details. This fix is needed for when we bump to go1.22. Signed-off-by: Madhav Jivrajani Kubernetes-commit: a8da4202c0ac785d57b545e6e310fd754888b50e --- go.mod | 17 +++++++++-------- go.sum | 32 ++++++++++++++++++-------------- 2 files changed, 27 insertions(+), 22 deletions(-) diff --git a/go.mod b/go.mod index ce69fb5a1..7a5e71530 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.17.0 + golang.org/x/net v0.19.0 golang.org/x/oauth2 v0.10.0 - golang.org/x/term v0.13.0 + golang.org/x/term v0.15.0 golang.org/x/time v0.3.0 google.golang.org/protobuf v1.31.0 - k8s.io/api v0.0.0-20231220091747-b3fafe75341f - k8s.io/apimachinery v0.0.0-20231220091526-8bd2c20b5393 + k8s.io/api v0.0.0 + k8s.io/apimachinery v0.0.0 k8s.io/klog/v2 v2.110.1 k8s.io/kube-openapi v0.0.0-20231113174909-778a5567bc1e k8s.io/utils v0.0.0-20230726121419-3b25d923346b @@ -52,8 +52,8 @@ 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.14.0 // indirect - golang.org/x/text v0.13.0 // indirect + golang.org/x/sys v0.15.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 @@ -61,6 +61,7 @@ require ( ) replace ( - k8s.io/api => k8s.io/api v0.0.0-20231220091747-b3fafe75341f - k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20231220091526-8bd2c20b5393 + k8s.io/api => ../api + k8s.io/apimachinery => ../apimachinery + k8s.io/client-go => ../client-go ) diff --git a/go.sum b/go.sum index 0a48ae085..b60638dbb 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= @@ -102,15 +106,17 @@ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9dec 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.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= 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.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= 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.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= -golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= +golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c= +golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= 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= @@ -119,27 +125,28 @@ 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.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q= -golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/term v0.13.0 h1:bb+I9cTfFazGW51MZqBVmZy7+JEJMouUHTUSKVQLBek= -golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= +golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= +golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/term v0.15.0 h1:y/Oo/a/q3IXu26lQgl04j/gjuBDOBlx7X6Om1j2CPW4= +golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= -golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= 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.14.0 h1:jvNa2pY0M4r62jkRQ6RwEZZyPcymeL9XZMLBbV7U2nc= -golang.org/x/tools v0.14.0/go.mod h1:uYBEerGOWcJyEORxN+Ek8+TT266gXkNlHdJBwexUsBg= +golang.org/x/tools v0.16.1 h1:TLyB3WofjdOEepBHAU20JdNC1Zbg87elYofWYAY5oZA= +golang.org/x/tools v0.16.1/go.mod h1:kYVVN6I1mBNoB1OX+noeBjbRk4IUEPa7JJ+TJMEooJ0= 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/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.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= @@ -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-20231220091747-b3fafe75341f h1:MWFeee5ekUhC0MQrctagitdrP3VqrdQWOz2JnErMSAU= -k8s.io/api v0.0.0-20231220091747-b3fafe75341f/go.mod h1:3uGod102/aazADRMvSW3cxxK6uGcQlg4iiO9XVOuHDY= -k8s.io/apimachinery v0.0.0-20231220091526-8bd2c20b5393 h1:RDU2rESl7W4JAuoni0+np9rf0E30jYgnJWgnZktd4ao= -k8s.io/apimachinery v0.0.0-20231220091526-8bd2c20b5393/go.mod h1:zeo+CJvOSDqHuPUwqnrkKc7QvcWZ5biQad5gW1uZRh0= +k8s.io/gengo v0.0.0-20230829151522-9cce18d56c01/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= k8s.io/klog/v2 v2.110.1 h1:U/Af64HJf7FcwMcXyKm2RPM22WZzyR7OSpYj5tg3cL0= k8s.io/klog/v2 v2.110.1/go.mod h1:YGtd1984u+GgbuZ7e08/yBuAfKLSO0+uR1Fhi6ExXjo= k8s.io/kube-openapi v0.0.0-20231113174909-778a5567bc1e h1:snPmy96t93RredGRjKfMFt+gvxuVAncqSAyBveJtr4Q= From 5a0a4247921dd9e72d158aaa6c1ee124aba1da80 Mon Sep 17 00:00:00 2001 From: Kubernetes Publisher Date: Wed, 20 Dec 2023 18:07:30 +0100 Subject: [PATCH 015/239] Merge pull request #122412 from MadhavJivrajani/bump-go-tools [go1.22] .*: bump golang.org/x/tools to v0.16.1 Kubernetes-commit: 8a4403a9e5127d2ec3f596c4ce75663e5392cb18 --- go.mod | 9 ++++----- go.sum | 12 ++++-------- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/go.mod b/go.mod index 7a5e71530..654aa1413 100644 --- a/go.mod +++ b/go.mod @@ -24,8 +24,8 @@ require ( golang.org/x/term v0.15.0 golang.org/x/time v0.3.0 google.golang.org/protobuf v1.31.0 - k8s.io/api v0.0.0 - k8s.io/apimachinery v0.0.0 + k8s.io/api v0.0.0-20231220172311-84c476802242 + k8s.io/apimachinery v0.0.0-20231220171733-60eaa653342b k8s.io/klog/v2 v2.110.1 k8s.io/kube-openapi v0.0.0-20231113174909-778a5567bc1e k8s.io/utils v0.0.0-20230726121419-3b25d923346b @@ -61,7 +61,6 @@ require ( ) replace ( - k8s.io/api => ../api - k8s.io/apimachinery => ../apimachinery - k8s.io/client-go => ../client-go + k8s.io/api => k8s.io/api v0.0.0-20231220172311-84c476802242 + k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20231220171733-60eaa653342b ) diff --git a/go.sum b/go.sum index b60638dbb..439b206c6 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= @@ -106,10 +102,8 @@ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9dec 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.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= 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.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= 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 +140,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.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= @@ -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 v0.0.0-20230829151522-9cce18d56c01/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= +k8s.io/api v0.0.0-20231220172311-84c476802242 h1:0vL/RpEDBpP1Ib7D/+Gn1GcXRKoLfzHk39Bimd2kBNI= +k8s.io/api v0.0.0-20231220172311-84c476802242/go.mod h1:77+m1u5YUTiZfSm1ad6sO9fCphn5EYI5cFzfE0VKOuY= +k8s.io/apimachinery v0.0.0-20231220171733-60eaa653342b h1:Z+R5mA4fTuumBjSg84ZIY+W8Gi3zW50/iw58LL1tUwQ= +k8s.io/apimachinery v0.0.0-20231220171733-60eaa653342b/go.mod h1:HcS5UNnaHsno0i/Q7QQQzqFd5WS+W26bysH+Ez3FLxA= k8s.io/klog/v2 v2.110.1 h1:U/Af64HJf7FcwMcXyKm2RPM22WZzyR7OSpYj5tg3cL0= k8s.io/klog/v2 v2.110.1/go.mod h1:YGtd1984u+GgbuZ7e08/yBuAfKLSO0+uR1Fhi6ExXjo= k8s.io/kube-openapi v0.0.0-20231113174909-778a5567bc1e h1:snPmy96t93RredGRjKfMFt+gvxuVAncqSAyBveJtr4Q= From ca4f3a73f7d349457d0c438db1f446c6e85ad389 Mon Sep 17 00:00:00 2001 From: Lukasz Szaszkiewicz Date: Tue, 2 Jan 2024 12:46:15 +0100 Subject: [PATCH 016/239] client-go/features: introduce feature gates This PR add a feature gates mechanisim to client-go as described in https://docs.google.com/document/d/1g9BGCRw-7ucUxO6OtCWbb3lfzUGA_uU9178wLdXAIfs In particular: - Adds a default feature gate implementation based on environment variables. - Adds a set of methods for reading, overwriting the default implementation, and adding features to an external registry. Co-authored-by: deads2k Co-authored-by: Ben Luddy Kubernetes-commit: d74c57d4f592d20a992afb54b1ee64f56215210e --- features/envvar.go | 129 +++++++++++++++++++++ features/envvar_test.go | 148 +++++++++++++++++++++++++ features/features.go | 131 ++++++++++++++++++++++ features/features_test.go | 40 +++++++ features/testing/features_init_test.go | 79 +++++++++++++ 5 files changed, 527 insertions(+) create mode 100644 features/envvar.go create mode 100644 features/envvar_test.go create mode 100644 features/features.go create mode 100644 features/features_test.go create mode 100644 features/testing/features_init_test.go diff --git a/features/envvar.go b/features/envvar.go new file mode 100644 index 000000000..6761e16c1 --- /dev/null +++ b/features/envvar.go @@ -0,0 +1,129 @@ +/* +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 features + +import ( + "fmt" + "os" + "strconv" + "sync" + "sync/atomic" + + "k8s.io/apimachinery/pkg/util/naming" + utilruntime "k8s.io/apimachinery/pkg/util/runtime" + "k8s.io/klog/v2" +) + +// internalPackages are packages that ignored when creating a name for featureGates. These packages are in the common +// call chains, so they'd be unhelpful as names. +var internalPackages = []string{"k8s.io/client-go/features/envvar.go"} + +var _ Gates = &envVarFeatureGates{} + +// newEnvVarFeatureGates creates a feature gate that allows for registration +// of features and checking if the features are enabled. +// +// On the first call to Enabled, the effective state of all known features is loaded from +// environment variables. The environment variable read for a given feature is formed by +// concatenating the prefix "KUBE_FEATURE_" with the feature's name. +// +// For example, if you have a feature named "MyFeature" +// setting an environmental variable "KUBE_FEATURE_MyFeature" +// will allow you to configure the state of that feature. +// +// Please note that environmental variables can only be set to the boolean value. +// Incorrect values will be ignored and logged. +func newEnvVarFeatureGates(features map[Feature]FeatureSpec) *envVarFeatureGates { + known := map[Feature]FeatureSpec{} + for name, spec := range features { + known[name] = spec + } + + fg := &envVarFeatureGates{ + callSiteName: naming.GetNameFromCallsite(internalPackages...), + known: known, + } + fg.enabled.Store(map[Feature]bool{}) + + return fg +} + +// envVarFeatureGates implements Gates and allows for feature registration. +type envVarFeatureGates struct { + // callSiteName holds the name of the file + // that created this instance + callSiteName string + + // readEnvVarsOnce guards reading environmental variables + readEnvVarsOnce sync.Once + + // known holds known feature gates + known map[Feature]FeatureSpec + + // enabled holds a map[Feature]bool + // with values explicitly set via env var + enabled atomic.Value +} + +// 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.getEnabledMapFromEnvVar()[key]; ok { + return v + } + if v, ok := f.known[key]; ok { + return v.Default + } + panic(fmt.Errorf("feature %q is not registered in FeatureGates %q", key, f.callSiteName)) +} + +// 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. +func (f *envVarFeatureGates) getEnabledMapFromEnvVar() map[Feature]bool { + f.readEnvVarsOnce.Do(func() { + featureGatesState := map[Feature]bool{} + for feature, featureSpec := range f.known { + featureState, featureStateSet := os.LookupEnv(fmt.Sprintf("KUBE_FEATURE_%s", feature)) + if !featureStateSet { + continue + } + boolVal, boolErr := strconv.ParseBool(featureState) + switch { + case boolErr != nil: + utilruntime.HandleError(fmt.Errorf("cannot set feature gate %q to %q, due to %v", feature, featureState, boolErr)) + case featureSpec.LockToDefault: + if boolVal != featureSpec.Default { + utilruntime.HandleError(fmt.Errorf("cannot set feature gate %q to %q, feature is locked to %v", feature, featureState, featureSpec.Default)) + break + } + featureGatesState[feature] = featureSpec.Default + default: + featureGatesState[feature] = boolVal + } + } + f.enabled.Store(featureGatesState) + + for feature, featureSpec := range f.known { + if featureState, ok := featureGatesState[feature]; ok { + klog.V(1).InfoS("Feature gate updated state", "feature", feature, "enabled", featureState) + continue + } + klog.V(1).InfoS("Feature gate default state", "feature", feature, "enabled", featureSpec.Default) + } + }) + return f.enabled.Load().(map[Feature]bool) +} diff --git a/features/envvar_test.go b/features/envvar_test.go new file mode 100644 index 000000000..8406a4474 --- /dev/null +++ b/features/envvar_test.go @@ -0,0 +1,148 @@ +/* +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 features + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/require" +) + +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 { + m[k] = v + } + return m + } + + scenarios := []struct { + name string + features map[Feature]FeatureSpec + envVariables map[string]string + expectedFeaturesState map[Feature]bool + expectedInternalEnabledFeatureState map[Feature]bool + }{ + { + name: "can add empty features", + }, + { + name: "no env var, features get Defaults assigned", + features: defaultTestFeatures, + expectedFeaturesState: expectedDefaultFeaturesState, + }, + { + name: "incorrect env var, feature gets Default assigned", + features: defaultTestFeatures, + envVariables: map[string]string{"TestAlpha": "true"}, + expectedFeaturesState: expectedDefaultFeaturesState, + }, + { + name: "correct env var changes the feature gets state", + features: defaultTestFeatures, + envVariables: map[string]string{"KUBE_FEATURE_TestAlpha": "true"}, + expectedFeaturesState: func() map[Feature]bool { + expectedDefaultFeaturesStateCopy := copyExpectedStateMap(expectedDefaultFeaturesState) + expectedDefaultFeaturesStateCopy["TestAlpha"] = true + return expectedDefaultFeaturesStateCopy + }(), + expectedInternalEnabledFeatureState: map[Feature]bool{"TestAlpha": true}, + }, + { + name: "incorrect env var value gets ignored", + features: defaultTestFeatures, + envVariables: map[string]string{"KUBE_FEATURE_TestAlpha": "TrueFalse"}, + expectedFeaturesState: expectedDefaultFeaturesState, + }, + { + name: "empty env var value gets ignored", + features: defaultTestFeatures, + envVariables: map[string]string{"KUBE_FEATURE_TestAlpha": ""}, + expectedFeaturesState: expectedDefaultFeaturesState, + }, + { + name: "a feature LockToDefault wins", + features: map[Feature]FeatureSpec{ + "TestAlpha": { + Default: true, + LockToDefault: true, + PreRelease: "Alpha", + }, + }, + envVariables: map[string]string{"KUBE_FEATURE_TestAlpha": "False"}, + expectedFeaturesState: map[Feature]bool{"TestAlpha": true}, + }, + { + name: "setting a feature to LockToDefault changes the internal state", + features: map[Feature]FeatureSpec{ + "TestAlpha": { + Default: true, + LockToDefault: true, + PreRelease: "Alpha", + }, + }, + envVariables: map[string]string{"KUBE_FEATURE_TestAlpha": "True"}, + expectedFeaturesState: map[Feature]bool{"TestAlpha": true}, + expectedInternalEnabledFeatureState: map[Feature]bool{"TestAlpha": true}, + }, + } + for _, scenario := range scenarios { + t.Run(scenario.name, func(t *testing.T) { + for k, v := range scenario.envVariables { + t.Setenv(k, v) + } + target := newEnvVarFeatureGates(scenario.features) + + 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) + + expectedFeatureInternalValue := scenario.expectedFeaturesState[expectedFeature] + require.Equal(t, expectedFeatureInternalValue, featureInternalValue) + } + }) + } +} + +func TestEnvVarFeatureGatesEnabledPanic(t *testing.T) { + target := newEnvVarFeatureGates(nil) + require.PanicsWithError(t, fmt.Errorf("feature %q is not registered in FeatureGates %q", "UnknownFeature", target.callSiteName).Error(), func() { target.Enabled("UnknownFeature") }) +} diff --git a/features/features.go b/features/features.go new file mode 100644 index 000000000..8226905f9 --- /dev/null +++ b/features/features.go @@ -0,0 +1,131 @@ +/* +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 features + +import ( + "sync/atomic" +) + +// NOTE: types Feature, FeatureSpec, prerelease (and its values) +// were duplicated from the component-base repository +// +// for more information please refer to https://docs.google.com/document/d/1g9BGCRw-7ucUxO6OtCWbb3lfzUGA_uU9178wLdXAIfs + +const ( + // Values for PreRelease. + Alpha = prerelease("ALPHA") + Beta = prerelease("BETA") + GA = prerelease("") + + // Deprecated + Deprecated = prerelease("DEPRECATED") +) + +type prerelease string + +type Feature string + +type FeatureSpec struct { + // Default is the default enablement state for the feature + Default bool + // LockToDefault indicates that the feature is locked to its default and cannot be changed + LockToDefault bool + // PreRelease indicates the maturity level of the feature + PreRelease prerelease +} + +// Gates indicates whether a given feature is enabled or not. +type Gates interface { + // Enabled returns true if the key is enabled. + Enabled(key Feature) bool +} + +// Registry represents an external feature gates registry. +type Registry interface { + // Add adds existing feature gates to the provided registry. + // + // As of today, this method is used by AddFeaturesToExistingFeatureGates and + // ReplaceFeatureGates to take control of the features exposed by this library. + Add(map[Feature]FeatureSpec) error +} + +// FeatureGates returns the feature gates exposed by this library. +// +// By default, only the default features gates will be returned. +// The default implementation allows controlling the features +// via environmental variables. +// For example, if you have a feature named "MyFeature" +// setting an environmental variable "KUBE_FEATURE_MyFeature" +// will allow you to configure the state of that feature. +// +// Please note that the actual set of the feature gates +// might be overwritten by calling ReplaceFeatureGates method. +func FeatureGates() Gates { + return featureGates.Load().(*featureGatesWrapper).Gates +} + +// AddFeaturesToExistingFeatureGates adds the default feature gates to the provided registry. +// Usually this function is combined with ReplaceFeatureGates to take control of the +// features exposed by this library. +func AddFeaturesToExistingFeatureGates(registry Registry) error { + return registry.Add(defaultKubernetesFeatureGates) +} + +// ReplaceFeatureGates overwrites the default implementation of the feature gates +// used by this library. +// +// Useful for binaries that would like to have full control of the features +// exposed by this library, such as allowing consumers of a binary +// to interact with the features via a command line flag. +// +// For example: +// +// // first, register client-go's features to your registry. +// clientgofeaturegate.AddFeaturesToExistingFeatureGates(utilfeature.DefaultMutableFeatureGate) +// // then replace client-go's feature gates implementation with your implementation +// clientgofeaturegate.ReplaceFeatureGates(utilfeature.DefaultMutableFeatureGate) +func ReplaceFeatureGates(newFeatureGates Gates) { + wrappedFeatureGates := &featureGatesWrapper{newFeatureGates} + featureGates.Store(wrappedFeatureGates) +} + +func init() { + envVarGates := newEnvVarFeatureGates(defaultKubernetesFeatureGates) + + wrappedFeatureGates := &featureGatesWrapper{envVarGates} + featureGates.Store(wrappedFeatureGates) +} + +// featureGatesWrapper a thin wrapper to satisfy featureGates variable (atomic.Value). +// That is, all calls to Store for a given Value must use values of the same concrete type. +type featureGatesWrapper struct { + Gates +} + +var ( + // featureGates is a shared global FeatureGates. + // + // Top-level commands/options setup that needs to modify this feature gates + // should use AddFeaturesToExistingFeatureGates followed by ReplaceFeatureGates. + featureGates = &atomic.Value{} +) + +// defaultKubernetesFeatureGates consists of all known Kubernetes-specific feature keys. +// +// To add a new feature, define a key for it above and add it here. The features will be +// available throughout Kubernetes binaries. +var defaultKubernetesFeatureGates = map[Feature]FeatureSpec{} diff --git a/features/features_test.go b/features/features_test.go new file mode 100644 index 000000000..a6089be5c --- /dev/null +++ b/features/features_test.go @@ -0,0 +1,40 @@ +/* +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 features + +import ( + "testing" + + "github.com/stretchr/testify/require" +) + +// TestAddFeaturesToExistingFeatureGates ensures that +// the defaultKubernetesFeatureGates are added to a test feature gates registry. +func TestAddFeaturesToExistingFeatureGates(t *testing.T) { + fakeFeatureGates := &fakeRegistry{} + require.NoError(t, AddFeaturesToExistingFeatureGates(fakeFeatureGates)) + require.Equal(t, defaultKubernetesFeatureGates, fakeFeatureGates.specs) +} + +type fakeRegistry struct { + specs map[Feature]FeatureSpec +} + +func (f *fakeRegistry) Add(specs map[Feature]FeatureSpec) error { + f.specs = specs + return nil +} diff --git a/features/testing/features_init_test.go b/features/testing/features_init_test.go new file mode 100644 index 000000000..bc22e58b6 --- /dev/null +++ b/features/testing/features_init_test.go @@ -0,0 +1,79 @@ +/* +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" + "testing" + + "github.com/stretchr/testify/require" + + "k8s.io/client-go/features" +) + +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")) + + features.ReplaceFeatureGates(fakeFeatureGates) + featureGates = features.FeatureGates() + + assertFeatureGatesType(t, featureGates) + require.True(t, featureGates.Enabled("FakeFeatureGate")) +} + +type alwaysEnabledFakeGates struct{} + +func (f *alwaysEnabledFakeGates) Enabled(features.Feature) bool { + return true +} + +func assertFeatureGatesType(t *testing.T, fg features.Gates) { + _, ok := fg.(*alwaysEnabledFakeGates) + if !ok { + t.Fatalf("passed features.FeatureGates() is NOT of type *alwaysEnabledFakeGates, it is of type = %T", fg) + } +} + +func assertFunctionPanicsWithMessage(t *testing.T, f func(), fName, errMessage string) { + didPanic, panicMessage := didFunctionPanic(f) + if !didPanic { + t.Fatalf("function %q did not panicked", fName) + } + + panicError, ok := panicMessage.(error) + if !ok || !strings.Contains(panicError.Error(), errMessage) { + t.Fatalf("func %q should panic with error message:\t%#v\n\tPanic value:\t%#v\n", fName, errMessage, panicMessage) + } +} + +func didFunctionPanic(f func()) (didPanic bool, panicMessage interface{}) { + didPanic = true + + defer func() { + panicMessage = recover() + }() + + f() + didPanic = false + + return +} From 9f8ed7bc9029925585acac4ed719ddda1ed964b7 Mon Sep 17 00:00:00 2001 From: Lukasz Szaszkiewicz Date: Wed, 3 Jan 2024 13:24:35 +0100 Subject: [PATCH 017/239] client-go/features: move the defaultKubernetesFeatureGates variable to the new file Kubernetes-commit: 57ec7d20e89990d62ef85835cd37cc32ea6a418e --- features/features.go | 6 ------ features/known_features.go | 23 +++++++++++++++++++++++ 2 files changed, 23 insertions(+), 6 deletions(-) create mode 100644 features/known_features.go diff --git a/features/features.go b/features/features.go index 7b9d050ef..afb67f509 100644 --- a/features/features.go +++ b/features/features.go @@ -141,9 +141,3 @@ var ( // should use AddFeaturesToExistingFeatureGates followed by ReplaceFeatureGates. featureGates = &atomic.Value{} ) - -// defaultKubernetesFeatureGates consists of all known Kubernetes-specific feature keys. -// -// To add a new feature, define a key for it above and add it here. The features will be -// available throughout Kubernetes binaries. -var defaultKubernetesFeatureGates = map[Feature]FeatureSpec{} diff --git a/features/known_features.go b/features/known_features.go new file mode 100644 index 000000000..3e3f15aba --- /dev/null +++ b/features/known_features.go @@ -0,0 +1,23 @@ +/* +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 features + +// defaultKubernetesFeatureGates consists of all known Kubernetes-specific feature keys. +// +// To add a new feature, define a key for it above and add it here. The features will be +// available throughout Kubernetes binaries. +var defaultKubernetesFeatureGates = map[Feature]FeatureSpec{} From 49ba51431a5a25e8ca744c27da5853d45cc027a9 Mon Sep 17 00:00:00 2001 From: Lukasz Szaszkiewicz Date: Wed, 3 Jan 2024 13:32:02 +0100 Subject: [PATCH 018/239] client-go/features: introduce WatchListClient feature gate Kubernetes-commit: 7773b0f53fd5003c1e018321efb791e8980cd02f --- features/known_features.go | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/features/known_features.go b/features/known_features.go index 3e3f15aba..329eed725 100644 --- a/features/known_features.go +++ b/features/known_features.go @@ -16,8 +16,34 @@ limitations under the License. package features +const ( + // Every feature gate should add method here following this template: + // + // // owner: @username + // // alpha: v1.4 + // MyFeature featuregate.Feature = "MyFeature" + // + // Feature gates should be listed in alphabetical, case-sensitive + // (upper before any lower case character) order. This reduces the risk + // of code conflicts because changes are more likely to be scattered + // across the file. + + // owner: @p0lyn0mial + // beta: v1.30 + // + // Allow the client to get a stream of individual items instead of chunking from the server. + // + // NOTE: + // The feature is disabled in Beta by default because + // it will only be turned on for selected control plane component(s). + WatchListClient Feature = "WatchListClient" +) + // defaultKubernetesFeatureGates consists of all known Kubernetes-specific feature keys. // -// To add a new feature, define a key for it above and add it here. The features will be -// available throughout Kubernetes binaries. -var defaultKubernetesFeatureGates = map[Feature]FeatureSpec{} +// To add a new feature, define a key for it above and add it here. +// After registering with the binary, the features are, by default, controllable using environment variables. +// For more details, please see envVarFeatureGates implementation. +var defaultKubernetesFeatureGates = map[Feature]FeatureSpec{ + WatchListClient: {Default: false, PreRelease: Beta}, +} From e8a81a3a434d95b0e002fc9c2b834e72c6e55ad7 Mon Sep 17 00:00:00 2001 From: Lukasz Szaszkiewicz Date: Wed, 10 Jan 2024 17:15:01 +0100 Subject: [PATCH 019/239] client-go/features: warn when ordering initialization issue ReplaceFeatureGates logs a warning when the default env var implementation has been already used. Such a situation indicates a potential ordering issue and usually is unwanted. Kubernetes-commit: 04bbd3481f70825eea54b4b154a04d2496dcf652 --- features/envvar.go | 9 +++++++++ features/envvar_test.go | 8 ++++++++ features/features.go | 18 ++++++++++++++++++ 3 files changed, 35 insertions(+) diff --git a/features/envvar.go b/features/envvar.go index 6761e16c1..f9edfdf0d 100644 --- a/features/envvar.go +++ b/features/envvar.go @@ -77,6 +77,10 @@ type envVarFeatureGates struct { // enabled holds a map[Feature]bool // with values explicitly set via env var enabled atomic.Value + + // 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. @@ -116,6 +120,7 @@ func (f *envVarFeatureGates) getEnabledMapFromEnvVar() map[Feature]bool { } } f.enabled.Store(featureGatesState) + f.readEnvVars.Store(true) for feature, featureSpec := range f.known { if featureState, ok := featureGatesState[feature]; ok { @@ -127,3 +132,7 @@ func (f *envVarFeatureGates) getEnabledMapFromEnvVar() map[Feature]bool { }) return f.enabled.Load().(map[Feature]bool) } + +func (f *envVarFeatureGates) hasAlreadyReadEnvVar() bool { + return f.readEnvVars.Load() +} diff --git a/features/envvar_test.go b/features/envvar_test.go index 8406a4474..247c7cb79 100644 --- a/features/envvar_test.go +++ b/features/envvar_test.go @@ -146,3 +146,11 @@ func TestEnvVarFeatureGatesEnabledPanic(t *testing.T) { target := newEnvVarFeatureGates(nil) require.PanicsWithError(t, fmt.Errorf("feature %q is not registered in FeatureGates %q", "UnknownFeature", target.callSiteName).Error(), func() { target.Enabled("UnknownFeature") }) } + +func TestHasAlreadyReadEnvVar(t *testing.T) { + target := newEnvVarFeatureGates(nil) + require.False(t, target.hasAlreadyReadEnvVar()) + + _ = target.getEnabledMapFromEnvVar() + require.True(t, target.hasAlreadyReadEnvVar()) +} diff --git a/features/features.go b/features/features.go index 8226905f9..7b9d050ef 100644 --- a/features/features.go +++ b/features/features.go @@ -17,6 +17,9 @@ limitations under the License. package features import ( + "errors" + + utilruntime "k8s.io/apimachinery/pkg/util/runtime" "sync/atomic" ) @@ -99,8 +102,23 @@ func AddFeaturesToExistingFeatureGates(registry Registry) error { // // then replace client-go's feature gates implementation with your implementation // clientgofeaturegate.ReplaceFeatureGates(utilfeature.DefaultMutableFeatureGate) func ReplaceFeatureGates(newFeatureGates Gates) { + if replaceFeatureGatesWithWarningIndicator(newFeatureGates) { + utilruntime.HandleError(errors.New("the default feature gates implementation has already been used and now it's being overwritten. This might lead to unexpected behaviour. Check your initialization order")) + } +} + +func replaceFeatureGatesWithWarningIndicator(newFeatureGates Gates) bool { + shouldProduceWarning := false + + if defaultFeatureGates, ok := FeatureGates().(*envVarFeatureGates); ok { + if defaultFeatureGates.hasAlreadyReadEnvVar() { + shouldProduceWarning = true + } + } wrappedFeatureGates := &featureGatesWrapper{newFeatureGates} featureGates.Store(wrappedFeatureGates) + + return shouldProduceWarning } func init() { From b0cf21f3e8b2cd087960a3be0771809cde146159 Mon Sep 17 00:00:00 2001 From: Kubernetes Publisher Date: Wed, 10 Jan 2024 20:49:12 +0100 Subject: [PATCH 020/239] Merge pull request #122555 from p0lyn0mial/upstream-client-go-fg-provider-with-types client-go/features: introduce feature gates Kubernetes-commit: 0341e8294abffdfbdd4a038e0fd49d7f35ddc30a From a3cbf5a7be0219d484b68be8699f6e5e0e85f0f9 Mon Sep 17 00:00:00 2001 From: Paco Xu Date: Thu, 11 Jan 2024 17:35:07 +0800 Subject: [PATCH 021/239] bump klog to v2.120.0 Kubernetes-commit: 3c86d21316c25b52a1cf3f9703a0bc2cbe97131c --- go.mod | 13 +++++++------ go.sum | 20 ++++++++++++-------- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/go.mod b/go.mod index 654aa1413..c78042403 100644 --- a/go.mod +++ b/go.mod @@ -24,9 +24,9 @@ require ( golang.org/x/term v0.15.0 golang.org/x/time v0.3.0 google.golang.org/protobuf v1.31.0 - k8s.io/api v0.0.0-20231220172311-84c476802242 - k8s.io/apimachinery v0.0.0-20231220171733-60eaa653342b - k8s.io/klog/v2 v2.110.1 + k8s.io/api v0.0.0 + k8s.io/apimachinery v0.0.0 + k8s.io/klog/v2 v2.120.0 k8s.io/kube-openapi v0.0.0-20231113174909-778a5567bc1e k8s.io/utils v0.0.0-20230726121419-3b25d923346b sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd @@ -37,7 +37,7 @@ require ( require ( github.com/davecgh/go-spew v1.1.1 // indirect github.com/emicklei/go-restful/v3 v3.11.0 // indirect - github.com/go-logr/logr v1.3.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 @@ -61,6 +61,7 @@ require ( ) replace ( - k8s.io/api => k8s.io/api v0.0.0-20231220172311-84c476802242 - k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20231220171733-60eaa653342b + k8s.io/api => ../api + k8s.io/apimachinery => ../apimachinery + k8s.io/client-go => ../client-go ) diff --git a/go.sum b/go.sum index 439b206c6..06067b2e5 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,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/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/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY= -github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +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= @@ -102,8 +106,10 @@ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9dec 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.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= 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.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= 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= @@ -140,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.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= @@ -157,12 +164,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-20231220172311-84c476802242 h1:0vL/RpEDBpP1Ib7D/+Gn1GcXRKoLfzHk39Bimd2kBNI= -k8s.io/api v0.0.0-20231220172311-84c476802242/go.mod h1:77+m1u5YUTiZfSm1ad6sO9fCphn5EYI5cFzfE0VKOuY= -k8s.io/apimachinery v0.0.0-20231220171733-60eaa653342b h1:Z+R5mA4fTuumBjSg84ZIY+W8Gi3zW50/iw58LL1tUwQ= -k8s.io/apimachinery v0.0.0-20231220171733-60eaa653342b/go.mod h1:HcS5UNnaHsno0i/Q7QQQzqFd5WS+W26bysH+Ez3FLxA= -k8s.io/klog/v2 v2.110.1 h1:U/Af64HJf7FcwMcXyKm2RPM22WZzyR7OSpYj5tg3cL0= -k8s.io/klog/v2 v2.110.1/go.mod h1:YGtd1984u+GgbuZ7e08/yBuAfKLSO0+uR1Fhi6ExXjo= +k8s.io/gengo v0.0.0-20230829151522-9cce18d56c01/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= +k8s.io/klog/v2 v2.120.0 h1:z+q5mfovBj1fKFxiRzsa2DsJLPIVMk/KFL81LMOfK+8= +k8s.io/klog/v2 v2.120.0/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/kube-openapi v0.0.0-20231113174909-778a5567bc1e h1:snPmy96t93RredGRjKfMFt+gvxuVAncqSAyBveJtr4Q= k8s.io/kube-openapi v0.0.0-20231113174909-778a5567bc1e/go.mod h1:AsvuZPBlUDVuCdzJ87iajxtXuR9oktsTctW/R9wwouA= k8s.io/utils v0.0.0-20230726121419-3b25d923346b h1:sgn3ZU783SCgtaSJjpcVVlRqd6GSnlTLKgpAAttJvpI= From fb1e77b992417b12b2976993da5c4ccad0148422 Mon Sep 17 00:00:00 2001 From: Kubernetes Publisher Date: Thu, 11 Jan 2024 18:25:38 +0100 Subject: [PATCH 022/239] Merge pull request #122706 from pacoxu/klog-upgrade bump klog to v2.120.0 Kubernetes-commit: 823ecb58f68fbe0a4b37b32e11e75c6f2e0f467c --- go.mod | 9 ++++----- go.sum | 12 ++++-------- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/go.mod b/go.mod index c78042403..5bf3719fe 100644 --- a/go.mod +++ b/go.mod @@ -24,8 +24,8 @@ require ( golang.org/x/term v0.15.0 golang.org/x/time v0.3.0 google.golang.org/protobuf v1.31.0 - k8s.io/api v0.0.0 - k8s.io/apimachinery v0.0.0 + k8s.io/api v0.0.0-20240111211838-39c80441f814 + k8s.io/apimachinery v0.0.0-20240111211623-02a41040d88d k8s.io/klog/v2 v2.120.0 k8s.io/kube-openapi v0.0.0-20231113174909-778a5567bc1e k8s.io/utils v0.0.0-20230726121419-3b25d923346b @@ -61,7 +61,6 @@ require ( ) replace ( - k8s.io/api => ../api - k8s.io/apimachinery => ../apimachinery - k8s.io/client-go => ../client-go + k8s.io/api => k8s.io/api v0.0.0-20240111211838-39c80441f814 + k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20240111211623-02a41040d88d ) diff --git a/go.sum b/go.sum index 06067b2e5..d0f3b2c25 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= @@ -106,10 +102,8 @@ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9dec 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.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= 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.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= 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 +140,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.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= @@ -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 v0.0.0-20230829151522-9cce18d56c01/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= +k8s.io/api v0.0.0-20240111211838-39c80441f814 h1:w+YEku14/5m9DIMFpUc18gIT7kd/1XnNpuRkel34p34= +k8s.io/api v0.0.0-20240111211838-39c80441f814/go.mod h1:gd8eHKGEAgKEJvMyjMHG88jdPdPbUS/GKULUOrS7+EU= +k8s.io/apimachinery v0.0.0-20240111211623-02a41040d88d h1:3/zPMR6GopaaAWJTZvob/eJ3uujM6vYgB5Hf7y1gg3s= +k8s.io/apimachinery v0.0.0-20240111211623-02a41040d88d/go.mod h1:TZi5dqCSETF0//y9r5QGBxc7W2udb08uXh6atA++S6Q= k8s.io/klog/v2 v2.120.0 h1:z+q5mfovBj1fKFxiRzsa2DsJLPIVMk/KFL81LMOfK+8= k8s.io/klog/v2 v2.120.0/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/kube-openapi v0.0.0-20231113174909-778a5567bc1e h1:snPmy96t93RredGRjKfMFt+gvxuVAncqSAyBveJtr4Q= From eab7383fd8d4ec3592bc06b91b1d7b7728c88d6d Mon Sep 17 00:00:00 2001 From: Patrick Ohly Date: Thu, 18 Jan 2024 12:45:55 +0100 Subject: [PATCH 023/239] dependencies: ginkgo v2.15.0, gomega v1.31.0 The main reason for updating is support for reporting the cause of context cancellation: Ginkgo provides that information when canceling a context and Gomega polling code includes that when generating a failure message. Kubernetes-commit: 18f0af1f000f95749ca1ea075d62ca89e86bb7da --- go.mod | 9 +++++---- go.sum | 20 ++++++++++++-------- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/go.mod b/go.mod index 9d8e9c700..c78042403 100644 --- a/go.mod +++ b/go.mod @@ -24,8 +24,8 @@ require ( golang.org/x/term v0.15.0 golang.org/x/time v0.3.0 google.golang.org/protobuf v1.31.0 - k8s.io/api v0.0.0-20240114225744-c9c2aecc731b - k8s.io/apimachinery v0.0.0-20240111211623-02a41040d88d + k8s.io/api v0.0.0 + k8s.io/apimachinery v0.0.0 k8s.io/klog/v2 v2.120.0 k8s.io/kube-openapi v0.0.0-20231113174909-778a5567bc1e k8s.io/utils v0.0.0-20230726121419-3b25d923346b @@ -61,6 +61,7 @@ require ( ) replace ( - k8s.io/api => k8s.io/api v0.0.0-20240114225744-c9c2aecc731b - k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20240111211623-02a41040d88d + k8s.io/api => ../api + k8s.io/apimachinery => ../apimachinery + k8s.io/client-go => ../client-go ) diff --git a/go.sum b/go.sum index 4b652db22..510d81c52 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= @@ -74,10 +78,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.13.2 h1:Bi2gGVkfn6gQcjNjZJVO8Gf0FHzMPf2phUei9tejVMs= -github.com/onsi/ginkgo/v2 v2.13.2/go.mod h1:XStQ8QcGwLyF4HdfcZB8SFOS/MWCgDuXMSBe6zrvLgM= -github.com/onsi/gomega v1.30.0 h1:hvMK7xYz4D3HapigLTeGdId/NcfQx1VHMJc60ew99+8= -github.com/onsi/gomega v1.30.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ= +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/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= @@ -102,8 +106,10 @@ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9dec 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.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= 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.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= 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= @@ -140,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.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= @@ -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-20240114225744-c9c2aecc731b h1:P4NQ7C/VCZXHN3HQh5/Xd5eNqwzh9o22d8GMzU2r2IU= -k8s.io/api v0.0.0-20240114225744-c9c2aecc731b/go.mod h1:gd8eHKGEAgKEJvMyjMHG88jdPdPbUS/GKULUOrS7+EU= -k8s.io/apimachinery v0.0.0-20240111211623-02a41040d88d h1:3/zPMR6GopaaAWJTZvob/eJ3uujM6vYgB5Hf7y1gg3s= -k8s.io/apimachinery v0.0.0-20240111211623-02a41040d88d/go.mod h1:TZi5dqCSETF0//y9r5QGBxc7W2udb08uXh6atA++S6Q= +k8s.io/gengo v0.0.0-20230829151522-9cce18d56c01/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= k8s.io/klog/v2 v2.120.0 h1:z+q5mfovBj1fKFxiRzsa2DsJLPIVMk/KFL81LMOfK+8= k8s.io/klog/v2 v2.120.0/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/kube-openapi v0.0.0-20231113174909-778a5567bc1e h1:snPmy96t93RredGRjKfMFt+gvxuVAncqSAyBveJtr4Q= From b2c0677f40f1c63c4c0a732216ed640b3ec12e38 Mon Sep 17 00:00:00 2001 From: Patrick Ohly Date: Thu, 18 Jan 2024 16:58:40 +0100 Subject: [PATCH 024/239] dependencies: klog v2.120.1 Kubernetes-commit: e2222f1e304831cbbc57b61afa373612297055fb --- go.mod | 11 ++++++----- go.sum | 24 ++++++++++++++---------- 2 files changed, 20 insertions(+), 15 deletions(-) diff --git a/go.mod b/go.mod index 889903096..ab58a3383 100644 --- a/go.mod +++ b/go.mod @@ -24,9 +24,9 @@ require ( golang.org/x/term v0.15.0 golang.org/x/time v0.3.0 google.golang.org/protobuf v1.31.0 - k8s.io/api v0.0.0-20240118211852-add4d306444d - k8s.io/apimachinery v0.0.0-20240118211637-942edc444171 - k8s.io/klog/v2 v2.120.0 + 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-20231113174909-778a5567bc1e k8s.io/utils v0.0.0-20230726121419-3b25d923346b sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd @@ -61,6 +61,7 @@ require ( ) replace ( - k8s.io/api => k8s.io/api v0.0.0-20240118211852-add4d306444d - k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20240118211637-942edc444171 + k8s.io/api => ../api + k8s.io/apimachinery => ../apimachinery + k8s.io/client-go => ../client-go ) diff --git a/go.sum b/go.sum index 0774f706f..55b4f97b6 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= @@ -74,10 +78,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.13.2 h1:Bi2gGVkfn6gQcjNjZJVO8Gf0FHzMPf2phUei9tejVMs= +github.com/onsi/ginkgo/v2 v2.13.2/go.mod h1:XStQ8QcGwLyF4HdfcZB8SFOS/MWCgDuXMSBe6zrvLgM= +github.com/onsi/gomega v1.30.0 h1:hvMK7xYz4D3HapigLTeGdId/NcfQx1VHMJc60ew99+8= +github.com/onsi/gomega v1.30.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ= 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= @@ -102,8 +106,10 @@ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9dec 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.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= 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.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= 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= @@ -140,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.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= @@ -157,12 +164,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-20240118211852-add4d306444d h1:LypunW21Qos44XY4w+5sVJqp1DTAnSlSIzDkBgrrn7k= -k8s.io/api v0.0.0-20240118211852-add4d306444d/go.mod h1:3rVi2qIdsl5Ebg3vFHLupQrAvXjPtsMY8jlG58dUkgI= -k8s.io/apimachinery v0.0.0-20240118211637-942edc444171 h1:MC0ggQp0T/TvwqgUd24rcN2JBO8tvYyHZLdrSeC5mD0= -k8s.io/apimachinery v0.0.0-20240118211637-942edc444171/go.mod h1:nql1Sg//sjzXgeJliO8jmbWLov7WaLgti8foN/HYAdc= -k8s.io/klog/v2 v2.120.0 h1:z+q5mfovBj1fKFxiRzsa2DsJLPIVMk/KFL81LMOfK+8= -k8s.io/klog/v2 v2.120.0/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= +k8s.io/gengo v0.0.0-20230829151522-9cce18d56c01/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= +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-20231113174909-778a5567bc1e h1:snPmy96t93RredGRjKfMFt+gvxuVAncqSAyBveJtr4Q= k8s.io/kube-openapi v0.0.0-20231113174909-778a5567bc1e/go.mod h1:AsvuZPBlUDVuCdzJ87iajxtXuR9oktsTctW/R9wwouA= k8s.io/utils v0.0.0-20230726121419-3b25d923346b h1:sgn3ZU783SCgtaSJjpcVVlRqd6GSnlTLKgpAAttJvpI= From 202c415847ae9058d3138ac9001ac0b32038ef2e Mon Sep 17 00:00:00 2001 From: Lukasz Szaszkiewicz Date: Fri, 19 Jan 2024 13:48:29 +0100 Subject: [PATCH 025/239] client-go/reflector: make UseWatchList a pointer until #115478(use streaming against the etcd storage) is resolved the cacher need a way to disable the streaming. Kubernetes-commit: 41e706600aea7468f486150d951d3b8948ce89d5 --- tools/cache/reflector.go | 18 +++++++++++++----- tools/cache/reflector_watchlist_test.go | 5 +++-- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/tools/cache/reflector.go b/tools/cache/reflector.go index c1ea13de5..f733e244c 100644 --- a/tools/cache/reflector.go +++ b/tools/cache/reflector.go @@ -43,6 +43,7 @@ import ( "k8s.io/klog/v2" "k8s.io/utils/clock" "k8s.io/utils/pointer" + "k8s.io/utils/ptr" "k8s.io/utils/trace" ) @@ -107,7 +108,9 @@ type Reflector struct { // might result in an increased memory consumption of the APIServer. // // See https://github.com/kubernetes/enhancements/tree/master/keps/sig-api-machinery/3157-watch-list#design-details - UseWatchList bool + // + // TODO(#115478): Consider making reflector.UseWatchList a private field. Since we implemented "api streaming" on the etcd storage layer it should work. + UseWatchList *bool } // ResourceVersionUpdater is an interface that allows store implementation to @@ -237,8 +240,12 @@ func NewReflectorWithOptions(lw ListerWatcher, expectedType interface{}, store S r.expectedGVK = getExpectedGVKFromObject(expectedType) } - if s := os.Getenv("ENABLE_CLIENT_GO_WATCH_LIST_ALPHA"); len(s) > 0 { - r.UseWatchList = true + // 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) + } } return r @@ -325,9 +332,10 @@ func (r *Reflector) ListAndWatch(stopCh <-chan struct{}) error { klog.V(3).Infof("Listing and watching %v from %s", r.typeDescription, r.name) var err error var w watch.Interface - fallbackToList := !r.UseWatchList + useWatchList := ptr.Deref(r.UseWatchList, false) + fallbackToList := !useWatchList - if r.UseWatchList { + if useWatchList { w, err = r.watchList(stopCh) if w == nil && err == nil { // stopCh was closed diff --git a/tools/cache/reflector_watchlist_test.go b/tools/cache/reflector_watchlist_test.go index c43db073c..76eacb5a5 100644 --- a/tools/cache/reflector_watchlist_test.go +++ b/tools/cache/reflector_watchlist_test.go @@ -33,6 +33,7 @@ import ( "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/watch" "k8s.io/utils/pointer" + "k8s.io/utils/ptr" ) func TestWatchList(t *testing.T) { @@ -415,7 +416,7 @@ func TestWatchList(t *testing.T) { listWatcher.customListResponse = scenario.podList listWatcher.closeAfterListRequests = scenario.closeAfterListRequests if scenario.disableUseWatchList { - reflector.UseWatchList = false + reflector.UseWatchList = ptr.To(false) } err := reflector.ListAndWatch(stopCh) @@ -505,7 +506,7 @@ func testData() (*fakeListWatcher, Store, *Reflector, chan struct{}) { }, } r := NewReflector(lw, &v1.Pod{}, s, 0) - r.UseWatchList = true + r.UseWatchList = ptr.To(true) return lw, s, r, stopCh } From 657d7be98b25ada48b5f1a39e3ec517f74a1d842 Mon Sep 17 00:00:00 2001 From: Kubernetes Publisher Date: Mon, 22 Jan 2024 18:20:58 +0100 Subject: [PATCH 026/239] Merge pull request #122873 from p0lyn0mial/upstream-reflector-usewatchlist-pointer client-go/reflector: make UseWatchList a pointer Kubernetes-commit: 445869a59bdbd1c587b72b52c5da94c1d1c316a1 From 17b5405ddb89cbcf4a0482c47524d6a9efbd2c92 Mon Sep 17 00:00:00 2001 From: Ivo Gosemann Date: Tue, 18 Jul 2023 13:40:12 +0200 Subject: [PATCH 027/239] k8s.io/client-go: add ClientConfig option to override raw config Kubernetes-commit: db80aa56ed8bcf4115e30fc62d27c8a8d8ec7f92 --- tools/clientcmd/client_config.go | 47 ++++++++++++++++++ tools/clientcmd/client_config_test.go | 69 +++++++++++++++++++++++++++ 2 files changed, 116 insertions(+) diff --git a/tools/clientcmd/client_config.go b/tools/clientcmd/client_config.go index ae0f01f32..0880adfd7 100644 --- a/tools/clientcmd/client_config.go +++ b/tools/clientcmd/client_config.go @@ -115,6 +115,19 @@ func NewClientConfigFromBytes(configBytes []byte) (ClientConfig, error) { return &DirectClientConfig{*config, "", &ConfigOverrides{}, nil, nil, promptedCredentials{}}, nil } +// NewClientConfigWithMergedRawConfig acts like a NewDefaultClientConfig but merges the RawConfig with the overrides +func NewClientConfigWithMergedRawConfig(config clientcmdapi.Config, overrides *ConfigOverrides) (ClientConfig, error) { + clientCfg := &DirectClientConfig{config, config.CurrentContext, overrides, nil, NewDefaultClientConfigLoadingRules(), promptedCredentials{}} + + mergedRawCfg, err := clientCfg.getMergedRawConfig() + clientCfg.config = mergedRawCfg + if err != nil { + return nil, err + } + return clientCfg, nil + +} + // RESTConfigFromKubeConfig is a convenience method to give back a restconfig from your kubeconfig bytes. // For programmatic access, this is what you want 80% of the time func RESTConfigFromKubeConfig(configBytes []byte) (*restclient.Config, error) { @@ -129,6 +142,40 @@ func (config *DirectClientConfig) RawConfig() (clientcmdapi.Config, error) { return config.config, nil } +// getMergedRawConfig returns the raw kube config merged with the overrides +func (config *DirectClientConfig) getMergedRawConfig() (clientcmdapi.Config, error) { + if err := config.ConfirmUsable(); err != nil { + return clientcmdapi.Config{}, err + } + merged := clientcmdapi.NewConfig() + + // set the AuthInfo merged with overrides in the merged config + mergedAuthInfo, err := config.getAuthInfo() + if err != nil { + return clientcmdapi.Config{}, err + } + mergedAuthInfoName, _ := config.getAuthInfoName() + merged.AuthInfos[mergedAuthInfoName] = &mergedAuthInfo + + // set the Context merged with overrides in the merged config + mergedContext, err := config.getContext() + if err != nil { + return clientcmdapi.Config{}, err + } + mergedContextName, _ := config.getContextName() + merged.Contexts[mergedContextName] = &mergedContext + merged.CurrentContext = mergedContextName + + // set the Cluster merged with overrides in the merged config + configClusterInfo, err := config.getCluster() + if err != nil { + return clientcmdapi.Config{}, err + } + configClusterName, _ := config.getClusterName() + merged.Clusters[configClusterName] = &configClusterInfo + return *merged, nil +} + // ClientConfig implements ClientConfig func (config *DirectClientConfig) ClientConfig() (*restclient.Config, error) { // check that getAuthInfo, getContext, and getCluster do not return an error. diff --git a/tools/clientcmd/client_config_test.go b/tools/clientcmd/client_config_test.go index 64efc9016..ac68a4afc 100644 --- a/tools/clientcmd/client_config_test.go +++ b/tools/clientcmd/client_config_test.go @@ -1013,3 +1013,72 @@ func TestCleanANSIEscapeCodes(t *testing.T) { }) } } + +func TestMergeRawConfigDoOverride(t *testing.T) { + cfg := createValidTestConfig() + + overrides := &ConfigOverrides{ + ClusterInfo: clientcmdapi.Cluster{ + Server: "http://localhost:8081", + }, + Context: clientcmdapi.Context{ + Namespace: "foobar", + Cluster: "clean", + AuthInfo: "clean", + }, + AuthInfo: clientcmdapi.AuthInfo{ + Token: "modified-token", + }, + CurrentContext: "clean", + } + + cut, err := NewClientConfigWithMergedRawConfig(*cfg, overrides) + if err != nil { + t.Fatalf("Unexpected error: %v", err) + } + act, err := cut.RawConfig() + if err != nil { + t.Fatalf("Unexpected error: %v", err) + } + + if act.Clusters["clean"].Server != "http://localhost:8081" { + t.Errorf("Expected server %v, got %v", "http://localhost:8081", act.Clusters["clean"].Server) + } + + if act.Contexts["clean"].Namespace != "foobar" { + t.Errorf("Expected namespace %v, got %v", "foobar", act.Contexts["clean"].Namespace) + } +} + +func TestMergeRawConfigDoNotOverride(t *testing.T) { + cfg := createValidTestConfig() + + overrides := &ConfigOverrides{ + ClusterInfo: clientcmdapi.Cluster{ + Server: "http://localhost:8081", + }, + Context: clientcmdapi.Context{ + Namespace: "foobar", + Cluster: "clean", + AuthInfo: "clean", + }, + AuthInfo: clientcmdapi.AuthInfo{ + Token: "modified-token", + }, + CurrentContext: "clean", + } + + cut := NewDefaultClientConfig(*cfg, overrides) + act, err := cut.RawConfig() + if err != nil { + t.Fatalf("Unexpected error: %v", err) + } + + if act.Clusters["clean"].Server != cfg.Clusters["clean"].Server { + t.Errorf("Expected server %v, got %v", cfg.Clusters["clean"].Server, act.Clusters["clean"].Server) + } + + if act.Contexts["clean"].Namespace != cfg.Contexts["clean"].Namespace { + t.Errorf("Expected namespace %v, got %v", cfg.Contexts["clean"].Namespace, act.Contexts["clean"].Namespace) + } +} From 89528c43bed409de8fb91acf8a8c9c39f301666e Mon Sep 17 00:00:00 2001 From: Ivo Gosemann Date: Tue, 18 Jul 2023 13:40:12 +0200 Subject: [PATCH 028/239] k8s.io/client-go: add OverridingClientConfig overriding RawConfig Kubernetes-commit: 740b4c456d731922196f8231df9ab585198696d6 --- tools/clientcmd/client_config.go | 34 +++++------ tools/clientcmd/client_config_test.go | 84 +++++++++++++-------------- 2 files changed, 54 insertions(+), 64 deletions(-) diff --git a/tools/clientcmd/client_config.go b/tools/clientcmd/client_config.go index 0880adfd7..952f6d7eb 100644 --- a/tools/clientcmd/client_config.go +++ b/tools/clientcmd/client_config.go @@ -72,6 +72,13 @@ type ClientConfig interface { ConfigAccess() ConfigAccess } +// OverridingClientConfig is used to enable overrriding the raw KubeConfig +type OverridingClientConfig interface { + ClientConfig + // MergedRawConfig return the RawConfig merged with all overrides. + MergedRawConfig() (clientcmdapi.Config, error) +} + type PersistAuthProviderConfigForUser func(user string) restclient.AuthProviderConfigPersister type promptedCredentials struct { @@ -91,22 +98,22 @@ type DirectClientConfig struct { } // NewDefaultClientConfig creates a DirectClientConfig using the config.CurrentContext as the context name -func NewDefaultClientConfig(config clientcmdapi.Config, overrides *ConfigOverrides) ClientConfig { +func NewDefaultClientConfig(config clientcmdapi.Config, overrides *ConfigOverrides) OverridingClientConfig { return &DirectClientConfig{config, config.CurrentContext, overrides, nil, NewDefaultClientConfigLoadingRules(), promptedCredentials{}} } // NewNonInteractiveClientConfig creates a DirectClientConfig using the passed context name and does not have a fallback reader for auth information -func NewNonInteractiveClientConfig(config clientcmdapi.Config, contextName string, overrides *ConfigOverrides, configAccess ConfigAccess) ClientConfig { +func NewNonInteractiveClientConfig(config clientcmdapi.Config, contextName string, overrides *ConfigOverrides, configAccess ConfigAccess) OverridingClientConfig { return &DirectClientConfig{config, contextName, overrides, nil, configAccess, promptedCredentials{}} } // NewInteractiveClientConfig creates a DirectClientConfig using the passed context name and a reader in case auth information is not provided via files or flags -func NewInteractiveClientConfig(config clientcmdapi.Config, contextName string, overrides *ConfigOverrides, fallbackReader io.Reader, configAccess ConfigAccess) ClientConfig { +func NewInteractiveClientConfig(config clientcmdapi.Config, contextName string, overrides *ConfigOverrides, fallbackReader io.Reader, configAccess ConfigAccess) OverridingClientConfig { return &DirectClientConfig{config, contextName, overrides, fallbackReader, configAccess, promptedCredentials{}} } // NewClientConfigFromBytes takes your kubeconfig and gives you back a ClientConfig -func NewClientConfigFromBytes(configBytes []byte) (ClientConfig, error) { +func NewClientConfigFromBytes(configBytes []byte) (OverridingClientConfig, error) { config, err := Load(configBytes) if err != nil { return nil, err @@ -115,19 +122,6 @@ func NewClientConfigFromBytes(configBytes []byte) (ClientConfig, error) { return &DirectClientConfig{*config, "", &ConfigOverrides{}, nil, nil, promptedCredentials{}}, nil } -// NewClientConfigWithMergedRawConfig acts like a NewDefaultClientConfig but merges the RawConfig with the overrides -func NewClientConfigWithMergedRawConfig(config clientcmdapi.Config, overrides *ConfigOverrides) (ClientConfig, error) { - clientCfg := &DirectClientConfig{config, config.CurrentContext, overrides, nil, NewDefaultClientConfigLoadingRules(), promptedCredentials{}} - - mergedRawCfg, err := clientCfg.getMergedRawConfig() - clientCfg.config = mergedRawCfg - if err != nil { - return nil, err - } - return clientCfg, nil - -} - // RESTConfigFromKubeConfig is a convenience method to give back a restconfig from your kubeconfig bytes. // For programmatic access, this is what you want 80% of the time func RESTConfigFromKubeConfig(configBytes []byte) (*restclient.Config, error) { @@ -142,12 +136,12 @@ func (config *DirectClientConfig) RawConfig() (clientcmdapi.Config, error) { return config.config, nil } -// getMergedRawConfig returns the raw kube config merged with the overrides -func (config *DirectClientConfig) getMergedRawConfig() (clientcmdapi.Config, error) { +// MergedRawConfig returns the raw kube config merged with the overrides +func (config *DirectClientConfig) MergedRawConfig() (clientcmdapi.Config, error) { if err := config.ConfirmUsable(); err != nil { return clientcmdapi.Config{}, err } - merged := clientcmdapi.NewConfig() + merged := config.config.DeepCopy() // set the AuthInfo merged with overrides in the merged config mergedAuthInfo, err := config.getAuthInfo() diff --git a/tools/clientcmd/client_config_test.go b/tools/clientcmd/client_config_test.go index ac68a4afc..17d1b7b20 100644 --- a/tools/clientcmd/client_config_test.go +++ b/tools/clientcmd/client_config_test.go @@ -1015,70 +1015,66 @@ func TestCleanANSIEscapeCodes(t *testing.T) { } func TestMergeRawConfigDoOverride(t *testing.T) { - cfg := createValidTestConfig() - - overrides := &ConfigOverrides{ - ClusterInfo: clientcmdapi.Cluster{ - Server: "http://localhost:8081", - }, - Context: clientcmdapi.Context{ - Namespace: "foobar", - Cluster: "clean", - AuthInfo: "clean", - }, - AuthInfo: clientcmdapi.AuthInfo{ - Token: "modified-token", - }, - CurrentContext: "clean", - } + const ( + server = "https://anything.com:8080" + token = "the-token" + modifiedServer = "http://localhost:8081" + modifiedToken = "modified-token" + ) + config := createValidTestConfig() - cut, err := NewClientConfigWithMergedRawConfig(*cfg, overrides) - if err != nil { - t.Fatalf("Unexpected error: %v", err) + // add another context which to modify with overrides + config.Clusters["modify"] = &clientcmdapi.Cluster{ + Server: server, } - act, err := cut.RawConfig() - if err != nil { - t.Fatalf("Unexpected error: %v", err) + config.AuthInfos["modify"] = &clientcmdapi.AuthInfo{ + Token: token, } - - if act.Clusters["clean"].Server != "http://localhost:8081" { - t.Errorf("Expected server %v, got %v", "http://localhost:8081", act.Clusters["clean"].Server) + config.Contexts["modify"] = &clientcmdapi.Context{ + Cluster: "modify", + AuthInfo: "modify", + Namespace: "modify", } - if act.Contexts["clean"].Namespace != "foobar" { - t.Errorf("Expected namespace %v, got %v", "foobar", act.Contexts["clean"].Namespace) - } -} - -func TestMergeRawConfigDoNotOverride(t *testing.T) { - cfg := createValidTestConfig() - + // create overrides for the modify context overrides := &ConfigOverrides{ ClusterInfo: clientcmdapi.Cluster{ - Server: "http://localhost:8081", + Server: modifiedServer, }, Context: clientcmdapi.Context{ Namespace: "foobar", - Cluster: "clean", - AuthInfo: "clean", + Cluster: "modify", + AuthInfo: "modify", }, AuthInfo: clientcmdapi.AuthInfo{ - Token: "modified-token", + Token: modifiedToken, }, - CurrentContext: "clean", + CurrentContext: "modify", } - cut := NewDefaultClientConfig(*cfg, overrides) - act, err := cut.RawConfig() + cut := NewDefaultClientConfig(*config, overrides) + act, err := cut.MergedRawConfig() if err != nil { t.Fatalf("Unexpected error: %v", err) } - if act.Clusters["clean"].Server != cfg.Clusters["clean"].Server { - t.Errorf("Expected server %v, got %v", cfg.Clusters["clean"].Server, act.Clusters["clean"].Server) + // ensure overrides were applied to "modify" + actContext := act.CurrentContext + if actContext != "modify" { + t.Errorf("Expected context %v, got %v", "modify", actContext) + } + if act.Clusters[actContext].Server != "http://localhost:8081" { + t.Errorf("Expected server %v, got %v", "http://localhost:8081", act.Clusters[actContext].Server) + } + if act.Contexts[actContext].Namespace != "foobar" { + t.Errorf("Expected namespace %v, got %v", "foobar", act.Contexts[actContext].Namespace) } - if act.Contexts["clean"].Namespace != cfg.Contexts["clean"].Namespace { - t.Errorf("Expected namespace %v, got %v", cfg.Contexts["clean"].Namespace, act.Contexts["clean"].Namespace) + // ensure context "clean" was not touched + if act.Clusters["clean"].Server != config.Clusters["clean"].Server { + t.Errorf("Expected server %v, got %v", config.Clusters["clean"].Server, act.Clusters["clean"].Server) + } + if act.Contexts["clean"].Namespace != config.Contexts["clean"].Namespace { + t.Errorf("Expected namespace %v, got %v", config.Contexts["clean"].Namespace, act.Contexts["clean"].Namespace) } } From dc967a1ca93b323a11719f5bd7cd0c95da409ae4 Mon Sep 17 00:00:00 2001 From: Ben Luddy Date: Tue, 17 Oct 2023 16:51:52 -0400 Subject: [PATCH 029/239] Update vendoring to take new CBOR library dependency. Kubernetes-commit: 09a1abda998fc37e2e29a120a82be7c6271656e0 --- go.mod | 9 +++++---- go.sum | 14 ++++++++++---- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/go.mod b/go.mod index 8039c2119..ab58a3383 100644 --- a/go.mod +++ b/go.mod @@ -24,8 +24,8 @@ require ( golang.org/x/term v0.15.0 golang.org/x/time v0.3.0 google.golang.org/protobuf v1.31.0 - k8s.io/api v0.0.0-20240124211858-f3648a53522e - k8s.io/apimachinery v0.0.0-20240208123330-046ab0dee2aa + 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-20231113174909-778a5567bc1e k8s.io/utils v0.0.0-20230726121419-3b25d923346b @@ -61,6 +61,7 @@ require ( ) replace ( - k8s.io/api => k8s.io/api v0.0.0-20240124211858-f3648a53522e - k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20240208123330-046ab0dee2aa + k8s.io/api => ../api + k8s.io/apimachinery => ../apimachinery + k8s.io/client-go => ../client-go ) diff --git a/go.sum b/go.sum index 45758e890..f408a8928 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.5.0/go.mod h1:TA1xS00nchWmaBnEIxPSE5oHLuJBAVvqrtAnWBwBCVo= 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= @@ -97,13 +102,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.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= 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.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= 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= @@ -140,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/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.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= @@ -157,10 +166,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-20240124211858-f3648a53522e h1:Lv52wennNKzlcDrBtANztawHC8xaTllHm51WUKIP0Ew= -k8s.io/api v0.0.0-20240124211858-f3648a53522e/go.mod h1:BZUGwl6J5EvsODp+6ZUA+9p7V4iWxVLcr70rnzIshpA= -k8s.io/apimachinery v0.0.0-20240208123330-046ab0dee2aa h1:zOD6FZO+pxwGd9cLFzPJ4U94TujpovDw5/3t0HTNa40= -k8s.io/apimachinery v0.0.0-20240208123330-046ab0dee2aa/go.mod h1:Oh3ZrffM1/I8O/43oAA+aoOYgSregIXHxcWJB9ZRfQ8= +k8s.io/gengo v0.0.0-20230829151522-9cce18d56c01/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= 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-20231113174909-778a5567bc1e h1:snPmy96t93RredGRjKfMFt+gvxuVAncqSAyBveJtr4Q= From 2231ff5ae4175146c3f3d200185234c33c858bc2 Mon Sep 17 00:00:00 2001 From: Patrick Ohly Date: Fri, 1 Dec 2023 18:35:28 +0100 Subject: [PATCH 030/239] client-go events: support context.Background() as context If, for whatever reason, the context was context.Background(), the additional goroutine was started and then got stuck forever because context.Background().Done() is a nil channel. Found when indirectly instantiating a broadcaster with such a context: found unexpected goroutines: [Goroutine 9106 in state chan receive (nil chan), with k8s.io/kubernetes/vendor/k8s.io/client-go/tools/record.NewBroadcaster.func1 on top of the stack: goroutine 9106 [chan receive (nil chan)]: k8s.io/kubernetes/vendor/k8s.io/client-go/tools/record.NewBroadcaster.func1() /home/prow/go/src/k8s.io/kubernetes/_output/local/go/src/k8s.io/kubernetes/vendor/k8s.io/client-go/tools/record/event.go:206 +0x2c created by k8s.io/kubernetes/vendor/k8s.io/client-go/tools/record.NewBroadcaster in goroutine 8957 /home/prow/go/src/k8s.io/kubernetes/_output/local/go/src/k8s.io/kubernetes/vendor/k8s.io/client-go/tools/record/event.go:205 +0x1a5 This can be fixed by checking for a nil channel. Another problem also gets addressed: if Shutdown was called without canceling the context, the goroutine also didn't stop. Now it waits for the cancelation context and thus terminates in both cases. Kubernetes-commit: eed6e29a5b8cfaa20fbc426541d9c74105d430ee --- tools/record/event.go | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/tools/record/event.go b/tools/record/event.go index d1511696d..0745fb4a3 100644 --- a/tools/record/event.go +++ b/tools/record/event.go @@ -198,16 +198,29 @@ func NewBroadcaster(opts ...BroadcasterOption) EventBroadcaster { ctx := c.Context if ctx == nil { ctx = context.Background() - } else { + } + // The are two scenarios where it makes no sense to wait for context cancelation: + // - The context was nil. + // - The context was context.Background() to begin with. + // + // Both cases get checked here. + haveCtxCancelation := ctx.Done() == nil + + eventBroadcaster.cancelationCtx, eventBroadcaster.cancel = context.WithCancel(ctx) + + if haveCtxCancelation { // Calling Shutdown is not required when a context was provided: // when the context is canceled, this goroutine will shut down // the broadcaster. + // + // If Shutdown is called first, then this goroutine will + // also stop. go func() { - <-ctx.Done() + <-eventBroadcaster.cancelationCtx.Done() eventBroadcaster.Broadcaster.Shutdown() }() } - eventBroadcaster.cancelationCtx, eventBroadcaster.cancel = context.WithCancel(ctx) + return eventBroadcaster } From 94320f8765084339a767bd8df79d99f405c48a11 Mon Sep 17 00:00:00 2001 From: Tim Hockin Date: Mon, 26 Feb 2024 17:02:22 -0800 Subject: [PATCH 031/239] Re-vendor latest kube-openapi and gengo/v2 ./hack/pin-dependency.sh k8s.io/kube-openapi latest ./hack/pin-dependency.sh k8s.io/gengo/v2 latest ./hack/update-vendor.sh Kubernetes-commit: 6f2f3735e04df5e4822176a2784069634c3c74a3 --- go.mod | 4 ++-- go.sum | 18 +++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/go.mod b/go.mod index ac89cd38f..6030cbb53 100644 --- a/go.mod +++ b/go.mod @@ -19,7 +19,7 @@ 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.19.0 + golang.org/x/net v0.21.0 golang.org/x/oauth2 v0.10.0 golang.org/x/term v0.17.0 golang.org/x/time v0.3.0 @@ -27,7 +27,7 @@ require ( 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-20231113174909-778a5567bc1e + 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 diff --git a/go.sum b/go.sum index 77a50bf0c..7844f5631 100644 --- a/go.sum +++ b/go.sum @@ -108,17 +108,17 @@ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9dec 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.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= +golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= 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.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +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.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c= -golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= +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/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= @@ -142,8 +142,8 @@ golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGm 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.16.1 h1:TLyB3WofjdOEepBHAU20JdNC1Zbg87elYofWYAY5oZA= -golang.org/x/tools v0.16.1/go.mod h1:kYVVN6I1mBNoB1OX+noeBjbRk4IUEPa7JJ+TJMEooJ0= +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/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= @@ -166,11 +166,11 @@ 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 v0.0.0-20230829151522-9cce18d56c01/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= +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-20231113174909-778a5567bc1e h1:snPmy96t93RredGRjKfMFt+gvxuVAncqSAyBveJtr4Q= -k8s.io/kube-openapi v0.0.0-20231113174909-778a5567bc1e/go.mod h1:AsvuZPBlUDVuCdzJ87iajxtXuR9oktsTctW/R9wwouA= +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= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= From f1ec2cd017c003f781d33ef4e2aeeed48d3aa553 Mon Sep 17 00:00:00 2001 From: Tim Hockin Date: Fri, 29 Dec 2023 15:08:57 -0800 Subject: [PATCH 032/239] Make update-codegen conversion work on gengo/v2 Kubernetes-commit: 5475797f4330dfd059773dd83e63f09f9b4f617a --- scale/scheme/appsv1beta1/doc.go | 2 +- scale/scheme/appsv1beta2/doc.go | 2 +- scale/scheme/autoscalingv1/doc.go | 2 +- scale/scheme/extensionsv1beta1/doc.go | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scale/scheme/appsv1beta1/doc.go b/scale/scheme/appsv1beta1/doc.go index 830619b44..aea95e2e4 100644 --- a/scale/scheme/appsv1beta1/doc.go +++ b/scale/scheme/appsv1beta1/doc.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// +k8s:conversion-gen=k8s.io/kubernetes/vendor/k8s.io/client-go/scale/scheme +// +k8s:conversion-gen=k8s.io/client-go/scale/scheme // +k8s:conversion-gen-external-types=k8s.io/api/apps/v1beta1 package appsv1beta1 // import "k8s.io/client-go/scale/scheme/appsv1beta1" diff --git a/scale/scheme/appsv1beta2/doc.go b/scale/scheme/appsv1beta2/doc.go index c21a56d56..d1ae2118e 100644 --- a/scale/scheme/appsv1beta2/doc.go +++ b/scale/scheme/appsv1beta2/doc.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// +k8s:conversion-gen=k8s.io/kubernetes/vendor/k8s.io/client-go/scale/scheme +// +k8s:conversion-gen=k8s.io/client-go/scale/scheme // +k8s:conversion-gen-external-types=k8s.io/api/apps/v1beta2 package appsv1beta2 // import "k8s.io/client-go/scale/scheme/appsv1beta2" diff --git a/scale/scheme/autoscalingv1/doc.go b/scale/scheme/autoscalingv1/doc.go index 03684dd90..25f23d2d8 100644 --- a/scale/scheme/autoscalingv1/doc.go +++ b/scale/scheme/autoscalingv1/doc.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// +k8s:conversion-gen=k8s.io/kubernetes/vendor/k8s.io/client-go/scale/scheme +// +k8s:conversion-gen=k8s.io/client-go/scale/scheme // +k8s:conversion-gen-external-types=k8s.io/api/autoscaling/v1 package autoscalingv1 // import "k8s.io/client-go/scale/scheme/autoscalingv1" diff --git a/scale/scheme/extensionsv1beta1/doc.go b/scale/scheme/extensionsv1beta1/doc.go index 1e719884f..de633889a 100644 --- a/scale/scheme/extensionsv1beta1/doc.go +++ b/scale/scheme/extensionsv1beta1/doc.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// +k8s:conversion-gen=k8s.io/kubernetes/vendor/k8s.io/client-go/scale/scheme +// +k8s:conversion-gen=k8s.io/client-go/scale/scheme // +k8s:conversion-gen-external-types=k8s.io/api/extensions/v1beta1 package extensionsv1beta1 // import "k8s.io/client-go/scale/scheme/extensionsv1beta1" From b0062217a2208c653993abdb3c3cd368204294cf Mon Sep 17 00:00:00 2001 From: Tim Hockin Date: Wed, 3 Jan 2024 17:14:38 -0800 Subject: [PATCH 033/239] Get rid of most references to GOPATH Kubernetes-commit: 10c32b3e2f4345dab582270b1a202dcd92dabd34 --- INSTALL.md | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index 21e15357e..cc4afa419 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -79,14 +79,8 @@ go get k8s.io/client-go@v0.20.4 ### Go modules disabled If you get a message like `cannot use path@version syntax in GOPATH mode`, -you likely do not have go modules enabled. - -Dependency management tools are built into go 1.11+ in the form of -[go modules](https://github.com/golang/go/wiki/Modules). -These are used by the main Kubernetes repo (>= `v1.15.0`) and -`client-go` (>= `kubernetes-1.15.0`) to manage dependencies. -If you are using go 1.11 or 1.12 and are working with a project located within `$GOPATH`, -you must opt into using go modules: +you likely do not have go modules enabled. This should be on by default in all +supported versions of Go. ```sh export GO111MODULE=on From 64583807552499fd6f67d776c946ea7b3ebfb992 Mon Sep 17 00:00:00 2001 From: Tim Hockin Date: Mon, 15 Jan 2024 15:56:21 -0800 Subject: [PATCH 034/239] Remove defunct references to "vendor" Kubernetes-commit: d772f7719dc55ebfec2e9461b6e14bf17f5301df --- restmapper/shortcut.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/restmapper/shortcut.go b/restmapper/shortcut.go index ca517a01d..0afc8689d 100644 --- a/restmapper/shortcut.go +++ b/restmapper/shortcut.go @@ -50,7 +50,7 @@ func (e shortcutExpander) KindFor(resource schema.GroupVersionResource) (schema. // In case of new CRDs this means we potentially don't have current state of discovery. // In the current wiring in k8s.io/cli-runtime/pkg/genericclioptions/config_flags.go#toRESTMapper, // we are using DeferredDiscoveryRESTMapper which on KindFor failure will clear the - // cache and fetch all data from a cluster (see vendor/k8s.io/client-go/restmapper/discovery.go#KindFor). + // cache and fetch all data from a cluster (see k8s.io/client-go/restmapper/discovery.go#KindFor). // Thus another call to expandResourceShortcut, after a NoMatchError should successfully // read Kind to the user or an error. gvk, err := e.RESTMapper.KindFor(e.expandResourceShortcut(resource)) From 8092c71d36058837d096a519db456411e0cbde8e Mon Sep 17 00:00:00 2001 From: Kubernetes Publisher Date: Wed, 24 Jan 2024 02:12:19 +0100 Subject: [PATCH 035/239] Merge pull request #119398 from IvoGoman/feat/clientconfig-override-raw k8s.io/client-go: add ClientConfig option to override raw config Kubernetes-commit: a1ffdedf782edf1472102b0b99c1467d4ed39753 From 3d92ad924fd9c1a92d5d3a8bb5f4412e571b47d0 Mon Sep 17 00:00:00 2001 From: Dominic Evans Date: Thu, 24 Aug 2023 09:49:41 +0100 Subject: [PATCH 036/239] chore(docs): refresh compatibility matrix Bring the compatibility matrix up-to-date with more recent versions of Kubernetes Signed-off-by: Dominic Evans --- README.md | 50 +++++++++++++++++++++----------------------------- 1 file changed, 21 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index 2d8f01794..1e6be434a 100644 --- a/README.md +++ b/README.md @@ -75,14 +75,14 @@ We will backport bugfixes--but not new features--into older versions of #### Compatibility matrix -| | Kubernetes 1.15 | Kubernetes 1.16 | Kubernetes 1.17 | Kubernetes 1.18 | Kubernetes 1.19 | Kubernetes 1.20 | -|-------------------------------|-----------------|-----------------|-----------------|-----------------|-----------------|-----------------| -| `kubernetes-1.15.0` | ✓ | +- | +- | +- | +- | +- | -| `kubernetes-1.16.0` | +- | ✓ | +- | +- | +- | +- | -| `kubernetes-1.17.0`/`v0.17.0` | +- | +- | ✓ | +- | +- | +- | -| `kubernetes-1.18.0`/`v0.18.0` | +- | +- | +- | ✓ | +- | +- | -| `kubernetes-1.19.0`/`v0.19.0` | +- | +- | +- | +- | ✓ | +- | -| `kubernetes-1.20.0`/`v0.20.0` | +- | +- | +- | +- | +- | ✓ | +| | Kubernetes 1.23 | Kubernetes 1.24 | Kubernetes 1.25 | Kubernetes 1.26 | Kubernetes 1.27 | Kubernetes 1.28 | +| ----------------------------- | --------------- | --------------- | --------------- | --------------- | --------------- | --------------- | +| `kubernetes-1.23.0`/`v0.23.0` | ✓ | +- | +- | +- | +- | +- | +| `kubernetes-1.24.0`/`v0.24.0` | +- | ✓ | +- | +- | +- | +- | +| `kubernetes-1.25.0`/`v0.25.0` | +- | +- | ✓ | +- | +- | +- | +| `kubernetes-1.26.0`/`v0.26.0` | +- | +- | +- | ✓ | +- | +- | +| `kubernetes-1.27.0`/`v0.27.0` | +- | +- | +- | +- | ✓ | +- | +| `kubernetes-1.28.0`/`v0.28.0` | +- | +- | +- | +- | +- | ✓ | | `HEAD` | +- | +- | +- | +- | +- | +- | Key: @@ -102,27 +102,19 @@ Key: See the [CHANGELOG](./CHANGELOG.md) for a detailed description of changes between client-go versions. -| Branch | Canonical source code location | Maintenance status | -|----------------|--------------------------------------|-------------------------------| -| `release-1.4` | Kubernetes main repo, 1.4 branch | = - | -| `release-1.5` | Kubernetes main repo, 1.5 branch | = - | -| `release-2.0` | Kubernetes main repo, 1.5 branch | = - | -| `release-3.0` | Kubernetes main repo, 1.6 branch | = - | -| `release-4.0` | Kubernetes main repo, 1.7 branch | = - | -| `release-5.0` | Kubernetes main repo, 1.8 branch | = - | -| `release-6.0` | Kubernetes main repo, 1.9 branch | = - | -| `release-7.0` | Kubernetes main repo, 1.10 branch | = - | -| `release-8.0` | Kubernetes main repo, 1.11 branch | =- | -| `release-9.0` | Kubernetes main repo, 1.12 branch | =- | -| `release-10.0` | Kubernetes main repo, 1.13 branch | =- | -| `release-11.0` | Kubernetes main repo, 1.14 branch | =- | -| `release-12.0` | Kubernetes main repo, 1.15 branch | =- | -| `release-13.0` | Kubernetes main repo, 1.16 branch | =- | -| `release-14.0` | Kubernetes main repo, 1.17 branch | ✓ | -| `release-1.18` | Kubernetes main repo, 1.18 branch | ✓ | -| `release-1.19` | Kubernetes main repo, 1.19 branch | ✓ | -| `release-1.20` | Kubernetes main repo, 1.20 branch | ✓ | -| client-go HEAD | Kubernetes main repo, master branch | ✓ | +| Branch | Canonical source code location | Maintenance status | +| -------------- | ----------------------------------- | ------------------ | +| `release-1.19` | Kubernetes main repo, 1.19 branch | =- | +| `release-1.20` | Kubernetes main repo, 1.20 branch | =- | +| `release-1.21` | Kubernetes main repo, 1.21 branch | =- | +| `release-1.22` | Kubernetes main repo, 1.22 branch | =- | +| `release-1.23` | Kubernetes main repo, 1.23 branch | =- | +| `release-1.24` | Kubernetes main repo, 1.24 branch | =- | +| `release-1.25` | Kubernetes main repo, 1.25 branch | ✓ | +| `release-1.26` | Kubernetes main repo, 1.26 branch | ✓ | +| `release-1.27` | Kubernetes main repo, 1.27 branch | ✓ | +| `release-1.28` | Kubernetes main repo, 1.28 branch | ✓ | +| client-go HEAD | Kubernetes main repo, master branch | ✓ | Key: From 76174b8af8cfd938018b04198595d65b48a69334 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Carlos=20Ch=C3=A1vez?= Date: Thu, 8 Feb 2024 13:33:30 +0100 Subject: [PATCH 037/239] chore: adds consistent vanity import to files and provides tooling for verifying and updating them. (#120642) * chore: drops update vanity imports from script. * chore: changes copyright year to 2024. * chore: makes lint happy. Kubernetes-commit: 6d6398ef9266abce3518a4c9a3d4e4d8feeffdc1 --- applyconfigurations/doc.go | 2 +- examples/fake-client/doc.go | 2 +- go.mod | 8 ++++---- go.sum | 8 ++++---- informers/doc.go | 2 +- kubernetes/doc.go | 2 +- listers/doc.go | 2 +- scale/scheme/appsint/doc.go | 2 +- scale/scheme/doc.go | 2 +- scale/scheme/extensionsint/doc.go | 2 +- tools/clientcmd/api/doc.go | 2 +- tools/clientcmd/api/v1/doc.go | 2 +- 12 files changed, 18 insertions(+), 18 deletions(-) diff --git a/applyconfigurations/doc.go b/applyconfigurations/doc.go index 8efc9523e..ac426c607 100644 --- a/applyconfigurations/doc.go +++ b/applyconfigurations/doc.go @@ -148,4 +148,4 @@ reconciliation code that performs a "read/modify-in-place/update" (or patch) wor // apply applied, err := deploymentClient.Apply(ctx, extractedDeployment, metav1.ApplyOptions{FieldManager: fieldMgr}) */ -package applyconfigurations +package applyconfigurations // import "k8s.io/client-go/applyconfigurations" diff --git a/examples/fake-client/doc.go b/examples/fake-client/doc.go index 1c02e5ea5..9379376ec 100644 --- a/examples/fake-client/doc.go +++ b/examples/fake-client/doc.go @@ -17,4 +17,4 @@ limitations under the License. // Package fakeclient contains examples on how to use fakeclient in tests. // Note: This file is here to avoid warnings on go build since there are no // non-test files in this package. -package fakeclient +package fakeclient // import "k8s.io/client-go/examples/fake-client" diff --git a/go.mod b/go.mod index 5fac448b5..8039c2119 100644 --- a/go.mod +++ b/go.mod @@ -24,8 +24,8 @@ require ( golang.org/x/term v0.15.0 golang.org/x/time v0.3.0 google.golang.org/protobuf v1.31.0 - k8s.io/api v0.0.0-20240118211853-d5724e467262 - k8s.io/apimachinery v0.0.0-20240118211638-f14778da5523 + k8s.io/api v0.0.0-20240124211858-f3648a53522e + k8s.io/apimachinery v0.0.0-20240208123330-046ab0dee2aa k8s.io/klog/v2 v2.120.1 k8s.io/kube-openapi v0.0.0-20231113174909-778a5567bc1e k8s.io/utils v0.0.0-20230726121419-3b25d923346b @@ -61,6 +61,6 @@ require ( ) replace ( - k8s.io/api => k8s.io/api v0.0.0-20240118211853-d5724e467262 - k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20240118211638-f14778da5523 + k8s.io/api => k8s.io/api v0.0.0-20240124211858-f3648a53522e + k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20240208123330-046ab0dee2aa ) diff --git a/go.sum b/go.sum index dfd0392a8..45758e890 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-20240118211853-d5724e467262 h1:iP5kk4e+c89xvFLRWdUb7BAYzBV9A//0vBHc9Ob/NUM= -k8s.io/api v0.0.0-20240118211853-d5724e467262/go.mod h1:BZUGwl6J5EvsODp+6ZUA+9p7V4iWxVLcr70rnzIshpA= -k8s.io/apimachinery v0.0.0-20240118211638-f14778da5523 h1:1iJCbQAZv58v4zxd0ECIIMnyYlFsPWa2hmjqGEsv/5g= -k8s.io/apimachinery v0.0.0-20240118211638-f14778da5523/go.mod h1:Oh3ZrffM1/I8O/43oAA+aoOYgSregIXHxcWJB9ZRfQ8= +k8s.io/api v0.0.0-20240124211858-f3648a53522e h1:Lv52wennNKzlcDrBtANztawHC8xaTllHm51WUKIP0Ew= +k8s.io/api v0.0.0-20240124211858-f3648a53522e/go.mod h1:BZUGwl6J5EvsODp+6ZUA+9p7V4iWxVLcr70rnzIshpA= +k8s.io/apimachinery v0.0.0-20240208123330-046ab0dee2aa h1:zOD6FZO+pxwGd9cLFzPJ4U94TujpovDw5/3t0HTNa40= +k8s.io/apimachinery v0.0.0-20240208123330-046ab0dee2aa/go.mod h1:Oh3ZrffM1/I8O/43oAA+aoOYgSregIXHxcWJB9ZRfQ8= 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-20231113174909-778a5567bc1e h1:snPmy96t93RredGRjKfMFt+gvxuVAncqSAyBveJtr4Q= diff --git a/informers/doc.go b/informers/doc.go index 231bffb69..f37c3e4d0 100644 --- a/informers/doc.go +++ b/informers/doc.go @@ -15,4 +15,4 @@ limitations under the License. */ // Package informers provides generated informers for Kubernetes APIs. -package informers +package informers // import "k8s.io/client-go/informers" diff --git a/kubernetes/doc.go b/kubernetes/doc.go index 9cef4242f..e052f81b8 100644 --- a/kubernetes/doc.go +++ b/kubernetes/doc.go @@ -16,4 +16,4 @@ limitations under the License. // Package kubernetes holds packages which implement a clientset for Kubernetes // APIs. -package kubernetes +package kubernetes // import "k8s.io/client-go/kubernetes" diff --git a/listers/doc.go b/listers/doc.go index da6a80408..96c330c93 100644 --- a/listers/doc.go +++ b/listers/doc.go @@ -15,4 +15,4 @@ limitations under the License. */ // Package listers provides generated listers for Kubernetes APIs. -package listers +package listers // import "k8s.io/client-go/listers" diff --git a/scale/scheme/appsint/doc.go b/scale/scheme/appsint/doc.go index 16f29e2af..735efb953 100644 --- a/scale/scheme/appsint/doc.go +++ b/scale/scheme/appsint/doc.go @@ -19,4 +19,4 @@ limitations under the License. // It doesn't have any of its own types -- it's just necessary to // get the expected behavior out of runtime.Scheme.ConvertToVersion // and associated methods. -package appsint +package appsint // import "k8s.io/client-go/scale/scheme/appsint" diff --git a/scale/scheme/doc.go b/scale/scheme/doc.go index 0203d6d5a..248b448a5 100644 --- a/scale/scheme/doc.go +++ b/scale/scheme/doc.go @@ -19,4 +19,4 @@ limitations under the License. // Package scheme contains a runtime.Scheme to be used for serializing // and deserializing different versions of Scale, and for converting // in between them. -package scheme +package scheme // import "k8s.io/client-go/scale/scheme" diff --git a/scale/scheme/extensionsint/doc.go b/scale/scheme/extensionsint/doc.go index 9aaac6086..dedff2d70 100644 --- a/scale/scheme/extensionsint/doc.go +++ b/scale/scheme/extensionsint/doc.go @@ -19,4 +19,4 @@ limitations under the License. // It doesn't have any of its own types -- it's just necessary to // get the expected behavior out of runtime.Scheme.ConvertToVersion // and associated methods. -package extensionsint +package extensionsint // import "k8s.io/client-go/scale/scheme/extensionsint" diff --git a/tools/clientcmd/api/doc.go b/tools/clientcmd/api/doc.go index 5871575a6..fd913a308 100644 --- a/tools/clientcmd/api/doc.go +++ b/tools/clientcmd/api/doc.go @@ -16,4 +16,4 @@ limitations under the License. // +k8s:deepcopy-gen=package -package api +package api // import "k8s.io/client-go/tools/clientcmd/api" diff --git a/tools/clientcmd/api/v1/doc.go b/tools/clientcmd/api/v1/doc.go index 3ccdebc1c..9e483e9d7 100644 --- a/tools/clientcmd/api/v1/doc.go +++ b/tools/clientcmd/api/v1/doc.go @@ -18,4 +18,4 @@ limitations under the License. // +k8s:deepcopy-gen=package // +k8s:defaulter-gen=Kind -package v1 +package v1 // import "k8s.io/client-go/tools/clientcmd/api/v1" From d23a110967cfa9cfec46c4ad01c168591a16b483 Mon Sep 17 00:00:00 2001 From: Ben Luddy Date: Mon, 12 Feb 2024 15:46:17 -0500 Subject: [PATCH 038/239] Bump github.com/fxamacker/cbor/v2 to v2.6.0. Kubernetes-commit: aac43dc96f2b679f0ab030fd3512c7e03b0f2df4 --- go.mod | 9 +++++---- go.sum | 14 ++++++++++---- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/go.mod b/go.mod index c9fa06a61..ab58a3383 100644 --- a/go.mod +++ b/go.mod @@ -24,8 +24,8 @@ require ( golang.org/x/term v0.15.0 golang.org/x/time v0.3.0 google.golang.org/protobuf v1.31.0 - k8s.io/api v0.0.0-20240210012304-e08bb0fc5290 - k8s.io/apimachinery v0.0.0-20240210011909-4a1251b70e07 + 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-20231113174909-778a5567bc1e k8s.io/utils v0.0.0-20230726121419-3b25d923346b @@ -61,6 +61,7 @@ require ( ) replace ( - k8s.io/api => k8s.io/api v0.0.0-20240210012304-e08bb0fc5290 - k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20240210011909-4a1251b70e07 + k8s.io/api => ../api + k8s.io/apimachinery => ../apimachinery + k8s.io/client-go => ../client-go ) diff --git a/go.sum b/go.sum index 3c7fc1b7a..89e189e27 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= @@ -97,13 +102,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.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= 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.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= 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= @@ -140,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/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.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= @@ -157,10 +166,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-20240210012304-e08bb0fc5290 h1:kJtm0TH2Kd9ckhj9D5+IqSvPl94XgmIpCZgICcbSrWA= -k8s.io/api v0.0.0-20240210012304-e08bb0fc5290/go.mod h1:NZBmJRWEuf2RKTOYTMZCchDDEMCw5N2rWL299ZWWmOY= -k8s.io/apimachinery v0.0.0-20240210011909-4a1251b70e07 h1:scQR0eGti1E17UVjIWHrF1ZcWpjFj0cn0sIszKJwdOQ= -k8s.io/apimachinery v0.0.0-20240210011909-4a1251b70e07/go.mod h1:akBo0Z+IFaOazGhD1RG6NG75rWj9oAhmz7UHqmfygmw= +k8s.io/gengo v0.0.0-20230829151522-9cce18d56c01/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= 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-20231113174909-778a5567bc1e h1:snPmy96t93RredGRjKfMFt+gvxuVAncqSAyBveJtr4Q= From 306b201a2d292fd78483fdf6147131926ed25a78 Mon Sep 17 00:00:00 2001 From: Kubernetes Publisher Date: Wed, 14 Feb 2024 15:56:56 -0800 Subject: [PATCH 039/239] Merge pull request #123250 from benluddy/dep-bump-cbor-v2.6.0 Bump github.com/fxamacker/cbor/v2 to v2.6.0. Kubernetes-commit: e305e773bbfe8c5bdf9c57881a875e168b004b8c --- go.mod | 9 ++++----- go.sum | 14 ++++---------- 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/go.mod b/go.mod index ab58a3383..d129ed630 100644 --- a/go.mod +++ b/go.mod @@ -24,8 +24,8 @@ require ( golang.org/x/term v0.15.0 golang.org/x/time v0.3.0 google.golang.org/protobuf v1.31.0 - k8s.io/api v0.0.0 - k8s.io/apimachinery v0.0.0 + k8s.io/api v0.0.0-20240215012102-e929f86ae1d3 + k8s.io/apimachinery v0.0.0-20240215011828-665c1a23c2ec k8s.io/klog/v2 v2.120.1 k8s.io/kube-openapi v0.0.0-20231113174909-778a5567bc1e k8s.io/utils v0.0.0-20230726121419-3b25d923346b @@ -61,7 +61,6 @@ require ( ) replace ( - k8s.io/api => ../api - k8s.io/apimachinery => ../apimachinery - k8s.io/client-go => ../client-go + k8s.io/api => k8s.io/api v0.0.0-20240215012102-e929f86ae1d3 + k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20240215011828-665c1a23c2ec ) diff --git a/go.sum b/go.sum index 89e189e27..c12aef6de 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= @@ -102,16 +97,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.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= 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.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= 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= @@ -148,7 +140,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.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= @@ -166,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 v0.0.0-20230829151522-9cce18d56c01/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= +k8s.io/api v0.0.0-20240215012102-e929f86ae1d3 h1:jc021XXOSiujuEcQBONY94N/kj4NHHM3h/LyF8vLtKk= +k8s.io/api v0.0.0-20240215012102-e929f86ae1d3/go.mod h1:UGYftZGEVWJmjcFQ0WHZVmn2xla1pekOgF2jxBJGfcA= +k8s.io/apimachinery v0.0.0-20240215011828-665c1a23c2ec h1:xg6PT422JEtM3dA+ecSlDp6nBrl9SHnJJvMEnvwu2uY= +k8s.io/apimachinery v0.0.0-20240215011828-665c1a23c2ec/go.mod h1:8Kbkl+Wq46koELfFfSvx+qgICYK22zw/3Epu/RdY6yQ= 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-20231113174909-778a5567bc1e h1:snPmy96t93RredGRjKfMFt+gvxuVAncqSAyBveJtr4Q= From bb04dc47e3314a5114bec1ac2be2f525fcc6f3c4 Mon Sep 17 00:00:00 2001 From: Abhijit Hoskeri Date: Fri, 16 Feb 2024 20:18:14 +0000 Subject: [PATCH 040/239] Update x/crypto to 0.19. Main reason is to pick up updated CA roots. Full diff: https://github.com/golang/crypto/compare/v0.16.0...v0.19.0 Kubernetes-commit: d3a0e296defbb0b55e591e273004e79e7ebfb1fd --- go.mod | 13 +++++++------ go.sum | 22 ++++++++++++++-------- 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/go.mod b/go.mod index 2388b7afe..e46befc98 100644 --- a/go.mod +++ b/go.mod @@ -21,11 +21,11 @@ require ( github.com/stretchr/testify v1.8.4 golang.org/x/net v0.19.0 golang.org/x/oauth2 v0.10.0 - golang.org/x/term v0.15.0 + golang.org/x/term v0.17.0 golang.org/x/time v0.3.0 google.golang.org/protobuf v1.31.0 - k8s.io/api v0.0.0-20240221122400-4efc15a7a4b4 - k8s.io/apimachinery v0.0.0-20240221122145-856aea55acea + 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-20231113174909-778a5567bc1e k8s.io/utils v0.0.0-20230726121419-3b25d923346b @@ -52,7 +52,7 @@ 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.15.0 // indirect + golang.org/x/sys v0.17.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 @@ -61,6 +61,7 @@ require ( ) replace ( - k8s.io/api => k8s.io/api v0.0.0-20240221122400-4efc15a7a4b4 - k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20240221122145-856aea55acea + k8s.io/api => ../api + k8s.io/apimachinery => ../apimachinery + k8s.io/client-go => ../client-go ) diff --git a/go.sum b/go.sum index 3fb38ce11..77a50bf0c 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= @@ -97,13 +102,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.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= 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.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= 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= @@ -119,10 +127,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.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= -golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/term v0.15.0 h1:y/Oo/a/q3IXu26lQgl04j/gjuBDOBlx7X6Om1j2CPW4= -golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0= +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/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= @@ -140,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/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.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= @@ -157,10 +166,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-20240221122400-4efc15a7a4b4 h1:qCX5T0ocJ1Uai8CWIQ/cAjafWV1cJDy89O0T6NGfGgQ= -k8s.io/api v0.0.0-20240221122400-4efc15a7a4b4/go.mod h1:dQtw3DS5VYIBF9ruCg+iFD137v1EBNZxYIsBT7w6ncg= -k8s.io/apimachinery v0.0.0-20240221122145-856aea55acea h1:noOTXkaeQKCee5NTYUJXa3mKJHpnaqt1BleKeNg6CEo= -k8s.io/apimachinery v0.0.0-20240221122145-856aea55acea/go.mod h1:8Kbkl+Wq46koELfFfSvx+qgICYK22zw/3Epu/RdY6yQ= +k8s.io/gengo v0.0.0-20230829151522-9cce18d56c01/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= 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-20231113174909-778a5567bc1e h1:snPmy96t93RredGRjKfMFt+gvxuVAncqSAyBveJtr4Q= From 7087b65a7439830e536f6260d7692d9e544c94c9 Mon Sep 17 00:00:00 2001 From: Tim Hockin Date: Sun, 18 Feb 2024 14:50:55 -0800 Subject: [PATCH 041/239] Cleanup: s/depreciated/deprecated/g Kubernetes-commit: 9f4b82bf3b079fe868effbd2498b61464db6d459 --- discovery/testdata/apis/batch/v1.json | 2 +- discovery/testdata/apis/batch/v1beta1.json | 2 +- openapi/openapitest/testdata/api__v1_openapi.json | 2 +- openapi/openapitest/testdata/apis__apps__v1_openapi.json | 2 +- openapi/openapitest/testdata/apis__batch__v1_openapi.json | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/discovery/testdata/apis/batch/v1.json b/discovery/testdata/apis/batch/v1.json index 14db75abc..d88f5fa47 100644 --- a/discovery/testdata/apis/batch/v1.json +++ b/discovery/testdata/apis/batch/v1.json @@ -1 +1 @@ -{"openapi":"3.0.0","info":{"title":"Kubernetes","version":"v1.24.0"},"paths":{"/apis/batch/v1/":{"get":{"tags":["batch_v1"],"description":"get available resources","operationId":"getBatchV1APIResources","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.APIResourceList"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.APIResourceList"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.APIResourceList"}}}}}}},"/apis/batch/v1/cronjobs":{"get":{"tags":["batch_v1"],"description":"list or watch objects of kind CronJob","operationId":"listBatchV1CronJobForAllNamespaces","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJobList"}},"application/json;stream=watch":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJobList"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJobList"}},"application/vnd.kubernetes.protobuf;stream=watch":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJobList"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJobList"}}}}}},"parameters":[{"name":"allowWatchBookmarks","in":"query","description":"allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.","schema":{"type":"boolean","uniqueItems":true}},{"name":"continue","in":"query","description":"The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.","schema":{"type":"string","uniqueItems":true}},{"name":"fieldSelector","in":"query","description":"A selector to restrict the list of returned objects by their fields. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"labelSelector","in":"query","description":"A selector to restrict the list of returned objects by their labels. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"limit","in":"query","description":"limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.","schema":{"type":"integer","uniqueItems":true}},{"name":"pretty","in":"query","description":"If 'true', then the output is pretty printed.","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersion","in":"query","description":"resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersionMatch","in":"query","description":"resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"timeoutSeconds","in":"query","description":"Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.","schema":{"type":"integer","uniqueItems":true}},{"name":"watch","in":"query","description":"Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.","schema":{"type":"boolean","uniqueItems":true}}]},"/apis/batch/v1/jobs":{"get":{"tags":["batch_v1"],"description":"list or watch objects of kind Job","operationId":"listBatchV1JobForAllNamespaces","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.JobList"}},"application/json;stream=watch":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.JobList"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.JobList"}},"application/vnd.kubernetes.protobuf;stream=watch":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.JobList"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.JobList"}}}}}},"parameters":[{"name":"allowWatchBookmarks","in":"query","description":"allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.","schema":{"type":"boolean","uniqueItems":true}},{"name":"continue","in":"query","description":"The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.","schema":{"type":"string","uniqueItems":true}},{"name":"fieldSelector","in":"query","description":"A selector to restrict the list of returned objects by their fields. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"labelSelector","in":"query","description":"A selector to restrict the list of returned objects by their labels. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"limit","in":"query","description":"limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.","schema":{"type":"integer","uniqueItems":true}},{"name":"pretty","in":"query","description":"If 'true', then the output is pretty printed.","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersion","in":"query","description":"resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersionMatch","in":"query","description":"resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"timeoutSeconds","in":"query","description":"Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.","schema":{"type":"integer","uniqueItems":true}},{"name":"watch","in":"query","description":"Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.","schema":{"type":"boolean","uniqueItems":true}}]},"/apis/batch/v1/namespaces/{namespace}/cronjobs":{"get":{"tags":["batch_v1"],"description":"list or watch objects of kind CronJob","operationId":"listBatchV1NamespacedCronJob","parameters":[{"name":"labelSelector","in":"query","description":"A selector to restrict the list of returned objects by their labels. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"fieldSelector","in":"query","description":"A selector to restrict the list of returned objects by their fields. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"watch","in":"query","description":"Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.","schema":{"type":"boolean","uniqueItems":true}},{"name":"allowWatchBookmarks","in":"query","description":"allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.","schema":{"type":"boolean","uniqueItems":true}},{"name":"resourceVersion","in":"query","description":"resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersionMatch","in":"query","description":"resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"timeoutSeconds","in":"query","description":"Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.","schema":{"type":"integer","uniqueItems":true}},{"name":"limit","in":"query","description":"limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.","schema":{"type":"integer","uniqueItems":true}},{"name":"continue","in":"query","description":"The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.","schema":{"type":"string","uniqueItems":true}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJobList"}},"application/json;stream=watch":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJobList"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJobList"}},"application/vnd.kubernetes.protobuf;stream=watch":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJobList"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJobList"}}}}}},"post":{"tags":["batch_v1"],"description":"create a CronJob","operationId":"createBatchV1NamespacedCronJob","parameters":[{"name":"dryRun","in":"query","description":"When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed","schema":{"type":"string","uniqueItems":true}},{"name":"fieldManager","in":"query","description":"fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.","schema":{"type":"string","uniqueItems":true}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}}}},"202":{"description":"Accepted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}}}}}},"delete":{"tags":["batch_v1"],"description":"delete collection of CronJob","operationId":"deleteBatchV1CollectionNamespacedCronJob","parameters":[{"name":"gracePeriodSeconds","in":"query","description":"The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.","schema":{"type":"integer","uniqueItems":true}},{"name":"orphanDependents","in":"query","description":"Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.","schema":{"type":"boolean","uniqueItems":true}},{"name":"propagationPolicy","in":"query","description":"Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.","schema":{"type":"string","uniqueItems":true}},{"name":"dryRun","in":"query","description":"When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed","schema":{"type":"string","uniqueItems":true}},{"name":"labelSelector","in":"query","description":"A selector to restrict the list of returned objects by their labels. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"fieldSelector","in":"query","description":"A selector to restrict the list of returned objects by their fields. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersion","in":"query","description":"resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersionMatch","in":"query","description":"resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"timeoutSeconds","in":"query","description":"Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.","schema":{"type":"integer","uniqueItems":true}},{"name":"limit","in":"query","description":"limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.","schema":{"type":"integer","uniqueItems":true}},{"name":"continue","in":"query","description":"The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.","schema":{"type":"string","uniqueItems":true}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status"}}}}}},"parameters":[{"name":"namespace","in":"path","description":"object name and auth scope, such as for teams and projects","required":true,"schema":{"type":"string","uniqueItems":true}},{"name":"pretty","in":"query","description":"If 'true', then the output is pretty printed.","schema":{"type":"string","uniqueItems":true}}]},"/apis/batch/v1/namespaces/{namespace}/cronjobs/{name}":{"get":{"tags":["batch_v1"],"description":"read the specified CronJob","operationId":"readBatchV1NamespacedCronJob","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}}}}}},"put":{"tags":["batch_v1"],"description":"replace the specified CronJob","operationId":"replaceBatchV1NamespacedCronJob","parameters":[{"name":"dryRun","in":"query","description":"When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed","schema":{"type":"string","uniqueItems":true}},{"name":"fieldManager","in":"query","description":"fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.","schema":{"type":"string","uniqueItems":true}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}}}}}},"delete":{"tags":["batch_v1"],"description":"delete a CronJob","operationId":"deleteBatchV1NamespacedCronJob","parameters":[{"name":"gracePeriodSeconds","in":"query","description":"The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.","schema":{"type":"integer","uniqueItems":true}},{"name":"orphanDependents","in":"query","description":"Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.","schema":{"type":"boolean","uniqueItems":true}},{"name":"propagationPolicy","in":"query","description":"Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.","schema":{"type":"string","uniqueItems":true}},{"name":"dryRun","in":"query","description":"When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed","schema":{"type":"string","uniqueItems":true}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status"}}}},"202":{"description":"Accepted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status"}}}}}},"patch":{"tags":["batch_v1"],"description":"partially update the specified CronJob","operationId":"patchBatchV1NamespacedCronJob","parameters":[{"name":"dryRun","in":"query","description":"When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed","schema":{"type":"string","uniqueItems":true}},{"name":"force","in":"query","description":"Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.","schema":{"type":"boolean","uniqueItems":true}},{"name":"fieldManager","in":"query","description":"fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).","schema":{"type":"string","uniqueItems":true}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}}}}}},"parameters":[{"name":"name","in":"path","description":"name of the CronJob","required":true,"schema":{"type":"string","uniqueItems":true}},{"name":"namespace","in":"path","description":"object name and auth scope, such as for teams and projects","required":true,"schema":{"type":"string","uniqueItems":true}},{"name":"pretty","in":"query","description":"If 'true', then the output is pretty printed.","schema":{"type":"string","uniqueItems":true}}]},"/apis/batch/v1/namespaces/{namespace}/cronjobs/{name}/status":{"get":{"tags":["batch_v1"],"description":"read status of the specified CronJob","operationId":"readBatchV1NamespacedCronJobStatus","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}}}}}},"put":{"tags":["batch_v1"],"description":"replace status of the specified CronJob","operationId":"replaceBatchV1NamespacedCronJobStatus","parameters":[{"name":"dryRun","in":"query","description":"When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed","schema":{"type":"string","uniqueItems":true}},{"name":"fieldManager","in":"query","description":"fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.","schema":{"type":"string","uniqueItems":true}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}}}}}},"patch":{"tags":["batch_v1"],"description":"partially update status of the specified CronJob","operationId":"patchBatchV1NamespacedCronJobStatus","parameters":[{"name":"dryRun","in":"query","description":"When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed","schema":{"type":"string","uniqueItems":true}},{"name":"force","in":"query","description":"Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.","schema":{"type":"boolean","uniqueItems":true}},{"name":"fieldManager","in":"query","description":"fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).","schema":{"type":"string","uniqueItems":true}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}}}}}},"parameters":[{"name":"name","in":"path","description":"name of the CronJob","required":true,"schema":{"type":"string","uniqueItems":true}},{"name":"namespace","in":"path","description":"object name and auth scope, such as for teams and projects","required":true,"schema":{"type":"string","uniqueItems":true}},{"name":"pretty","in":"query","description":"If 'true', then the output is pretty printed.","schema":{"type":"string","uniqueItems":true}}]},"/apis/batch/v1/namespaces/{namespace}/jobs":{"get":{"tags":["batch_v1"],"description":"list or watch objects of kind Job","operationId":"listBatchV1NamespacedJob","parameters":[{"name":"labelSelector","in":"query","description":"A selector to restrict the list of returned objects by their labels. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"fieldSelector","in":"query","description":"A selector to restrict the list of returned objects by their fields. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"watch","in":"query","description":"Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.","schema":{"type":"boolean","uniqueItems":true}},{"name":"allowWatchBookmarks","in":"query","description":"allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.","schema":{"type":"boolean","uniqueItems":true}},{"name":"resourceVersion","in":"query","description":"resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersionMatch","in":"query","description":"resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"timeoutSeconds","in":"query","description":"Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.","schema":{"type":"integer","uniqueItems":true}},{"name":"limit","in":"query","description":"limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.","schema":{"type":"integer","uniqueItems":true}},{"name":"continue","in":"query","description":"The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.","schema":{"type":"string","uniqueItems":true}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.JobList"}},"application/json;stream=watch":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.JobList"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.JobList"}},"application/vnd.kubernetes.protobuf;stream=watch":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.JobList"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.JobList"}}}}}},"post":{"tags":["batch_v1"],"description":"create a Job","operationId":"createBatchV1NamespacedJob","parameters":[{"name":"dryRun","in":"query","description":"When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed","schema":{"type":"string","uniqueItems":true}},{"name":"fieldManager","in":"query","description":"fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.","schema":{"type":"string","uniqueItems":true}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}}}},"202":{"description":"Accepted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}}}}}},"delete":{"tags":["batch_v1"],"description":"delete collection of Job","operationId":"deleteBatchV1CollectionNamespacedJob","parameters":[{"name":"gracePeriodSeconds","in":"query","description":"The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.","schema":{"type":"integer","uniqueItems":true}},{"name":"orphanDependents","in":"query","description":"Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.","schema":{"type":"boolean","uniqueItems":true}},{"name":"propagationPolicy","in":"query","description":"Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.","schema":{"type":"string","uniqueItems":true}},{"name":"dryRun","in":"query","description":"When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed","schema":{"type":"string","uniqueItems":true}},{"name":"labelSelector","in":"query","description":"A selector to restrict the list of returned objects by their labels. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"fieldSelector","in":"query","description":"A selector to restrict the list of returned objects by their fields. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersion","in":"query","description":"resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersionMatch","in":"query","description":"resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"timeoutSeconds","in":"query","description":"Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.","schema":{"type":"integer","uniqueItems":true}},{"name":"limit","in":"query","description":"limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.","schema":{"type":"integer","uniqueItems":true}},{"name":"continue","in":"query","description":"The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.","schema":{"type":"string","uniqueItems":true}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status"}}}}}},"parameters":[{"name":"namespace","in":"path","description":"object name and auth scope, such as for teams and projects","required":true,"schema":{"type":"string","uniqueItems":true}},{"name":"pretty","in":"query","description":"If 'true', then the output is pretty printed.","schema":{"type":"string","uniqueItems":true}}]},"/apis/batch/v1/namespaces/{namespace}/jobs/{name}":{"get":{"tags":["batch_v1"],"description":"read the specified Job","operationId":"readBatchV1NamespacedJob","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}}}}}},"put":{"tags":["batch_v1"],"description":"replace the specified Job","operationId":"replaceBatchV1NamespacedJob","parameters":[{"name":"dryRun","in":"query","description":"When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed","schema":{"type":"string","uniqueItems":true}},{"name":"fieldManager","in":"query","description":"fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.","schema":{"type":"string","uniqueItems":true}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}}}}}},"delete":{"tags":["batch_v1"],"description":"delete a Job","operationId":"deleteBatchV1NamespacedJob","parameters":[{"name":"gracePeriodSeconds","in":"query","description":"The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.","schema":{"type":"integer","uniqueItems":true}},{"name":"orphanDependents","in":"query","description":"Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.","schema":{"type":"boolean","uniqueItems":true}},{"name":"propagationPolicy","in":"query","description":"Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.","schema":{"type":"string","uniqueItems":true}},{"name":"dryRun","in":"query","description":"When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed","schema":{"type":"string","uniqueItems":true}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status"}}}},"202":{"description":"Accepted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status"}}}}}},"patch":{"tags":["batch_v1"],"description":"partially update the specified Job","operationId":"patchBatchV1NamespacedJob","parameters":[{"name":"dryRun","in":"query","description":"When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed","schema":{"type":"string","uniqueItems":true}},{"name":"force","in":"query","description":"Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.","schema":{"type":"boolean","uniqueItems":true}},{"name":"fieldManager","in":"query","description":"fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).","schema":{"type":"string","uniqueItems":true}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}}}}}},"parameters":[{"name":"name","in":"path","description":"name of the Job","required":true,"schema":{"type":"string","uniqueItems":true}},{"name":"namespace","in":"path","description":"object name and auth scope, such as for teams and projects","required":true,"schema":{"type":"string","uniqueItems":true}},{"name":"pretty","in":"query","description":"If 'true', then the output is pretty printed.","schema":{"type":"string","uniqueItems":true}}]},"/apis/batch/v1/namespaces/{namespace}/jobs/{name}/status":{"get":{"tags":["batch_v1"],"description":"read status of the specified Job","operationId":"readBatchV1NamespacedJobStatus","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}}}}}},"put":{"tags":["batch_v1"],"description":"replace status of the specified Job","operationId":"replaceBatchV1NamespacedJobStatus","parameters":[{"name":"dryRun","in":"query","description":"When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed","schema":{"type":"string","uniqueItems":true}},{"name":"fieldManager","in":"query","description":"fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.","schema":{"type":"string","uniqueItems":true}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}}}}}},"patch":{"tags":["batch_v1"],"description":"partially update status of the specified Job","operationId":"patchBatchV1NamespacedJobStatus","parameters":[{"name":"dryRun","in":"query","description":"When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed","schema":{"type":"string","uniqueItems":true}},{"name":"force","in":"query","description":"Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.","schema":{"type":"boolean","uniqueItems":true}},{"name":"fieldManager","in":"query","description":"fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).","schema":{"type":"string","uniqueItems":true}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}}}}}},"parameters":[{"name":"name","in":"path","description":"name of the Job","required":true,"schema":{"type":"string","uniqueItems":true}},{"name":"namespace","in":"path","description":"object name and auth scope, such as for teams and projects","required":true,"schema":{"type":"string","uniqueItems":true}},{"name":"pretty","in":"query","description":"If 'true', then the output is pretty printed.","schema":{"type":"string","uniqueItems":true}}]},"/apis/batch/v1/watch/cronjobs":{"get":{"tags":["batch_v1"],"description":"watch individual changes to a list of CronJob. deprecated: use the 'watch' parameter with a list operation instead.","operationId":"watchBatchV1CronJobListForAllNamespaces","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/json;stream=watch":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/vnd.kubernetes.protobuf;stream=watch":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}}}}}},"parameters":[{"name":"allowWatchBookmarks","in":"query","description":"allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.","schema":{"type":"boolean","uniqueItems":true}},{"name":"continue","in":"query","description":"The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.","schema":{"type":"string","uniqueItems":true}},{"name":"fieldSelector","in":"query","description":"A selector to restrict the list of returned objects by their fields. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"labelSelector","in":"query","description":"A selector to restrict the list of returned objects by their labels. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"limit","in":"query","description":"limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.","schema":{"type":"integer","uniqueItems":true}},{"name":"pretty","in":"query","description":"If 'true', then the output is pretty printed.","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersion","in":"query","description":"resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersionMatch","in":"query","description":"resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"timeoutSeconds","in":"query","description":"Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.","schema":{"type":"integer","uniqueItems":true}},{"name":"watch","in":"query","description":"Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.","schema":{"type":"boolean","uniqueItems":true}}]},"/apis/batch/v1/watch/jobs":{"get":{"tags":["batch_v1"],"description":"watch individual changes to a list of Job. deprecated: use the 'watch' parameter with a list operation instead.","operationId":"watchBatchV1JobListForAllNamespaces","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/json;stream=watch":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/vnd.kubernetes.protobuf;stream=watch":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}}}}}},"parameters":[{"name":"allowWatchBookmarks","in":"query","description":"allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.","schema":{"type":"boolean","uniqueItems":true}},{"name":"continue","in":"query","description":"The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.","schema":{"type":"string","uniqueItems":true}},{"name":"fieldSelector","in":"query","description":"A selector to restrict the list of returned objects by their fields. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"labelSelector","in":"query","description":"A selector to restrict the list of returned objects by their labels. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"limit","in":"query","description":"limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.","schema":{"type":"integer","uniqueItems":true}},{"name":"pretty","in":"query","description":"If 'true', then the output is pretty printed.","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersion","in":"query","description":"resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersionMatch","in":"query","description":"resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"timeoutSeconds","in":"query","description":"Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.","schema":{"type":"integer","uniqueItems":true}},{"name":"watch","in":"query","description":"Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.","schema":{"type":"boolean","uniqueItems":true}}]},"/apis/batch/v1/watch/namespaces/{namespace}/cronjobs":{"get":{"tags":["batch_v1"],"description":"watch individual changes to a list of CronJob. deprecated: use the 'watch' parameter with a list operation instead.","operationId":"watchBatchV1NamespacedCronJobList","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/json;stream=watch":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/vnd.kubernetes.protobuf;stream=watch":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}}}}}},"parameters":[{"name":"allowWatchBookmarks","in":"query","description":"allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.","schema":{"type":"boolean","uniqueItems":true}},{"name":"continue","in":"query","description":"The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.","schema":{"type":"string","uniqueItems":true}},{"name":"fieldSelector","in":"query","description":"A selector to restrict the list of returned objects by their fields. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"labelSelector","in":"query","description":"A selector to restrict the list of returned objects by their labels. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"limit","in":"query","description":"limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.","schema":{"type":"integer","uniqueItems":true}},{"name":"namespace","in":"path","description":"object name and auth scope, such as for teams and projects","required":true,"schema":{"type":"string","uniqueItems":true}},{"name":"pretty","in":"query","description":"If 'true', then the output is pretty printed.","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersion","in":"query","description":"resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersionMatch","in":"query","description":"resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"timeoutSeconds","in":"query","description":"Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.","schema":{"type":"integer","uniqueItems":true}},{"name":"watch","in":"query","description":"Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.","schema":{"type":"boolean","uniqueItems":true}}]},"/apis/batch/v1/watch/namespaces/{namespace}/cronjobs/{name}":{"get":{"tags":["batch_v1"],"description":"watch changes to an object of kind CronJob. deprecated: use the 'watch' parameter with a list operation instead, filtered to a single item with the 'fieldSelector' parameter.","operationId":"watchBatchV1NamespacedCronJob","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/json;stream=watch":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/vnd.kubernetes.protobuf;stream=watch":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}}}}}},"parameters":[{"name":"allowWatchBookmarks","in":"query","description":"allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.","schema":{"type":"boolean","uniqueItems":true}},{"name":"continue","in":"query","description":"The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.","schema":{"type":"string","uniqueItems":true}},{"name":"fieldSelector","in":"query","description":"A selector to restrict the list of returned objects by their fields. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"labelSelector","in":"query","description":"A selector to restrict the list of returned objects by their labels. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"limit","in":"query","description":"limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.","schema":{"type":"integer","uniqueItems":true}},{"name":"name","in":"path","description":"name of the CronJob","required":true,"schema":{"type":"string","uniqueItems":true}},{"name":"namespace","in":"path","description":"object name and auth scope, such as for teams and projects","required":true,"schema":{"type":"string","uniqueItems":true}},{"name":"pretty","in":"query","description":"If 'true', then the output is pretty printed.","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersion","in":"query","description":"resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersionMatch","in":"query","description":"resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"timeoutSeconds","in":"query","description":"Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.","schema":{"type":"integer","uniqueItems":true}},{"name":"watch","in":"query","description":"Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.","schema":{"type":"boolean","uniqueItems":true}}]},"/apis/batch/v1/watch/namespaces/{namespace}/jobs":{"get":{"tags":["batch_v1"],"description":"watch individual changes to a list of Job. deprecated: use the 'watch' parameter with a list operation instead.","operationId":"watchBatchV1NamespacedJobList","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/json;stream=watch":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/vnd.kubernetes.protobuf;stream=watch":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}}}}}},"parameters":[{"name":"allowWatchBookmarks","in":"query","description":"allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.","schema":{"type":"boolean","uniqueItems":true}},{"name":"continue","in":"query","description":"The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.","schema":{"type":"string","uniqueItems":true}},{"name":"fieldSelector","in":"query","description":"A selector to restrict the list of returned objects by their fields. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"labelSelector","in":"query","description":"A selector to restrict the list of returned objects by their labels. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"limit","in":"query","description":"limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.","schema":{"type":"integer","uniqueItems":true}},{"name":"namespace","in":"path","description":"object name and auth scope, such as for teams and projects","required":true,"schema":{"type":"string","uniqueItems":true}},{"name":"pretty","in":"query","description":"If 'true', then the output is pretty printed.","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersion","in":"query","description":"resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersionMatch","in":"query","description":"resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"timeoutSeconds","in":"query","description":"Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.","schema":{"type":"integer","uniqueItems":true}},{"name":"watch","in":"query","description":"Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.","schema":{"type":"boolean","uniqueItems":true}}]},"/apis/batch/v1/watch/namespaces/{namespace}/jobs/{name}":{"get":{"tags":["batch_v1"],"description":"watch changes to an object of kind Job. deprecated: use the 'watch' parameter with a list operation instead, filtered to a single item with the 'fieldSelector' parameter.","operationId":"watchBatchV1NamespacedJob","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/json;stream=watch":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/vnd.kubernetes.protobuf;stream=watch":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}}}}}},"parameters":[{"name":"allowWatchBookmarks","in":"query","description":"allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.","schema":{"type":"boolean","uniqueItems":true}},{"name":"continue","in":"query","description":"The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.","schema":{"type":"string","uniqueItems":true}},{"name":"fieldSelector","in":"query","description":"A selector to restrict the list of returned objects by their fields. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"labelSelector","in":"query","description":"A selector to restrict the list of returned objects by their labels. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"limit","in":"query","description":"limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.","schema":{"type":"integer","uniqueItems":true}},{"name":"name","in":"path","description":"name of the Job","required":true,"schema":{"type":"string","uniqueItems":true}},{"name":"namespace","in":"path","description":"object name and auth scope, such as for teams and projects","required":true,"schema":{"type":"string","uniqueItems":true}},{"name":"pretty","in":"query","description":"If 'true', then the output is pretty printed.","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersion","in":"query","description":"resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersionMatch","in":"query","description":"resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"timeoutSeconds","in":"query","description":"Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.","schema":{"type":"integer","uniqueItems":true}},{"name":"watch","in":"query","description":"Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.","schema":{"type":"boolean","uniqueItems":true}}]}},"components":{"schemas":{"io.k8s.api.batch.v1.CronJob":{"description":"CronJob represents the configuration of a single cron job.","type":"object","properties":{"apiVersion":{"description":"APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources","type":"string"},"kind":{"description":"Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds","type":"string"},"metadata":{"description":"Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata","default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"},"spec":{"description":"Specification of the desired behavior of a cron job, including the schedule. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status","default":{},"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJobSpec"},"status":{"description":"Current status of a cron job. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status","default":{},"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJobStatus"}},"x-kubernetes-group-version-kind":[{"group":"batch","kind":"CronJob","version":"v1"}]},"io.k8s.api.batch.v1.CronJobList":{"description":"CronJobList is a collection of cron jobs.","type":"object","required":["items"],"properties":{"apiVersion":{"description":"APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources","type":"string"},"items":{"description":"items is the list of CronJobs.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}},"kind":{"description":"Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds","type":"string"},"metadata":{"description":"Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata","default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta"}},"x-kubernetes-group-version-kind":[{"group":"batch","kind":"CronJobList","version":"v1"}]},"io.k8s.api.batch.v1.CronJobSpec":{"description":"CronJobSpec describes how the job execution will look like and when it will actually run.","type":"object","required":["schedule","jobTemplate"],"properties":{"concurrencyPolicy":{"description":"Specifies how to treat concurrent executions of a Job. Valid values are: - \"Allow\" (default): allows CronJobs to run concurrently; - \"Forbid\": forbids concurrent runs, skipping next run if previous run hasn't finished yet; - \"Replace\": cancels currently running job and replaces it with a new one\n\n","type":"string"},"failedJobsHistoryLimit":{"description":"The number of failed finished jobs to retain. Value must be non-negative integer. Defaults to 1.","type":"integer","format":"int32"},"jobTemplate":{"description":"Specifies the job that will be created when executing a CronJob.","default":{},"$ref":"#/components/schemas/io.k8s.api.batch.v1.JobTemplateSpec"},"schedule":{"description":"The schedule in Cron format, see https://en.wikipedia.org/wiki/Cron.","type":"string","default":""},"startingDeadlineSeconds":{"description":"Optional deadline in seconds for starting the job if it misses scheduled time for any reason. Missed jobs executions will be counted as failed ones.","type":"integer","format":"int64"},"successfulJobsHistoryLimit":{"description":"The number of successful finished jobs to retain. Value must be non-negative integer. Defaults to 3.","type":"integer","format":"int32"},"suspend":{"description":"This flag tells the controller to suspend subsequent executions, it does not apply to already started executions. Defaults to false.","type":"boolean"}}},"io.k8s.api.batch.v1.CronJobStatus":{"description":"CronJobStatus represents the current state of a cron job.","type":"object","properties":{"active":{"description":"A list of pointers to currently running jobs.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.ObjectReference"},"x-kubernetes-list-type":"atomic"},"lastScheduleTime":{"description":"Information when was the last time the job was successfully scheduled.","$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time"},"lastSuccessfulTime":{"description":"Information when was the last time the job successfully completed.","$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time"}}},"io.k8s.api.batch.v1.Job":{"description":"Job represents the configuration of a single job.","type":"object","properties":{"apiVersion":{"description":"APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources","type":"string"},"kind":{"description":"Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds","type":"string"},"metadata":{"description":"Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata","default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"},"spec":{"description":"Specification of the desired behavior of a job. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status","default":{},"$ref":"#/components/schemas/io.k8s.api.batch.v1.JobSpec"},"status":{"description":"Current status of a job. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status","default":{},"$ref":"#/components/schemas/io.k8s.api.batch.v1.JobStatus"}},"x-kubernetes-group-version-kind":[{"group":"batch","kind":"Job","version":"v1"}]},"io.k8s.api.batch.v1.JobCondition":{"description":"JobCondition describes current state of a job.","type":"object","required":["type","status"],"properties":{"lastProbeTime":{"description":"Last time the condition was checked.","default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time"},"lastTransitionTime":{"description":"Last time the condition transit from one status to another.","default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time"},"message":{"description":"Human readable message indicating details about last transition.","type":"string"},"reason":{"description":"(brief) reason for the condition's last transition.","type":"string"},"status":{"description":"Status of the condition, one of True, False, Unknown.","type":"string","default":""},"type":{"description":"Type of job condition, Complete or Failed.\n\n","type":"string","default":""}}},"io.k8s.api.batch.v1.JobList":{"description":"JobList is a collection of jobs.","type":"object","required":["items"],"properties":{"apiVersion":{"description":"APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources","type":"string"},"items":{"description":"items is the list of Jobs.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}},"kind":{"description":"Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds","type":"string"},"metadata":{"description":"Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata","default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta"}},"x-kubernetes-group-version-kind":[{"group":"batch","kind":"JobList","version":"v1"}]},"io.k8s.api.batch.v1.JobSpec":{"description":"JobSpec describes how the job execution will look like.","type":"object","required":["template"],"properties":{"activeDeadlineSeconds":{"description":"Specifies the duration in seconds relative to the startTime that the job may be continuously active before the system tries to terminate it; value must be positive integer. If a Job is suspended (at creation or through an update), this timer will effectively be stopped and reset when the Job is resumed again.","type":"integer","format":"int64"},"backoffLimit":{"description":"Specifies the number of retries before marking this job failed. Defaults to 6","type":"integer","format":"int32"},"completionMode":{"description":"CompletionMode specifies how Pod completions are tracked. It can be `NonIndexed` (default) or `Indexed`.\n\n`NonIndexed` means that the Job is considered complete when there have been .spec.completions successfully completed Pods. Each Pod completion is homologous to each other.\n\n`Indexed` means that the Pods of a Job get an associated completion index from 0 to (.spec.completions - 1), available in the annotation batch.kubernetes.io/job-completion-index. The Job is considered complete when there is one successfully completed Pod for each index. When value is `Indexed`, .spec.completions must be specified and `.spec.parallelism` must be less than or equal to 10^5. In addition, The Pod name takes the form `$(job-name)-$(index)-$(random-string)`, the Pod hostname takes the form `$(job-name)-$(index)`.\n\nThis field is beta-level. More completion modes can be added in the future. If the Job controller observes a mode that it doesn't recognize, the controller skips updates for the Job.","type":"string"},"completions":{"description":"Specifies the desired number of successfully finished pods the job should be run with. Setting to nil means that the success of any pod signals the success of all pods, and allows parallelism to have any positive value. Setting to 1 means that parallelism is limited to 1 and the success of that pod signals the success of the job. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/","type":"integer","format":"int32"},"manualSelector":{"description":"manualSelector controls generation of pod labels and pod selectors. Leave `manualSelector` unset unless you are certain what you are doing. When false or unset, the system pick labels unique to this job and appends those labels to the pod template. When true, the user is responsible for picking unique labels and specifying the selector. Failure to pick a unique label may cause this and other jobs to not function correctly. However, You may see `manualSelector=true` in jobs that were created with the old `extensions/v1beta1` API. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/#specifying-your-own-pod-selector","type":"boolean"},"parallelism":{"description":"Specifies the maximum desired number of pods the job should run at any given time. The actual number of pods running in steady state will be less than this number when ((.spec.completions - .status.successful) \u003c .spec.parallelism), i.e. when the work left to do is less than max parallelism. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/","type":"integer","format":"int32"},"selector":{"description":"A label query over pods that should match the pod count. Normally, the system sets this field for you. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors","$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector"},"suspend":{"description":"Suspend specifies whether the Job controller should create Pods or not. If a Job is created with suspend set to true, no Pods are created by the Job controller. If a Job is suspended after creation (i.e. the flag goes from false to true), the Job controller will delete all active Pods associated with this Job. Users must design their workload to gracefully handle this. Suspending a Job will reset the StartTime field of the Job, effectively resetting the ActiveDeadlineSeconds timer too. Defaults to false.\n\nThis field is beta-level, gated by SuspendJob feature flag (enabled by default).","type":"boolean"},"template":{"description":"Describes the pod that will be created when executing a job. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/","default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.PodTemplateSpec"},"ttlSecondsAfterFinished":{"description":"ttlSecondsAfterFinished limits the lifetime of a Job that has finished execution (either Complete or Failed). If this field is set, ttlSecondsAfterFinished after the Job finishes, it is eligible to be automatically deleted. When the Job is being deleted, its lifecycle guarantees (e.g. finalizers) will be honored. If this field is unset, the Job won't be automatically deleted. If this field is set to zero, the Job becomes eligible to be deleted immediately after it finishes.","type":"integer","format":"int32"}}},"io.k8s.api.batch.v1.JobStatus":{"description":"JobStatus represents the current state of a Job.","type":"object","properties":{"active":{"description":"The number of pending and running pods.","type":"integer","format":"int32"},"completedIndexes":{"description":"CompletedIndexes holds the completed indexes when .spec.completionMode = \"Indexed\" in a text format. The indexes are represented as decimal integers separated by commas. The numbers are listed in increasing order. Three or more consecutive numbers are compressed and represented by the first and last element of the series, separated by a hyphen. For example, if the completed indexes are 1, 3, 4, 5 and 7, they are represented as \"1,3-5,7\".","type":"string"},"completionTime":{"description":"Represents time when the job was completed. It is not guaranteed to be set in happens-before order across separate operations. It is represented in RFC3339 form and is in UTC. The completion time is only set when the job finishes successfully.","$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time"},"conditions":{"description":"The latest available observations of an object's current state. When a Job fails, one of the conditions will have type \"Failed\" and status true. When a Job is suspended, one of the conditions will have type \"Suspended\" and status true; when the Job is resumed, the status of this condition will become false. When a Job is completed, one of the conditions will have type \"Complete\" and status true. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.batch.v1.JobCondition"},"x-kubernetes-list-type":"atomic","x-kubernetes-patch-merge-key":"type","x-kubernetes-patch-strategy":"merge"},"failed":{"description":"The number of pods which reached phase Failed.","type":"integer","format":"int32"},"ready":{"description":"The number of pods which have a Ready condition.\n\nThis field is alpha-level. The job controller populates the field when the feature gate JobReadyPods is enabled (disabled by default).","type":"integer","format":"int32"},"startTime":{"description":"Represents time when the job controller started processing a job. When a Job is created in the suspended state, this field is not set until the first time it is resumed. This field is reset every time a Job is resumed from suspension. It is represented in RFC3339 form and is in UTC.","$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time"},"succeeded":{"description":"The number of pods which reached phase Succeeded.","type":"integer","format":"int32"},"uncountedTerminatedPods":{"description":"UncountedTerminatedPods holds the UIDs of Pods that have terminated but the job controller hasn't yet accounted for in the status counters.\n\nThe job controller creates pods with a finalizer. When a pod terminates (succeeded or failed), the controller does three steps to account for it in the job status: (1) Add the pod UID to the arrays in this field. (2) Remove the pod finalizer. (3) Remove the pod UID from the arrays while increasing the corresponding\n counter.\n\nThis field is beta-level. The job controller only makes use of this field when the feature gate JobTrackingWithFinalizers is enabled (enabled by default). Old jobs might not be tracked using this field, in which case the field remains null.","$ref":"#/components/schemas/io.k8s.api.batch.v1.UncountedTerminatedPods"}}},"io.k8s.api.batch.v1.JobTemplateSpec":{"description":"JobTemplateSpec describes the data a Job should have when created from a template","type":"object","properties":{"metadata":{"description":"Standard object's metadata of the jobs created from this template. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata","default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"},"spec":{"description":"Specification of the desired behavior of the job. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status","default":{},"$ref":"#/components/schemas/io.k8s.api.batch.v1.JobSpec"}}},"io.k8s.api.batch.v1.UncountedTerminatedPods":{"description":"UncountedTerminatedPods holds UIDs of Pods that have terminated but haven't been accounted in Job status counters.","type":"object","properties":{"failed":{"description":"Failed holds UIDs of failed Pods.","type":"array","items":{"type":"string","default":""},"x-kubernetes-list-type":"set"},"succeeded":{"description":"Succeeded holds UIDs of succeeded Pods.","type":"array","items":{"type":"string","default":""},"x-kubernetes-list-type":"set"}}},"io.k8s.api.core.v1.AWSElasticBlockStoreVolumeSource":{"description":"Represents a Persistent Disk resource in AWS.\n\nAn AWS EBS disk must exist before mounting to a container. The disk must also be in the same AWS zone as the kubelet. An AWS EBS disk can only be mounted as read/write once. AWS EBS volumes support ownership management and SELinux relabeling.","type":"object","required":["volumeID"],"properties":{"fsType":{"description":"fsType is the filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore","type":"string"},"partition":{"description":"partition is the partition in the volume that you want to mount. If omitted, the default is to mount by volume name. Examples: For volume /dev/sda1, you specify the partition as \"1\". Similarly, the volume partition for /dev/sda is \"0\" (or you can leave the property empty).","type":"integer","format":"int32"},"readOnly":{"description":"readOnly value true will force the readOnly setting in VolumeMounts. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore","type":"boolean"},"volumeID":{"description":"volumeID is unique ID of the persistent disk resource in AWS (Amazon EBS volume). More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore","type":"string","default":""}}},"io.k8s.api.core.v1.Affinity":{"description":"Affinity is a group of affinity scheduling rules.","type":"object","properties":{"nodeAffinity":{"description":"Describes node affinity scheduling rules for the pod.","$ref":"#/components/schemas/io.k8s.api.core.v1.NodeAffinity"},"podAffinity":{"description":"Describes pod affinity scheduling rules (e.g. co-locate this pod in the same node, zone, etc. as some other pod(s)).","$ref":"#/components/schemas/io.k8s.api.core.v1.PodAffinity"},"podAntiAffinity":{"description":"Describes pod anti-affinity scheduling rules (e.g. avoid putting this pod in the same node, zone, etc. as some other pod(s)).","$ref":"#/components/schemas/io.k8s.api.core.v1.PodAntiAffinity"}}},"io.k8s.api.core.v1.AzureDiskVolumeSource":{"description":"AzureDisk represents an Azure Data Disk mount on the host and bind mount to the pod.","type":"object","required":["diskName","diskURI"],"properties":{"cachingMode":{"description":"cachingMode is the Host Caching mode: None, Read Only, Read Write.","type":"string"},"diskName":{"description":"diskName is the Name of the data disk in the blob storage","type":"string","default":""},"diskURI":{"description":"diskURI is the URI of data disk in the blob storage","type":"string","default":""},"fsType":{"description":"fsType is Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.","type":"string"},"kind":{"description":"kind expected values are Shared: multiple blob disks per storage account Dedicated: single blob disk per storage account Managed: azure managed data disk (only in managed availability set). defaults to shared","type":"string"},"readOnly":{"description":"readOnly Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.","type":"boolean"}}},"io.k8s.api.core.v1.AzureFileVolumeSource":{"description":"AzureFile represents an Azure File Service mount on the host and bind mount to the pod.","type":"object","required":["secretName","shareName"],"properties":{"readOnly":{"description":"readOnly defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.","type":"boolean"},"secretName":{"description":"secretName is the name of secret that contains Azure Storage Account Name and Key","type":"string","default":""},"shareName":{"description":"shareName is the azure share Name","type":"string","default":""}}},"io.k8s.api.core.v1.CSIVolumeSource":{"description":"Represents a source location of a volume to mount, managed by an external CSI driver","type":"object","required":["driver"],"properties":{"driver":{"description":"driver is the name of the CSI driver that handles this volume. Consult with your admin for the correct name as registered in the cluster.","type":"string","default":""},"fsType":{"description":"fsType to mount. Ex. \"ext4\", \"xfs\", \"ntfs\". If not provided, the empty value is passed to the associated CSI driver which will determine the default filesystem to apply.","type":"string"},"nodePublishSecretRef":{"description":"nodePublishSecretRef is a reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI NodePublishVolume and NodeUnpublishVolume calls. This field is optional, and may be empty if no secret is required. If the secret object contains more than one secret, all secret references are passed.","$ref":"#/components/schemas/io.k8s.api.core.v1.LocalObjectReference"},"readOnly":{"description":"readOnly specifies a read-only configuration for the volume. Defaults to false (read/write).","type":"boolean"},"volumeAttributes":{"description":"volumeAttributes stores driver-specific properties that are passed to the CSI driver. Consult your driver's documentation for supported values.","type":"object","additionalProperties":{"type":"string","default":""}}}},"io.k8s.api.core.v1.Capabilities":{"description":"Adds and removes POSIX capabilities from running containers.","type":"object","properties":{"add":{"description":"Added capabilities","type":"array","items":{"type":"string","default":""}},"drop":{"description":"Removed capabilities","type":"array","items":{"type":"string","default":""}}}},"io.k8s.api.core.v1.CephFSVolumeSource":{"description":"Represents a Ceph Filesystem mount that lasts the lifetime of a pod Cephfs volumes do not support ownership management or SELinux relabeling.","type":"object","required":["monitors"],"properties":{"monitors":{"description":"monitors is Required: Monitors is a collection of Ceph monitors More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it","type":"array","items":{"type":"string","default":""}},"path":{"description":"path is Optional: Used as the mounted root, rather than the full Ceph tree, default is /","type":"string"},"readOnly":{"description":"readOnly is Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it","type":"boolean"},"secretFile":{"description":"secretFile is Optional: SecretFile is the path to key ring for User, default is /etc/ceph/user.secret More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it","type":"string"},"secretRef":{"description":"secretRef is Optional: SecretRef is reference to the authentication secret for User, default is empty. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it","$ref":"#/components/schemas/io.k8s.api.core.v1.LocalObjectReference"},"user":{"description":"user is optional: User is the rados user name, default is admin More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it","type":"string"}}},"io.k8s.api.core.v1.CinderVolumeSource":{"description":"Represents a cinder volume resource in Openstack. A Cinder volume must exist before mounting to a container. The volume must also be in the same region as the kubelet. Cinder volumes support ownership management and SELinux relabeling.","type":"object","required":["volumeID"],"properties":{"fsType":{"description":"fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://examples.k8s.io/mysql-cinder-pd/README.md","type":"string"},"readOnly":{"description":"readOnly defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. More info: https://examples.k8s.io/mysql-cinder-pd/README.md","type":"boolean"},"secretRef":{"description":"secretRef is optional: points to a secret object containing parameters used to connect to OpenStack.","$ref":"#/components/schemas/io.k8s.api.core.v1.LocalObjectReference"},"volumeID":{"description":"volumeID used to identify the volume in cinder. More info: https://examples.k8s.io/mysql-cinder-pd/README.md","type":"string","default":""}}},"io.k8s.api.core.v1.ConfigMapEnvSource":{"description":"ConfigMapEnvSource selects a ConfigMap to populate the environment variables with.\n\nThe contents of the target ConfigMap's Data field will represent the key-value pairs as environment variables.","type":"object","properties":{"name":{"description":"Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names","type":"string"},"optional":{"description":"Specify whether the ConfigMap must be defined","type":"boolean"}}},"io.k8s.api.core.v1.ConfigMapKeySelector":{"description":"Selects a key from a ConfigMap.","type":"object","required":["key"],"properties":{"key":{"description":"The key to select.","type":"string","default":""},"name":{"description":"Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names","type":"string"},"optional":{"description":"Specify whether the ConfigMap or its key must be defined","type":"boolean"}},"x-kubernetes-map-type":"atomic"},"io.k8s.api.core.v1.ConfigMapProjection":{"description":"Adapts a ConfigMap into a projected volume.\n\nThe contents of the target ConfigMap's Data field will be presented in a projected volume as files using the keys in the Data field as the file names, unless the items element is populated with specific mappings of keys to paths. Note that this is identical to a configmap volume source without the default mode.","type":"object","properties":{"items":{"description":"items if unspecified, each key-value pair in the Data field of the referenced ConfigMap will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the ConfigMap, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.KeyToPath"}},"name":{"description":"Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names","type":"string"},"optional":{"description":"optional specify whether the ConfigMap or its keys must be defined","type":"boolean"}}},"io.k8s.api.core.v1.ConfigMapVolumeSource":{"description":"Adapts a ConfigMap into a volume.\n\nThe contents of the target ConfigMap's Data field will be presented in a volume as files using the keys in the Data field as the file names, unless the items element is populated with specific mappings of keys to paths. ConfigMap volumes support ownership management and SELinux relabeling.","type":"object","properties":{"defaultMode":{"description":"defaultMode is optional: mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.","type":"integer","format":"int32"},"items":{"description":"items if unspecified, each key-value pair in the Data field of the referenced ConfigMap will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the ConfigMap, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.KeyToPath"}},"name":{"description":"Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names","type":"string"},"optional":{"description":"optional specify whether the ConfigMap or its keys must be defined","type":"boolean"}}},"io.k8s.api.core.v1.Container":{"description":"A single application container that you want to run within a pod.","type":"object","required":["name"],"properties":{"args":{"description":"Arguments to the entrypoint. The container image's CMD is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \"$$(VAR_NAME)\" will produce the string literal \"$(VAR_NAME)\". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell","type":"array","items":{"type":"string","default":""}},"command":{"description":"Entrypoint array. Not executed within a shell. The container image's ENTRYPOINT is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \"$$(VAR_NAME)\" will produce the string literal \"$(VAR_NAME)\". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell","type":"array","items":{"type":"string","default":""}},"env":{"description":"List of environment variables to set in the container. Cannot be updated.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.EnvVar"},"x-kubernetes-patch-merge-key":"name","x-kubernetes-patch-strategy":"merge"},"envFrom":{"description":"List of sources to populate environment variables in the container. The keys defined within a source must be a C_IDENTIFIER. All invalid keys will be reported as an event when the container is starting. When a key exists in multiple sources, the value associated with the last source will take precedence. Values defined by an Env with a duplicate key will take precedence. Cannot be updated.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.EnvFromSource"}},"image":{"description":"Container image name. More info: https://kubernetes.io/docs/concepts/containers/images This field is optional to allow higher level config management to default or override container images in workload controllers like Deployments and StatefulSets.","type":"string"},"imagePullPolicy":{"description":"Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. Cannot be updated. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images\n\n","type":"string"},"lifecycle":{"description":"Actions that the management system should take in response to container lifecycle events. Cannot be updated.","$ref":"#/components/schemas/io.k8s.api.core.v1.Lifecycle"},"livenessProbe":{"description":"Periodic probe of container liveness. Container will be restarted if the probe fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes","$ref":"#/components/schemas/io.k8s.api.core.v1.Probe"},"name":{"description":"Name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated.","type":"string","default":""},"ports":{"description":"List of ports to expose from the container. Exposing a port here gives the system additional information about the network connections a container uses, but is primarily informational. Not specifying a port here DOES NOT prevent that port from being exposed. Any port which is listening on the default \"0.0.0.0\" address inside a container will be accessible from the network. Cannot be updated.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.ContainerPort"},"x-kubernetes-list-map-keys":["containerPort","protocol"],"x-kubernetes-list-type":"map","x-kubernetes-patch-merge-key":"containerPort","x-kubernetes-patch-strategy":"merge"},"readinessProbe":{"description":"Periodic probe of container service readiness. Container will be removed from service endpoints if the probe fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes","$ref":"#/components/schemas/io.k8s.api.core.v1.Probe"},"resources":{"description":"Compute Resources required by this container. Cannot be updated. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/","default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.ResourceRequirements"},"securityContext":{"description":"SecurityContext defines the security options the container should be run with. If set, the fields of SecurityContext override the equivalent fields of PodSecurityContext. More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/","$ref":"#/components/schemas/io.k8s.api.core.v1.SecurityContext"},"startupProbe":{"description":"StartupProbe indicates that the Pod has successfully initialized. If specified, no other probes are executed until this completes successfully. If this probe fails, the Pod will be restarted, just as if the livenessProbe failed. This can be used to provide different probe parameters at the beginning of a Pod's lifecycle, when it might take a long time to load data or warm a cache, than during steady-state operation. This cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes","$ref":"#/components/schemas/io.k8s.api.core.v1.Probe"},"stdin":{"description":"Whether this container should allocate a buffer for stdin in the container runtime. If this is not set, reads from stdin in the container will always result in EOF. Default is false.","type":"boolean"},"stdinOnce":{"description":"Whether the container runtime should close the stdin channel after it has been opened by a single attach. When stdin is true the stdin stream will remain open across multiple attach sessions. If stdinOnce is set to true, stdin is opened on container start, is empty until the first client attaches to stdin, and then remains open and accepts data until the client disconnects, at which time stdin is closed and remains closed until the container is restarted. If this flag is false, a container processes that reads from stdin will never receive an EOF. Default is false","type":"boolean"},"terminationMessagePath":{"description":"Optional: Path at which the file to which the container's termination message will be written is mounted into the container's filesystem. Message written is intended to be brief final status, such as an assertion failure message. Will be truncated by the node if greater than 4096 bytes. The total message length across all containers will be limited to 12kb. Defaults to /dev/termination-log. Cannot be updated.","type":"string"},"terminationMessagePolicy":{"description":"Indicate how the termination message should be populated. File will use the contents of terminationMessagePath to populate the container status message on both success and failure. FallbackToLogsOnError will use the last chunk of container log output if the termination message file is empty and the container exited with an error. The log output is limited to 2048 bytes or 80 lines, whichever is smaller. Defaults to File. Cannot be updated.\n\n","type":"string"},"tty":{"description":"Whether this container should allocate a TTY for itself, also requires 'stdin' to be true. Default is false.","type":"boolean"},"volumeDevices":{"description":"volumeDevices is the list of block devices to be used by the container.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.VolumeDevice"},"x-kubernetes-patch-merge-key":"devicePath","x-kubernetes-patch-strategy":"merge"},"volumeMounts":{"description":"Pod volumes to mount into the container's filesystem. Cannot be updated.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.VolumeMount"},"x-kubernetes-patch-merge-key":"mountPath","x-kubernetes-patch-strategy":"merge"},"workingDir":{"description":"Container's working directory. If not specified, the container runtime's default will be used, which might be configured in the container image. Cannot be updated.","type":"string"}}},"io.k8s.api.core.v1.ContainerPort":{"description":"ContainerPort represents a network port in a single container.","type":"object","required":["containerPort"],"properties":{"containerPort":{"description":"Number of port to expose on the pod's IP address. This must be a valid port number, 0 \u003c x \u003c 65536.","type":"integer","format":"int32","default":0},"hostIP":{"description":"What host IP to bind the external port to.","type":"string"},"hostPort":{"description":"Number of port to expose on the host. If specified, this must be a valid port number, 0 \u003c x \u003c 65536. If HostNetwork is specified, this must match ContainerPort. Most containers do not need this.","type":"integer","format":"int32"},"name":{"description":"If specified, this must be an IANA_SVC_NAME and unique within the pod. Each named port in a pod must have a unique name. Name for the port that can be referred to by services.","type":"string"},"protocol":{"description":"Protocol for port. Must be UDP, TCP, or SCTP. Defaults to \"TCP\".\n\n","type":"string","default":"TCP"}}},"io.k8s.api.core.v1.DownwardAPIProjection":{"description":"Represents downward API info for projecting into a projected volume. Note that this is identical to a downwardAPI volume source without the default mode.","type":"object","properties":{"items":{"description":"Items is a list of DownwardAPIVolume file","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.DownwardAPIVolumeFile"}}}},"io.k8s.api.core.v1.DownwardAPIVolumeFile":{"description":"DownwardAPIVolumeFile represents information to create the file containing the pod field","type":"object","required":["path"],"properties":{"fieldRef":{"description":"Required: Selects a field of the pod: only annotations, labels, name and namespace are supported.","$ref":"#/components/schemas/io.k8s.api.core.v1.ObjectFieldSelector"},"mode":{"description":"Optional: mode bits used to set permissions on this file, must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.","type":"integer","format":"int32"},"path":{"description":"Required: Path is the relative path name of the file to be created. Must not be absolute or contain the '..' path. Must be utf-8 encoded. The first item of the relative path must not start with '..'","type":"string","default":""},"resourceFieldRef":{"description":"Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported.","$ref":"#/components/schemas/io.k8s.api.core.v1.ResourceFieldSelector"}}},"io.k8s.api.core.v1.DownwardAPIVolumeSource":{"description":"DownwardAPIVolumeSource represents a volume containing downward API info. Downward API volumes support ownership management and SELinux relabeling.","type":"object","properties":{"defaultMode":{"description":"Optional: mode bits to use on created files by default. Must be a Optional: mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.","type":"integer","format":"int32"},"items":{"description":"Items is a list of downward API volume file","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.DownwardAPIVolumeFile"}}}},"io.k8s.api.core.v1.EmptyDirVolumeSource":{"description":"Represents an empty directory for a pod. Empty directory volumes support ownership management and SELinux relabeling.","type":"object","properties":{"medium":{"description":"medium represents what type of storage medium should back this directory. The default is \"\" which means to use the node's default medium. Must be an empty string (default) or Memory. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir","type":"string"},"sizeLimit":{"description":"sizeLimit is the total amount of local storage required for this EmptyDir volume. The size limit is also applicable for memory medium. The maximum usage on memory medium EmptyDir would be the minimum value between the SizeLimit specified here and the sum of memory limits of all containers in a pod. The default is nil which means that the limit is undefined. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir","$ref":"#/components/schemas/io.k8s.apimachinery.pkg.api.resource.Quantity"}}},"io.k8s.api.core.v1.EnvFromSource":{"description":"EnvFromSource represents the source of a set of ConfigMaps","type":"object","properties":{"configMapRef":{"description":"The ConfigMap to select from","$ref":"#/components/schemas/io.k8s.api.core.v1.ConfigMapEnvSource"},"prefix":{"description":"An optional identifier to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER.","type":"string"},"secretRef":{"description":"The Secret to select from","$ref":"#/components/schemas/io.k8s.api.core.v1.SecretEnvSource"}}},"io.k8s.api.core.v1.EnvVar":{"description":"EnvVar represents an environment variable present in a Container.","type":"object","required":["name"],"properties":{"name":{"description":"Name of the environment variable. Must be a C_IDENTIFIER.","type":"string","default":""},"value":{"description":"Variable references $(VAR_NAME) are expanded using the previously defined environment variables in the container and any service environment variables. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \"$$(VAR_NAME)\" will produce the string literal \"$(VAR_NAME)\". Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to \"\".","type":"string"},"valueFrom":{"description":"Source for the environment variable's value. Cannot be used if value is not empty.","$ref":"#/components/schemas/io.k8s.api.core.v1.EnvVarSource"}}},"io.k8s.api.core.v1.EnvVarSource":{"description":"EnvVarSource represents a source for the value of an EnvVar.","type":"object","properties":{"configMapKeyRef":{"description":"Selects a key of a ConfigMap.","$ref":"#/components/schemas/io.k8s.api.core.v1.ConfigMapKeySelector"},"fieldRef":{"description":"Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['\u003cKEY\u003e']`, `metadata.annotations['\u003cKEY\u003e']`, spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.","$ref":"#/components/schemas/io.k8s.api.core.v1.ObjectFieldSelector"},"resourceFieldRef":{"description":"Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.","$ref":"#/components/schemas/io.k8s.api.core.v1.ResourceFieldSelector"},"secretKeyRef":{"description":"Selects a key of a secret in the pod's namespace","$ref":"#/components/schemas/io.k8s.api.core.v1.SecretKeySelector"}}},"io.k8s.api.core.v1.EphemeralContainer":{"description":"An EphemeralContainer is a temporary container that you may add to an existing Pod for user-initiated activities such as debugging. Ephemeral containers have no resource or scheduling guarantees, and they will not be restarted when they exit or when a Pod is removed or restarted. The kubelet may evict a Pod if an ephemeral container causes the Pod to exceed its resource allocation.\n\nTo add an ephemeral container, use the ephemeralcontainers subresource of an existing Pod. Ephemeral containers may not be removed or restarted.","type":"object","required":["name"],"properties":{"args":{"description":"Arguments to the entrypoint. The image's CMD is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \"$$(VAR_NAME)\" will produce the string literal \"$(VAR_NAME)\". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell","type":"array","items":{"type":"string","default":""}},"command":{"description":"Entrypoint array. Not executed within a shell. The image's ENTRYPOINT is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \"$$(VAR_NAME)\" will produce the string literal \"$(VAR_NAME)\". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell","type":"array","items":{"type":"string","default":""}},"env":{"description":"List of environment variables to set in the container. Cannot be updated.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.EnvVar"},"x-kubernetes-patch-merge-key":"name","x-kubernetes-patch-strategy":"merge"},"envFrom":{"description":"List of sources to populate environment variables in the container. The keys defined within a source must be a C_IDENTIFIER. All invalid keys will be reported as an event when the container is starting. When a key exists in multiple sources, the value associated with the last source will take precedence. Values defined by an Env with a duplicate key will take precedence. Cannot be updated.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.EnvFromSource"}},"image":{"description":"Container image name. More info: https://kubernetes.io/docs/concepts/containers/images","type":"string"},"imagePullPolicy":{"description":"Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. Cannot be updated. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images\n\n","type":"string"},"lifecycle":{"description":"Lifecycle is not allowed for ephemeral containers.","$ref":"#/components/schemas/io.k8s.api.core.v1.Lifecycle"},"livenessProbe":{"description":"Probes are not allowed for ephemeral containers.","$ref":"#/components/schemas/io.k8s.api.core.v1.Probe"},"name":{"description":"Name of the ephemeral container specified as a DNS_LABEL. This name must be unique among all containers, init containers and ephemeral containers.","type":"string","default":""},"ports":{"description":"Ports are not allowed for ephemeral containers.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.ContainerPort"},"x-kubernetes-list-map-keys":["containerPort","protocol"],"x-kubernetes-list-type":"map","x-kubernetes-patch-merge-key":"containerPort","x-kubernetes-patch-strategy":"merge"},"readinessProbe":{"description":"Probes are not allowed for ephemeral containers.","$ref":"#/components/schemas/io.k8s.api.core.v1.Probe"},"resources":{"description":"Resources are not allowed for ephemeral containers. Ephemeral containers use spare resources already allocated to the pod.","default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.ResourceRequirements"},"securityContext":{"description":"Optional: SecurityContext defines the security options the ephemeral container should be run with. If set, the fields of SecurityContext override the equivalent fields of PodSecurityContext.","$ref":"#/components/schemas/io.k8s.api.core.v1.SecurityContext"},"startupProbe":{"description":"Probes are not allowed for ephemeral containers.","$ref":"#/components/schemas/io.k8s.api.core.v1.Probe"},"stdin":{"description":"Whether this container should allocate a buffer for stdin in the container runtime. If this is not set, reads from stdin in the container will always result in EOF. Default is false.","type":"boolean"},"stdinOnce":{"description":"Whether the container runtime should close the stdin channel after it has been opened by a single attach. When stdin is true the stdin stream will remain open across multiple attach sessions. If stdinOnce is set to true, stdin is opened on container start, is empty until the first client attaches to stdin, and then remains open and accepts data until the client disconnects, at which time stdin is closed and remains closed until the container is restarted. If this flag is false, a container processes that reads from stdin will never receive an EOF. Default is false","type":"boolean"},"targetContainerName":{"description":"If set, the name of the container from PodSpec that this ephemeral container targets. The ephemeral container will be run in the namespaces (IPC, PID, etc) of this container. If not set then the ephemeral container uses the namespaces configured in the Pod spec.\n\nThe container runtime must implement support for this feature. If the runtime does not support namespace targeting then the result of setting this field is undefined.","type":"string"},"terminationMessagePath":{"description":"Optional: Path at which the file to which the container's termination message will be written is mounted into the container's filesystem. Message written is intended to be brief final status, such as an assertion failure message. Will be truncated by the node if greater than 4096 bytes. The total message length across all containers will be limited to 12kb. Defaults to /dev/termination-log. Cannot be updated.","type":"string"},"terminationMessagePolicy":{"description":"Indicate how the termination message should be populated. File will use the contents of terminationMessagePath to populate the container status message on both success and failure. FallbackToLogsOnError will use the last chunk of container log output if the termination message file is empty and the container exited with an error. The log output is limited to 2048 bytes or 80 lines, whichever is smaller. Defaults to File. Cannot be updated.\n\n","type":"string"},"tty":{"description":"Whether this container should allocate a TTY for itself, also requires 'stdin' to be true. Default is false.","type":"boolean"},"volumeDevices":{"description":"volumeDevices is the list of block devices to be used by the container.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.VolumeDevice"},"x-kubernetes-patch-merge-key":"devicePath","x-kubernetes-patch-strategy":"merge"},"volumeMounts":{"description":"Pod volumes to mount into the container's filesystem. Subpath mounts are not allowed for ephemeral containers. Cannot be updated.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.VolumeMount"},"x-kubernetes-patch-merge-key":"mountPath","x-kubernetes-patch-strategy":"merge"},"workingDir":{"description":"Container's working directory. If not specified, the container runtime's default will be used, which might be configured in the container image. Cannot be updated.","type":"string"}}},"io.k8s.api.core.v1.EphemeralVolumeSource":{"description":"Represents an ephemeral volume that is handled by a normal storage driver.","type":"object","properties":{"volumeClaimTemplate":{"description":"Will be used to create a stand-alone PVC to provision the volume. The pod in which this EphemeralVolumeSource is embedded will be the owner of the PVC, i.e. the PVC will be deleted together with the pod. The name of the PVC will be `\u003cpod name\u003e-\u003cvolume name\u003e` where `\u003cvolume name\u003e` is the name from the `PodSpec.Volumes` array entry. Pod validation will reject the pod if the concatenated name is not valid for a PVC (for example, too long).\n\nAn existing PVC with that name that is not owned by the pod will *not* be used for the pod to avoid using an unrelated volume by mistake. Starting the pod is then blocked until the unrelated PVC is removed. If such a pre-created PVC is meant to be used by the pod, the PVC has to updated with an owner reference to the pod once the pod exists. Normally this should not be necessary, but it may be useful when manually reconstructing a broken cluster.\n\nThis field is read-only and no changes will be made by Kubernetes to the PVC after it has been created.\n\nRequired, must not be nil.","$ref":"#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaimTemplate"}}},"io.k8s.api.core.v1.ExecAction":{"description":"ExecAction describes a \"run in container\" action.","type":"object","properties":{"command":{"description":"Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is simply exec'd, it is not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy.","type":"array","items":{"type":"string","default":""}}}},"io.k8s.api.core.v1.FCVolumeSource":{"description":"Represents a Fibre Channel volume. Fibre Channel volumes can only be mounted as read/write once. Fibre Channel volumes support ownership management and SELinux relabeling.","type":"object","properties":{"fsType":{"description":"fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.","type":"string"},"lun":{"description":"lun is Optional: FC target lun number","type":"integer","format":"int32"},"readOnly":{"description":"readOnly is Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.","type":"boolean"},"targetWWNs":{"description":"targetWWNs is Optional: FC target worldwide names (WWNs)","type":"array","items":{"type":"string","default":""}},"wwids":{"description":"wwids Optional: FC volume world wide identifiers (wwids) Either wwids or combination of targetWWNs and lun must be set, but not both simultaneously.","type":"array","items":{"type":"string","default":""}}}},"io.k8s.api.core.v1.FlexVolumeSource":{"description":"FlexVolume represents a generic volume resource that is provisioned/attached using an exec based plugin.","type":"object","required":["driver"],"properties":{"driver":{"description":"driver is the name of the driver to use for this volume.","type":"string","default":""},"fsType":{"description":"fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". The default filesystem depends on FlexVolume script.","type":"string"},"options":{"description":"options is Optional: this field holds extra command options if any.","type":"object","additionalProperties":{"type":"string","default":""}},"readOnly":{"description":"readOnly is Optional: defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.","type":"boolean"},"secretRef":{"description":"secretRef is Optional: secretRef is reference to the secret object containing sensitive information to pass to the plugin scripts. This may be empty if no secret object is specified. If the secret object contains more than one secret, all secrets are passed to the plugin scripts.","$ref":"#/components/schemas/io.k8s.api.core.v1.LocalObjectReference"}}},"io.k8s.api.core.v1.FlockerVolumeSource":{"description":"Represents a Flocker volume mounted by the Flocker agent. One and only one of datasetName and datasetUUID should be set. Flocker volumes do not support ownership management or SELinux relabeling.","type":"object","properties":{"datasetName":{"description":"datasetName is Name of the dataset stored as metadata -\u003e name on the dataset for Flocker should be considered as deprecated","type":"string"},"datasetUUID":{"description":"datasetUUID is the UUID of the dataset. This is unique identifier of a Flocker dataset","type":"string"}}},"io.k8s.api.core.v1.GCEPersistentDiskVolumeSource":{"description":"Represents a Persistent Disk resource in Google Compute Engine.\n\nA GCE PD must exist before mounting to a container. The disk must also be in the same GCE project and zone as the kubelet. A GCE PD can only be mounted as read/write once or read-only many times. GCE PDs support ownership management and SELinux relabeling.","type":"object","required":["pdName"],"properties":{"fsType":{"description":"fsType is filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk","type":"string"},"partition":{"description":"partition is the partition in the volume that you want to mount. If omitted, the default is to mount by volume name. Examples: For volume /dev/sda1, you specify the partition as \"1\". Similarly, the volume partition for /dev/sda is \"0\" (or you can leave the property empty). More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk","type":"integer","format":"int32"},"pdName":{"description":"pdName is unique name of the PD resource in GCE. Used to identify the disk in GCE. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk","type":"string","default":""},"readOnly":{"description":"readOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk","type":"boolean"}}},"io.k8s.api.core.v1.GRPCAction":{"type":"object","required":["port"],"properties":{"port":{"description":"Port number of the gRPC service. Number must be in the range 1 to 65535.","type":"integer","format":"int32","default":0},"service":{"description":"Service is the name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md).\n\nIf this is not specified, the default behavior is defined by gRPC.","type":"string","default":""}}},"io.k8s.api.core.v1.GitRepoVolumeSource":{"description":"Represents a volume that is populated with the contents of a git repository. Git repo volumes do not support ownership management. Git repo volumes support SELinux relabeling.\n\nDEPRECATED: GitRepo is deprecated. To provision a container with a git repo, mount an EmptyDir into an InitContainer that clones the repo using git, then mount the EmptyDir into the Pod's container.","type":"object","required":["repository"],"properties":{"directory":{"description":"directory is the target directory name. Must not contain or start with '..'. If '.' is supplied, the volume directory will be the git repository. Otherwise, if specified, the volume will contain the git repository in the subdirectory with the given name.","type":"string"},"repository":{"description":"repository is the URL","type":"string","default":""},"revision":{"description":"revision is the commit hash for the specified revision.","type":"string"}}},"io.k8s.api.core.v1.GlusterfsVolumeSource":{"description":"Represents a Glusterfs mount that lasts the lifetime of a pod. Glusterfs volumes do not support ownership management or SELinux relabeling.","type":"object","required":["endpoints","path"],"properties":{"endpoints":{"description":"endpoints is the endpoint name that details Glusterfs topology. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod","type":"string","default":""},"path":{"description":"path is the Glusterfs volume path. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod","type":"string","default":""},"readOnly":{"description":"readOnly here will force the Glusterfs volume to be mounted with read-only permissions. Defaults to false. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod","type":"boolean"}}},"io.k8s.api.core.v1.HTTPGetAction":{"description":"HTTPGetAction describes an action based on HTTP Get requests.","type":"object","required":["port"],"properties":{"host":{"description":"Host name to connect to, defaults to the pod IP. You probably want to set \"Host\" in httpHeaders instead.","type":"string"},"httpHeaders":{"description":"Custom headers to set in the request. HTTP allows repeated headers.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.HTTPHeader"}},"path":{"description":"Path to access on the HTTP server.","type":"string"},"port":{"description":"Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME.","default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.util.intstr.IntOrString"},"scheme":{"description":"Scheme to use for connecting to the host. Defaults to HTTP.\n\n","type":"string"}}},"io.k8s.api.core.v1.HTTPHeader":{"description":"HTTPHeader describes a custom header to be used in HTTP probes","type":"object","required":["name","value"],"properties":{"name":{"description":"The header field name","type":"string","default":""},"value":{"description":"The header field value","type":"string","default":""}}},"io.k8s.api.core.v1.HostAlias":{"description":"HostAlias holds the mapping between IP and hostnames that will be injected as an entry in the pod's hosts file.","type":"object","properties":{"hostnames":{"description":"Hostnames for the above IP address.","type":"array","items":{"type":"string","default":""}},"ip":{"description":"IP address of the host file entry.","type":"string"}}},"io.k8s.api.core.v1.HostPathVolumeSource":{"description":"Represents a host path mapped into a pod. Host path volumes do not support ownership management or SELinux relabeling.","type":"object","required":["path"],"properties":{"path":{"description":"path of the directory on the host. If the path is a symlink, it will follow the link to the real path. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath","type":"string","default":""},"type":{"description":"type for HostPath Volume Defaults to \"\" More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath","type":"string"}}},"io.k8s.api.core.v1.ISCSIVolumeSource":{"description":"Represents an ISCSI disk. ISCSI volumes can only be mounted as read/write once. ISCSI volumes support ownership management and SELinux relabeling.","type":"object","required":["targetPortal","iqn","lun"],"properties":{"chapAuthDiscovery":{"description":"chapAuthDiscovery defines whether support iSCSI Discovery CHAP authentication","type":"boolean"},"chapAuthSession":{"description":"chapAuthSession defines whether support iSCSI Session CHAP authentication","type":"boolean"},"fsType":{"description":"fsType is the filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#iscsi","type":"string"},"initiatorName":{"description":"initiatorName is the custom iSCSI Initiator Name. If initiatorName is specified with iscsiInterface simultaneously, new iSCSI interface \u003ctarget portal\u003e:\u003cvolume name\u003e will be created for the connection.","type":"string"},"iqn":{"description":"iqn is the target iSCSI Qualified Name.","type":"string","default":""},"iscsiInterface":{"description":"iscsiInterface is the interface Name that uses an iSCSI transport. Defaults to 'default' (tcp).","type":"string"},"lun":{"description":"lun represents iSCSI Target Lun number.","type":"integer","format":"int32","default":0},"portals":{"description":"portals is the iSCSI Target Portal List. The portal is either an IP or ip_addr:port if the port is other than default (typically TCP ports 860 and 3260).","type":"array","items":{"type":"string","default":""}},"readOnly":{"description":"readOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false.","type":"boolean"},"secretRef":{"description":"secretRef is the CHAP Secret for iSCSI target and initiator authentication","$ref":"#/components/schemas/io.k8s.api.core.v1.LocalObjectReference"},"targetPortal":{"description":"targetPortal is iSCSI Target Portal. The Portal is either an IP or ip_addr:port if the port is other than default (typically TCP ports 860 and 3260).","type":"string","default":""}}},"io.k8s.api.core.v1.KeyToPath":{"description":"Maps a string key to a path within a volume.","type":"object","required":["key","path"],"properties":{"key":{"description":"key is the key to project.","type":"string","default":""},"mode":{"description":"mode is Optional: mode bits used to set permissions on this file. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.","type":"integer","format":"int32"},"path":{"description":"path is the relative path of the file to map the key to. May not be an absolute path. May not contain the path element '..'. May not start with the string '..'.","type":"string","default":""}}},"io.k8s.api.core.v1.Lifecycle":{"description":"Lifecycle describes actions that the management system should take in response to container lifecycle events. For the PostStart and PreStop lifecycle handlers, management of the container blocks until the action is complete, unless the container process fails, in which case the handler is aborted.","type":"object","properties":{"postStart":{"description":"PostStart is called immediately after a container is created. If the handler fails, the container is terminated and restarted according to its restart policy. Other management of the container blocks until the hook completes. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks","$ref":"#/components/schemas/io.k8s.api.core.v1.LifecycleHandler"},"preStop":{"description":"PreStop is called immediately before a container is terminated due to an API request or management event such as liveness/startup probe failure, preemption, resource contention, etc. The handler is not called if the container crashes or exits. The Pod's termination grace period countdown begins before the PreStop hook is executed. Regardless of the outcome of the handler, the container will eventually terminate within the Pod's termination grace period (unless delayed by finalizers). Other management of the container blocks until the hook completes or until the termination grace period is reached. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks","$ref":"#/components/schemas/io.k8s.api.core.v1.LifecycleHandler"}}},"io.k8s.api.core.v1.LifecycleHandler":{"description":"LifecycleHandler defines a specific action that should be taken in a lifecycle hook. One and only one of the fields, except TCPSocket must be specified.","type":"object","properties":{"exec":{"description":"Exec specifies the action to take.","$ref":"#/components/schemas/io.k8s.api.core.v1.ExecAction"},"httpGet":{"description":"HTTPGet specifies the http request to perform.","$ref":"#/components/schemas/io.k8s.api.core.v1.HTTPGetAction"},"tcpSocket":{"description":"Deprecated. TCPSocket is NOT supported as a LifecycleHandler and kept for the backward compatibility. There are no validation of this field and lifecycle hooks will fail in runtime when tcp handler is specified.","$ref":"#/components/schemas/io.k8s.api.core.v1.TCPSocketAction"}}},"io.k8s.api.core.v1.LocalObjectReference":{"description":"LocalObjectReference contains enough information to let you locate the referenced object inside the same namespace.","type":"object","properties":{"name":{"description":"Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names","type":"string"}},"x-kubernetes-map-type":"atomic"},"io.k8s.api.core.v1.NFSVolumeSource":{"description":"Represents an NFS mount that lasts the lifetime of a pod. NFS volumes do not support ownership management or SELinux relabeling.","type":"object","required":["server","path"],"properties":{"path":{"description":"path that is exported by the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs","type":"string","default":""},"readOnly":{"description":"readOnly here will force the NFS export to be mounted with read-only permissions. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs","type":"boolean"},"server":{"description":"server is the hostname or IP address of the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs","type":"string","default":""}}},"io.k8s.api.core.v1.NodeAffinity":{"description":"Node affinity is a group of node affinity scheduling rules.","type":"object","properties":{"preferredDuringSchedulingIgnoredDuringExecution":{"description":"The scheduler will prefer to schedule pods to nodes that satisfy the affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding \"weight\" to the sum if the node matches the corresponding matchExpressions; the node(s) with the highest sum are the most preferred.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.PreferredSchedulingTerm"}},"requiredDuringSchedulingIgnoredDuringExecution":{"description":"If the affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to an update), the system may or may not try to eventually evict the pod from its node.","$ref":"#/components/schemas/io.k8s.api.core.v1.NodeSelector"}}},"io.k8s.api.core.v1.NodeSelector":{"description":"A node selector represents the union of the results of one or more label queries over a set of nodes; that is, it represents the OR of the selectors represented by the node selector terms.","type":"object","required":["nodeSelectorTerms"],"properties":{"nodeSelectorTerms":{"description":"Required. A list of node selector terms. The terms are ORed.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.NodeSelectorTerm"}}},"x-kubernetes-map-type":"atomic"},"io.k8s.api.core.v1.NodeSelectorRequirement":{"description":"A node selector requirement is a selector that contains values, a key, and an operator that relates the key and values.","type":"object","required":["key","operator"],"properties":{"key":{"description":"The label key that the selector applies to.","type":"string","default":""},"operator":{"description":"Represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.\n\n","type":"string","default":""},"values":{"description":"An array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. If the operator is Gt or Lt, the values array must have a single element, which will be interpreted as an integer. This array is replaced during a strategic merge patch.","type":"array","items":{"type":"string","default":""}}}},"io.k8s.api.core.v1.NodeSelectorTerm":{"description":"A null or empty node selector term matches no objects. The requirements of them are ANDed. The TopologySelectorTerm type implements a subset of the NodeSelectorTerm.","type":"object","properties":{"matchExpressions":{"description":"A list of node selector requirements by node's labels.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.NodeSelectorRequirement"}},"matchFields":{"description":"A list of node selector requirements by node's fields.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.NodeSelectorRequirement"}}},"x-kubernetes-map-type":"atomic"},"io.k8s.api.core.v1.ObjectFieldSelector":{"description":"ObjectFieldSelector selects an APIVersioned field of an object.","type":"object","required":["fieldPath"],"properties":{"apiVersion":{"description":"Version of the schema the FieldPath is written in terms of, defaults to \"v1\".","type":"string"},"fieldPath":{"description":"Path of the field to select in the specified API version.","type":"string","default":""}},"x-kubernetes-map-type":"atomic"},"io.k8s.api.core.v1.ObjectReference":{"description":"ObjectReference contains enough information to let you inspect or modify the referred object.","type":"object","properties":{"apiVersion":{"description":"API version of the referent.","type":"string"},"fieldPath":{"description":"If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: \"spec.containers{name}\" (where \"name\" refers to the name of the container that triggered the event) or if no container name is specified \"spec.containers[2]\" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object.","type":"string"},"kind":{"description":"Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds","type":"string"},"name":{"description":"Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names","type":"string"},"namespace":{"description":"Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/","type":"string"},"resourceVersion":{"description":"Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency","type":"string"},"uid":{"description":"UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids","type":"string"}},"x-kubernetes-map-type":"atomic"},"io.k8s.api.core.v1.PersistentVolumeClaimSpec":{"description":"PersistentVolumeClaimSpec describes the common attributes of storage devices and allows a Source for provider-specific attributes","type":"object","properties":{"accessModes":{"description":"accessModes contains the desired access modes the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1","type":"array","items":{"type":"string","default":""}},"dataSource":{"description":"dataSource field can be used to specify either: * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot) * An existing PVC (PersistentVolumeClaim) If the provisioner or an external controller can support the specified data source, it will create a new volume based on the contents of the specified data source. If the AnyVolumeDataSource feature gate is enabled, this field will always have the same contents as the DataSourceRef field.","$ref":"#/components/schemas/io.k8s.api.core.v1.TypedLocalObjectReference"},"dataSourceRef":{"description":"dataSourceRef specifies the object from which to populate the volume with data, if a non-empty volume is desired. This may be any local object from a non-empty API group (non core object) or a PersistentVolumeClaim object. When this field is specified, volume binding will only succeed if the type of the specified object matches some installed volume populator or dynamic provisioner. This field will replace the functionality of the DataSource field and as such if both fields are non-empty, they must have the same value. For backwards compatibility, both fields (DataSource and DataSourceRef) will be set to the same value automatically if one of them is empty and the other is non-empty. There are two important differences between DataSource and DataSourceRef: * While DataSource only allows two specific types of objects, DataSourceRef\n allows any non-core object, as well as PersistentVolumeClaim objects.\n* While DataSource ignores disallowed values (dropping them), DataSourceRef\n preserves all values, and generates an error if a disallowed value is\n specified.\n(Alpha) Using this field requires the AnyVolumeDataSource feature gate to be enabled.","$ref":"#/components/schemas/io.k8s.api.core.v1.TypedLocalObjectReference"},"resources":{"description":"resources represents the minimum resources the volume should have. If RecoverVolumeExpansionFailure feature is enabled users are allowed to specify resource requirements that are lower than previous value but must still be higher than capacity recorded in the status field of the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources","default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.ResourceRequirements"},"selector":{"description":"selector is a label query over volumes to consider for binding.","$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector"},"storageClassName":{"description":"storageClassName is the name of the StorageClass required by the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1","type":"string"},"volumeMode":{"description":"volumeMode defines what type of volume is required by the claim. Value of Filesystem is implied when not included in claim spec.","type":"string"},"volumeName":{"description":"volumeName is the binding reference to the PersistentVolume backing this claim.","type":"string"}}},"io.k8s.api.core.v1.PersistentVolumeClaimTemplate":{"description":"PersistentVolumeClaimTemplate is used to produce PersistentVolumeClaim objects as part of an EphemeralVolumeSource.","type":"object","required":["spec"],"properties":{"metadata":{"description":"May contain labels and annotations that will be copied into the PVC when creating it. No other fields are allowed and will be rejected during validation.","default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"},"spec":{"description":"The specification for the PersistentVolumeClaim. The entire content is copied unchanged into the PVC that gets created from this template. The same fields as in a PersistentVolumeClaim are also valid here.","default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaimSpec"}}},"io.k8s.api.core.v1.PersistentVolumeClaimVolumeSource":{"description":"PersistentVolumeClaimVolumeSource references the user's PVC in the same namespace. This volume finds the bound PV and mounts that volume for the pod. A PersistentVolumeClaimVolumeSource is, essentially, a wrapper around another type of volume that is owned by someone else (the system).","type":"object","required":["claimName"],"properties":{"claimName":{"description":"claimName is the name of a PersistentVolumeClaim in the same namespace as the pod using this volume. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims","type":"string","default":""},"readOnly":{"description":"readOnly Will force the ReadOnly setting in VolumeMounts. Default false.","type":"boolean"}}},"io.k8s.api.core.v1.PhotonPersistentDiskVolumeSource":{"description":"Represents a Photon Controller persistent disk resource.","type":"object","required":["pdID"],"properties":{"fsType":{"description":"fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.","type":"string"},"pdID":{"description":"pdID is the ID that identifies Photon Controller persistent disk","type":"string","default":""}}},"io.k8s.api.core.v1.PodAffinity":{"description":"Pod affinity is a group of inter pod affinity scheduling rules.","type":"object","properties":{"preferredDuringSchedulingIgnoredDuringExecution":{"description":"The scheduler will prefer to schedule pods to nodes that satisfy the affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding \"weight\" to the sum if the node has pods which matches the corresponding podAffinityTerm; the node(s) with the highest sum are the most preferred.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.WeightedPodAffinityTerm"}},"requiredDuringSchedulingIgnoredDuringExecution":{"description":"If the affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to a pod label update), the system may or may not try to eventually evict the pod from its node. When there are multiple elements, the lists of nodes corresponding to each podAffinityTerm are intersected, i.e. all terms must be satisfied.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.PodAffinityTerm"}}}},"io.k8s.api.core.v1.PodAffinityTerm":{"description":"Defines a set of pods (namely those matching the labelSelector relative to the given namespace(s)) that this pod should be co-located (affinity) or not co-located (anti-affinity) with, where co-located is defined as running on a node whose value of the label with key \u003ctopologyKey\u003e matches that of any node on which a pod of the set of pods is running","type":"object","required":["topologyKey"],"properties":{"labelSelector":{"description":"A label query over a set of resources, in this case pods.","$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector"},"namespaceSelector":{"description":"A label query over the set of namespaces that the term applies to. The term is applied to the union of the namespaces selected by this field and the ones listed in the namespaces field. null selector and null or empty namespaces list means \"this pod's namespace\". An empty selector ({}) matches all namespaces. This field is beta-level and is only honored when PodAffinityNamespaceSelector feature is enabled.","$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector"},"namespaces":{"description":"namespaces specifies a static list of namespace names that the term applies to. The term is applied to the union of the namespaces listed in this field and the ones selected by namespaceSelector. null or empty namespaces list and null namespaceSelector means \"this pod's namespace\"","type":"array","items":{"type":"string","default":""}},"topologyKey":{"description":"This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching the labelSelector in the specified namespaces, where co-located is defined as running on a node whose value of the label with key topologyKey matches that of any node on which any of the selected pods is running. Empty topologyKey is not allowed.","type":"string","default":""}}},"io.k8s.api.core.v1.PodAntiAffinity":{"description":"Pod anti affinity is a group of inter pod anti affinity scheduling rules.","type":"object","properties":{"preferredDuringSchedulingIgnoredDuringExecution":{"description":"The scheduler will prefer to schedule pods to nodes that satisfy the anti-affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling anti-affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding \"weight\" to the sum if the node has pods which matches the corresponding podAffinityTerm; the node(s) with the highest sum are the most preferred.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.WeightedPodAffinityTerm"}},"requiredDuringSchedulingIgnoredDuringExecution":{"description":"If the anti-affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the anti-affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to a pod label update), the system may or may not try to eventually evict the pod from its node. When there are multiple elements, the lists of nodes corresponding to each podAffinityTerm are intersected, i.e. all terms must be satisfied.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.PodAffinityTerm"}}}},"io.k8s.api.core.v1.PodDNSConfig":{"description":"PodDNSConfig defines the DNS parameters of a pod in addition to those generated from DNSPolicy.","type":"object","properties":{"nameservers":{"description":"A list of DNS name server IP addresses. This will be appended to the base nameservers generated from DNSPolicy. Duplicated nameservers will be removed.","type":"array","items":{"type":"string","default":""}},"options":{"description":"A list of DNS resolver options. This will be merged with the base options generated from DNSPolicy. Duplicated entries will be removed. Resolution options given in Options will override those that appear in the base DNSPolicy.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.PodDNSConfigOption"}},"searches":{"description":"A list of DNS search domains for host-name lookup. This will be appended to the base search paths generated from DNSPolicy. Duplicated search paths will be removed.","type":"array","items":{"type":"string","default":""}}}},"io.k8s.api.core.v1.PodDNSConfigOption":{"description":"PodDNSConfigOption defines DNS resolver options of a pod.","type":"object","properties":{"name":{"description":"Required.","type":"string"},"value":{"type":"string"}}},"io.k8s.api.core.v1.PodOS":{"description":"PodOS defines the OS parameters of a pod.","type":"object","required":["name"],"properties":{"name":{"description":"Name is the name of the operating system. The currently supported values are linux and windows. Additional value may be defined in future and can be one of: https://github.com/opencontainers/runtime-spec/blob/master/config.md#platform-specific-configuration Clients should expect to handle additional values and treat unrecognized values in this field as os: null","type":"string","default":""}}},"io.k8s.api.core.v1.PodReadinessGate":{"description":"PodReadinessGate contains the reference to a pod condition","type":"object","required":["conditionType"],"properties":{"conditionType":{"description":"ConditionType refers to a condition in the pod's condition list with matching type.\n\n","type":"string","default":""}}},"io.k8s.api.core.v1.PodSecurityContext":{"description":"PodSecurityContext holds pod-level security attributes and common container settings. Some fields are also present in container.securityContext. Field values of container.securityContext take precedence over field values of PodSecurityContext.","type":"object","properties":{"fsGroup":{"description":"A special supplemental group that applies to all containers in a pod. Some volume types allow the Kubelet to change the ownership of that volume to be owned by the pod:\n\n1. The owning GID will be the FSGroup 2. The setgid bit is set (new files created in the volume will be owned by FSGroup) 3. The permission bits are OR'd with rw-rw----\n\nIf unset, the Kubelet will not modify the ownership and permissions of any volume. Note that this field cannot be set when spec.os.name is windows.","type":"integer","format":"int64"},"fsGroupChangePolicy":{"description":"fsGroupChangePolicy defines behavior of changing ownership and permission of the volume before being exposed inside Pod. This field will only apply to volume types which support fsGroup based ownership(and permissions). It will have no effect on ephemeral volume types such as: secret, configmaps and emptydir. Valid values are \"OnRootMismatch\" and \"Always\". If not specified, \"Always\" is used. Note that this field cannot be set when spec.os.name is windows.","type":"string"},"runAsGroup":{"description":"The GID to run the entrypoint of the container process. Uses runtime default if unset. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container. Note that this field cannot be set when spec.os.name is windows.","type":"integer","format":"int64"},"runAsNonRoot":{"description":"Indicates that the container must run as a non-root user. If true, the Kubelet will validate the image at runtime to ensure that it does not run as UID 0 (root) and fail to start the container if it does. If unset or false, no such validation will be performed. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.","type":"boolean"},"runAsUser":{"description":"The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container. Note that this field cannot be set when spec.os.name is windows.","type":"integer","format":"int64"},"seLinuxOptions":{"description":"The SELinux context to be applied to all containers. If unspecified, the container runtime will allocate a random SELinux context for each container. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container. Note that this field cannot be set when spec.os.name is windows.","$ref":"#/components/schemas/io.k8s.api.core.v1.SELinuxOptions"},"seccompProfile":{"description":"The seccomp options to use by the containers in this pod. Note that this field cannot be set when spec.os.name is windows.","$ref":"#/components/schemas/io.k8s.api.core.v1.SeccompProfile"},"supplementalGroups":{"description":"A list of groups applied to the first process run in each container, in addition to the container's primary GID. If unspecified, no groups will be added to any container. Note that this field cannot be set when spec.os.name is windows.","type":"array","items":{"type":"integer","format":"int64","default":0}},"sysctls":{"description":"Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported sysctls (by the container runtime) might fail to launch. Note that this field cannot be set when spec.os.name is windows.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.Sysctl"}},"windowsOptions":{"description":"The Windows specific settings applied to all containers. If unspecified, the options within a container's SecurityContext will be used. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. Note that this field cannot be set when spec.os.name is linux.","$ref":"#/components/schemas/io.k8s.api.core.v1.WindowsSecurityContextOptions"}}},"io.k8s.api.core.v1.PodSpec":{"description":"PodSpec is a description of a pod.","type":"object","required":["containers"],"properties":{"activeDeadlineSeconds":{"description":"Optional duration in seconds the pod may be active on the node relative to StartTime before the system will actively try to mark it failed and kill associated containers. Value must be a positive integer.","type":"integer","format":"int64"},"affinity":{"description":"If specified, the pod's scheduling constraints","$ref":"#/components/schemas/io.k8s.api.core.v1.Affinity"},"automountServiceAccountToken":{"description":"AutomountServiceAccountToken indicates whether a service account token should be automatically mounted.","type":"boolean"},"containers":{"description":"List of containers belonging to the pod. Containers cannot currently be added or removed. There must be at least one container in a Pod. Cannot be updated.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.Container"},"x-kubernetes-patch-merge-key":"name","x-kubernetes-patch-strategy":"merge"},"dnsConfig":{"description":"Specifies the DNS parameters of a pod. Parameters specified here will be merged to the generated DNS configuration based on DNSPolicy.","$ref":"#/components/schemas/io.k8s.api.core.v1.PodDNSConfig"},"dnsPolicy":{"description":"Set DNS policy for the pod. Defaults to \"ClusterFirst\". Valid values are 'ClusterFirstWithHostNet', 'ClusterFirst', 'Default' or 'None'. DNS parameters given in DNSConfig will be merged with the policy selected with DNSPolicy. To have DNS options set along with hostNetwork, you have to specify DNS policy explicitly to 'ClusterFirstWithHostNet'.\n\n","type":"string"},"enableServiceLinks":{"description":"EnableServiceLinks indicates whether information about services should be injected into pod's environment variables, matching the syntax of Docker links. Optional: Defaults to true.","type":"boolean"},"ephemeralContainers":{"description":"List of ephemeral containers run in this pod. Ephemeral containers may be run in an existing pod to perform user-initiated actions such as debugging. This list cannot be specified when creating a pod, and it cannot be modified by updating the pod spec. In order to add an ephemeral container to an existing pod, use the pod's ephemeralcontainers subresource.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.EphemeralContainer"},"x-kubernetes-patch-merge-key":"name","x-kubernetes-patch-strategy":"merge"},"hostAliases":{"description":"HostAliases is an optional list of hosts and IPs that will be injected into the pod's hosts file if specified. This is only valid for non-hostNetwork pods.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.HostAlias"},"x-kubernetes-patch-merge-key":"ip","x-kubernetes-patch-strategy":"merge"},"hostIPC":{"description":"Use the host's ipc namespace. Optional: Default to false.","type":"boolean"},"hostNetwork":{"description":"Host networking requested for this pod. Use the host's network namespace. If this option is set, the ports that will be used must be specified. Default to false.","type":"boolean"},"hostPID":{"description":"Use the host's pid namespace. Optional: Default to false.","type":"boolean"},"hostname":{"description":"Specifies the hostname of the Pod If not specified, the pod's hostname will be set to a system-defined value.","type":"string"},"imagePullSecrets":{"description":"ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this PodSpec. If specified, these secrets will be passed to individual puller implementations for them to use. For example, in the case of docker, only DockerConfig type secrets are honored. More info: https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.LocalObjectReference"},"x-kubernetes-patch-merge-key":"name","x-kubernetes-patch-strategy":"merge"},"initContainers":{"description":"List of initialization containers belonging to the pod. Init containers are executed in order prior to containers being started. If any init container fails, the pod is considered to have failed and is handled according to its restartPolicy. The name for an init container or normal container must be unique among all containers. Init containers may not have Lifecycle actions, Readiness probes, Liveness probes, or Startup probes. The resourceRequirements of an init container are taken into account during scheduling by finding the highest request/limit for each resource type, and then using the max of of that value or the sum of the normal containers. Limits are applied to init containers in a similar fashion. Init containers cannot currently be added or removed. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.Container"},"x-kubernetes-patch-merge-key":"name","x-kubernetes-patch-strategy":"merge"},"nodeName":{"description":"NodeName is a request to schedule this pod onto a specific node. If it is non-empty, the scheduler simply schedules this pod onto that node, assuming that it fits resource requirements.","type":"string"},"nodeSelector":{"description":"NodeSelector is a selector which must be true for the pod to fit on a node. Selector which must match a node's labels for the pod to be scheduled on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/","type":"object","additionalProperties":{"type":"string","default":""},"x-kubernetes-map-type":"atomic"},"os":{"description":"Specifies the OS of the containers in the pod. Some pod and container fields are restricted if this is set.\n\nIf the OS field is set to linux, the following fields must be unset: -securityContext.windowsOptions\n\nIf the OS field is set to windows, following fields must be unset: - spec.hostPID - spec.hostIPC - spec.securityContext.seLinuxOptions - spec.securityContext.seccompProfile - spec.securityContext.fsGroup - spec.securityContext.fsGroupChangePolicy - spec.securityContext.sysctls - spec.shareProcessNamespace - spec.securityContext.runAsUser - spec.securityContext.runAsGroup - spec.securityContext.supplementalGroups - spec.containers[*].securityContext.seLinuxOptions - spec.containers[*].securityContext.seccompProfile - spec.containers[*].securityContext.capabilities - spec.containers[*].securityContext.readOnlyRootFilesystem - spec.containers[*].securityContext.privileged - spec.containers[*].securityContext.allowPrivilegeEscalation - spec.containers[*].securityContext.procMount - spec.containers[*].securityContext.runAsUser - spec.containers[*].securityContext.runAsGroup This is an alpha field and requires the IdentifyPodOS feature","$ref":"#/components/schemas/io.k8s.api.core.v1.PodOS"},"overhead":{"description":"Overhead represents the resource overhead associated with running a pod for a given RuntimeClass. This field will be autopopulated at admission time by the RuntimeClass admission controller. If the RuntimeClass admission controller is enabled, overhead must not be set in Pod create requests. The RuntimeClass admission controller will reject Pod create requests which have the overhead already set. If RuntimeClass is configured and selected in the PodSpec, Overhead will be set to the value defined in the corresponding RuntimeClass, otherwise it will remain unset and treated as zero. More info: https://git.k8s.io/enhancements/keps/sig-node/688-pod-overhead/README.md This field is beta-level as of Kubernetes v1.18, and is only honored by servers that enable the PodOverhead feature.","type":"object","additionalProperties":{"default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.api.resource.Quantity"}},"preemptionPolicy":{"description":"PreemptionPolicy is the Policy for preempting pods with lower priority. One of Never, PreemptLowerPriority. Defaults to PreemptLowerPriority if unset.","type":"string"},"priority":{"description":"The priority value. Various system components use this field to find the priority of the pod. When Priority Admission Controller is enabled, it prevents users from setting this field. The admission controller populates this field from PriorityClassName. The higher the value, the higher the priority.","type":"integer","format":"int32"},"priorityClassName":{"description":"If specified, indicates the pod's priority. \"system-node-critical\" and \"system-cluster-critical\" are two special keywords which indicate the highest priorities with the former being the highest priority. Any other name must be defined by creating a PriorityClass object with that name. If not specified, the pod priority will be default or zero if there is no default.","type":"string"},"readinessGates":{"description":"If specified, all readiness gates will be evaluated for pod readiness. A pod is ready when all its containers are ready AND all conditions specified in the readiness gates have status equal to \"True\" More info: https://git.k8s.io/enhancements/keps/sig-network/580-pod-readiness-gates","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.PodReadinessGate"}},"restartPolicy":{"description":"Restart policy for all containers within the pod. One of Always, OnFailure, Never. Default to Always. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy\n\n","type":"string"},"runtimeClassName":{"description":"RuntimeClassName refers to a RuntimeClass object in the node.k8s.io group, which should be used to run this pod. If no RuntimeClass resource matches the named class, the pod will not be run. If unset or empty, the \"legacy\" RuntimeClass will be used, which is an implicit class with an empty definition that uses the default runtime handler. More info: https://git.k8s.io/enhancements/keps/sig-node/585-runtime-class This is a beta feature as of Kubernetes v1.14.","type":"string"},"schedulerName":{"description":"If specified, the pod will be dispatched by specified scheduler. If not specified, the pod will be dispatched by default scheduler.","type":"string"},"securityContext":{"description":"SecurityContext holds pod-level security attributes and common container settings. Optional: Defaults to empty. See type description for default values of each field.","$ref":"#/components/schemas/io.k8s.api.core.v1.PodSecurityContext"},"serviceAccount":{"description":"DeprecatedServiceAccount is a depreciated alias for ServiceAccountName. Deprecated: Use serviceAccountName instead.","type":"string"},"serviceAccountName":{"description":"ServiceAccountName is the name of the ServiceAccount to use to run this pod. More info: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/","type":"string"},"setHostnameAsFQDN":{"description":"If true the pod's hostname will be configured as the pod's FQDN, rather than the leaf name (the default). In Linux containers, this means setting the FQDN in the hostname field of the kernel (the nodename field of struct utsname). In Windows containers, this means setting the registry value of hostname for the registry key HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters to FQDN. If a pod does not have FQDN, this has no effect. Default to false.","type":"boolean"},"shareProcessNamespace":{"description":"Share a single process namespace between all of the containers in a pod. When this is set containers will be able to view and signal processes from other containers in the same pod, and the first process in each container will not be assigned PID 1. HostPID and ShareProcessNamespace cannot both be set. Optional: Default to false.","type":"boolean"},"subdomain":{"description":"If specified, the fully qualified Pod hostname will be \"\u003chostname\u003e.\u003csubdomain\u003e.\u003cpod namespace\u003e.svc.\u003ccluster domain\u003e\". If not specified, the pod will not have a domainname at all.","type":"string"},"terminationGracePeriodSeconds":{"description":"Optional duration in seconds the pod needs to terminate gracefully. May be decreased in delete request. Value must be non-negative integer. The value zero indicates stop immediately via the kill signal (no opportunity to shut down). If this value is nil, the default grace period will be used instead. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. Defaults to 30 seconds.","type":"integer","format":"int64"},"tolerations":{"description":"If specified, the pod's tolerations.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.Toleration"}},"topologySpreadConstraints":{"description":"TopologySpreadConstraints describes how a group of pods ought to spread across topology domains. Scheduler will schedule pods in a way which abides by the constraints. All topologySpreadConstraints are ANDed.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.TopologySpreadConstraint"},"x-kubernetes-list-map-keys":["topologyKey","whenUnsatisfiable"],"x-kubernetes-list-type":"map","x-kubernetes-patch-merge-key":"topologyKey","x-kubernetes-patch-strategy":"merge"},"volumes":{"description":"List of volumes that can be mounted by containers belonging to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.Volume"},"x-kubernetes-patch-merge-key":"name","x-kubernetes-patch-strategy":"merge,retainKeys"}}},"io.k8s.api.core.v1.PodTemplateSpec":{"description":"PodTemplateSpec describes the data a pod should have when created from a template","type":"object","properties":{"metadata":{"description":"Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata","default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"},"spec":{"description":"Specification of the desired behavior of the pod. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status","default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.PodSpec"}}},"io.k8s.api.core.v1.PortworxVolumeSource":{"description":"PortworxVolumeSource represents a Portworx volume resource.","type":"object","required":["volumeID"],"properties":{"fsType":{"description":"fSType represents the filesystem type to mount Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\". Implicitly inferred to be \"ext4\" if unspecified.","type":"string"},"readOnly":{"description":"readOnly defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.","type":"boolean"},"volumeID":{"description":"volumeID uniquely identifies a Portworx volume","type":"string","default":""}}},"io.k8s.api.core.v1.PreferredSchedulingTerm":{"description":"An empty preferred scheduling term matches all objects with implicit weight 0 (i.e. it's a no-op). A null preferred scheduling term matches no objects (i.e. is also a no-op).","type":"object","required":["weight","preference"],"properties":{"preference":{"description":"A node selector term, associated with the corresponding weight.","default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.NodeSelectorTerm"},"weight":{"description":"Weight associated with matching the corresponding nodeSelectorTerm, in the range 1-100.","type":"integer","format":"int32","default":0}}},"io.k8s.api.core.v1.Probe":{"description":"Probe describes a health check to be performed against a container to determine whether it is alive or ready to receive traffic.","type":"object","properties":{"exec":{"description":"Exec specifies the action to take.","$ref":"#/components/schemas/io.k8s.api.core.v1.ExecAction"},"failureThreshold":{"description":"Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1.","type":"integer","format":"int32"},"grpc":{"description":"GRPC specifies an action involving a GRPC port.","$ref":"#/components/schemas/io.k8s.api.core.v1.GRPCAction"},"httpGet":{"description":"HTTPGet specifies the http request to perform.","$ref":"#/components/schemas/io.k8s.api.core.v1.HTTPGetAction"},"initialDelaySeconds":{"description":"Number of seconds after the container has started before liveness probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes","type":"integer","format":"int32"},"periodSeconds":{"description":"How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1.","type":"integer","format":"int32"},"successThreshold":{"description":"Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1.","type":"integer","format":"int32"},"tcpSocket":{"description":"TCPSocket specifies an action involving a TCP port.","$ref":"#/components/schemas/io.k8s.api.core.v1.TCPSocketAction"},"terminationGracePeriodSeconds":{"description":"Optional duration in seconds the pod needs to terminate gracefully upon probe failure. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this value overrides the value provided by the pod spec. Value must be non-negative integer. The value zero indicates stop immediately via the kill signal (no opportunity to shut down). This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate. Minimum value is 1. spec.terminationGracePeriodSeconds is used if unset.","type":"integer","format":"int64"},"timeoutSeconds":{"description":"Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes","type":"integer","format":"int32"}}},"io.k8s.api.core.v1.ProjectedVolumeSource":{"description":"Represents a projected volume source","type":"object","properties":{"defaultMode":{"description":"defaultMode are the mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.","type":"integer","format":"int32"},"sources":{"description":"sources is the list of volume projections","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.VolumeProjection"}}}},"io.k8s.api.core.v1.QuobyteVolumeSource":{"description":"Represents a Quobyte mount that lasts the lifetime of a pod. Quobyte volumes do not support ownership management or SELinux relabeling.","type":"object","required":["registry","volume"],"properties":{"group":{"description":"group to map volume access to Default is no group","type":"string"},"readOnly":{"description":"readOnly here will force the Quobyte volume to be mounted with read-only permissions. Defaults to false.","type":"boolean"},"registry":{"description":"registry represents a single or multiple Quobyte Registry services specified as a string as host:port pair (multiple entries are separated with commas) which acts as the central registry for volumes","type":"string","default":""},"tenant":{"description":"tenant owning the given Quobyte volume in the Backend Used with dynamically provisioned Quobyte volumes, value is set by the plugin","type":"string"},"user":{"description":"user to map volume access to Defaults to serivceaccount user","type":"string"},"volume":{"description":"volume is a string that references an already created Quobyte volume by name.","type":"string","default":""}}},"io.k8s.api.core.v1.RBDVolumeSource":{"description":"Represents a Rados Block Device mount that lasts the lifetime of a pod. RBD volumes support ownership management and SELinux relabeling.","type":"object","required":["monitors","image"],"properties":{"fsType":{"description":"fsType is the filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#rbd","type":"string"},"image":{"description":"image is the rados image name. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it","type":"string","default":""},"keyring":{"description":"keyring is the path to key ring for RBDUser. Default is /etc/ceph/keyring. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it","type":"string"},"monitors":{"description":"monitors is a collection of Ceph monitors. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it","type":"array","items":{"type":"string","default":""}},"pool":{"description":"pool is the rados pool name. Default is rbd. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it","type":"string"},"readOnly":{"description":"readOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it","type":"boolean"},"secretRef":{"description":"secretRef is name of the authentication secret for RBDUser. If provided overrides keyring. Default is nil. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it","$ref":"#/components/schemas/io.k8s.api.core.v1.LocalObjectReference"},"user":{"description":"user is the rados user name. Default is admin. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it","type":"string"}}},"io.k8s.api.core.v1.ResourceFieldSelector":{"description":"ResourceFieldSelector represents container resources (cpu, memory) and their output format","type":"object","required":["resource"],"properties":{"containerName":{"description":"Container name: required for volumes, optional for env vars","type":"string"},"divisor":{"description":"Specifies the output format of the exposed resources, defaults to \"1\"","default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.api.resource.Quantity"},"resource":{"description":"Required: resource to select","type":"string","default":""}},"x-kubernetes-map-type":"atomic"},"io.k8s.api.core.v1.ResourceRequirements":{"description":"ResourceRequirements describes the compute resource requirements.","type":"object","properties":{"limits":{"description":"Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/","type":"object","additionalProperties":{"default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.api.resource.Quantity"}},"requests":{"description":"Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/","type":"object","additionalProperties":{"default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.api.resource.Quantity"}}}},"io.k8s.api.core.v1.SELinuxOptions":{"description":"SELinuxOptions are the labels to be applied to the container","type":"object","properties":{"level":{"description":"Level is SELinux level label that applies to the container.","type":"string"},"role":{"description":"Role is a SELinux role label that applies to the container.","type":"string"},"type":{"description":"Type is a SELinux type label that applies to the container.","type":"string"},"user":{"description":"User is a SELinux user label that applies to the container.","type":"string"}}},"io.k8s.api.core.v1.ScaleIOVolumeSource":{"description":"ScaleIOVolumeSource represents a persistent ScaleIO volume","type":"object","required":["gateway","system","secretRef"],"properties":{"fsType":{"description":"fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Default is \"xfs\".","type":"string"},"gateway":{"description":"gateway is the host address of the ScaleIO API Gateway.","type":"string","default":""},"protectionDomain":{"description":"protectionDomain is the name of the ScaleIO Protection Domain for the configured storage.","type":"string"},"readOnly":{"description":"readOnly Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.","type":"boolean"},"secretRef":{"description":"secretRef references to the secret for ScaleIO user and other sensitive information. If this is not provided, Login operation will fail.","$ref":"#/components/schemas/io.k8s.api.core.v1.LocalObjectReference"},"sslEnabled":{"description":"sslEnabled Flag enable/disable SSL communication with Gateway, default false","type":"boolean"},"storageMode":{"description":"storageMode indicates whether the storage for a volume should be ThickProvisioned or ThinProvisioned. Default is ThinProvisioned.","type":"string"},"storagePool":{"description":"storagePool is the ScaleIO Storage Pool associated with the protection domain.","type":"string"},"system":{"description":"system is the name of the storage system as configured in ScaleIO.","type":"string","default":""},"volumeName":{"description":"volumeName is the name of a volume already created in the ScaleIO system that is associated with this volume source.","type":"string"}}},"io.k8s.api.core.v1.SeccompProfile":{"description":"SeccompProfile defines a pod/container's seccomp profile settings. Only one profile source may be set.","type":"object","required":["type"],"properties":{"localhostProfile":{"description":"localhostProfile indicates a profile defined in a file on the node should be used. The profile must be preconfigured on the node to work. Must be a descending path, relative to the kubelet's configured seccomp profile location. Must only be set if type is \"Localhost\".","type":"string"},"type":{"description":"type indicates which kind of seccomp profile will be applied. Valid options are:\n\nLocalhost - a profile defined in a file on the node should be used. RuntimeDefault - the container runtime default profile should be used. Unconfined - no profile should be applied.\n\n","type":"string","default":""}},"x-kubernetes-unions":[{"discriminator":"type","fields-to-discriminateBy":{"localhostProfile":"LocalhostProfile"}}]},"io.k8s.api.core.v1.SecretEnvSource":{"description":"SecretEnvSource selects a Secret to populate the environment variables with.\n\nThe contents of the target Secret's Data field will represent the key-value pairs as environment variables.","type":"object","properties":{"name":{"description":"Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names","type":"string"},"optional":{"description":"Specify whether the Secret must be defined","type":"boolean"}}},"io.k8s.api.core.v1.SecretKeySelector":{"description":"SecretKeySelector selects a key of a Secret.","type":"object","required":["key"],"properties":{"key":{"description":"The key of the secret to select from. Must be a valid secret key.","type":"string","default":""},"name":{"description":"Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names","type":"string"},"optional":{"description":"Specify whether the Secret or its key must be defined","type":"boolean"}},"x-kubernetes-map-type":"atomic"},"io.k8s.api.core.v1.SecretProjection":{"description":"Adapts a secret into a projected volume.\n\nThe contents of the target Secret's Data field will be presented in a projected volume as files using the keys in the Data field as the file names. Note that this is identical to a secret volume source without the default mode.","type":"object","properties":{"items":{"description":"items if unspecified, each key-value pair in the Data field of the referenced Secret will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the Secret, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.KeyToPath"}},"name":{"description":"Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names","type":"string"},"optional":{"description":"optional field specify whether the Secret or its key must be defined","type":"boolean"}}},"io.k8s.api.core.v1.SecretVolumeSource":{"description":"Adapts a Secret into a volume.\n\nThe contents of the target Secret's Data field will be presented in a volume as files using the keys in the Data field as the file names. Secret volumes support ownership management and SELinux relabeling.","type":"object","properties":{"defaultMode":{"description":"defaultMode is Optional: mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.","type":"integer","format":"int32"},"items":{"description":"items If unspecified, each key-value pair in the Data field of the referenced Secret will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the Secret, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.KeyToPath"}},"optional":{"description":"optional field specify whether the Secret or its keys must be defined","type":"boolean"},"secretName":{"description":"secretName is the name of the secret in the pod's namespace to use. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret","type":"string"}}},"io.k8s.api.core.v1.SecurityContext":{"description":"SecurityContext holds security configuration that will be applied to a container. Some fields are present in both SecurityContext and PodSecurityContext. When both are set, the values in SecurityContext take precedence.","type":"object","properties":{"allowPrivilegeEscalation":{"description":"AllowPrivilegeEscalation controls whether a process can gain more privileges than its parent process. This bool directly controls if the no_new_privs flag will be set on the container process. AllowPrivilegeEscalation is true always when the container is: 1) run as Privileged 2) has CAP_SYS_ADMIN Note that this field cannot be set when spec.os.name is windows.","type":"boolean"},"capabilities":{"description":"The capabilities to add/drop when running containers. Defaults to the default set of capabilities granted by the container runtime. Note that this field cannot be set when spec.os.name is windows.","$ref":"#/components/schemas/io.k8s.api.core.v1.Capabilities"},"privileged":{"description":"Run container in privileged mode. Processes in privileged containers are essentially equivalent to root on the host. Defaults to false. Note that this field cannot be set when spec.os.name is windows.","type":"boolean"},"procMount":{"description":"procMount denotes the type of proc mount to use for the containers. The default is DefaultProcMount which uses the container runtime defaults for readonly paths and masked paths. This requires the ProcMountType feature flag to be enabled. Note that this field cannot be set when spec.os.name is windows.","type":"string"},"readOnlyRootFilesystem":{"description":"Whether this container has a read-only root filesystem. Default is false. Note that this field cannot be set when spec.os.name is windows.","type":"boolean"},"runAsGroup":{"description":"The GID to run the entrypoint of the container process. Uses runtime default if unset. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. Note that this field cannot be set when spec.os.name is windows.","type":"integer","format":"int64"},"runAsNonRoot":{"description":"Indicates that the container must run as a non-root user. If true, the Kubelet will validate the image at runtime to ensure that it does not run as UID 0 (root) and fail to start the container if it does. If unset or false, no such validation will be performed. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.","type":"boolean"},"runAsUser":{"description":"The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. Note that this field cannot be set when spec.os.name is windows.","type":"integer","format":"int64"},"seLinuxOptions":{"description":"The SELinux context to be applied to the container. If unspecified, the container runtime will allocate a random SELinux context for each container. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. Note that this field cannot be set when spec.os.name is windows.","$ref":"#/components/schemas/io.k8s.api.core.v1.SELinuxOptions"},"seccompProfile":{"description":"The seccomp options to use by this container. If seccomp options are provided at both the pod \u0026 container level, the container options override the pod options. Note that this field cannot be set when spec.os.name is windows.","$ref":"#/components/schemas/io.k8s.api.core.v1.SeccompProfile"},"windowsOptions":{"description":"The Windows specific settings applied to all containers. If unspecified, the options from the PodSecurityContext will be used. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. Note that this field cannot be set when spec.os.name is linux.","$ref":"#/components/schemas/io.k8s.api.core.v1.WindowsSecurityContextOptions"}}},"io.k8s.api.core.v1.ServiceAccountTokenProjection":{"description":"ServiceAccountTokenProjection represents a projected service account token volume. This projection can be used to insert a service account token into the pods runtime filesystem for use against APIs (Kubernetes API Server or otherwise).","type":"object","required":["path"],"properties":{"audience":{"description":"audience is the intended audience of the token. A recipient of a token must identify itself with an identifier specified in the audience of the token, and otherwise should reject the token. The audience defaults to the identifier of the apiserver.","type":"string"},"expirationSeconds":{"description":"expirationSeconds is the requested duration of validity of the service account token. As the token approaches expiration, the kubelet volume plugin will proactively rotate the service account token. The kubelet will start trying to rotate the token if the token is older than 80 percent of its time to live or if the token is older than 24 hours.Defaults to 1 hour and must be at least 10 minutes.","type":"integer","format":"int64"},"path":{"description":"path is the path relative to the mount point of the file to project the token into.","type":"string","default":""}}},"io.k8s.api.core.v1.StorageOSVolumeSource":{"description":"Represents a StorageOS persistent volume resource.","type":"object","properties":{"fsType":{"description":"fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.","type":"string"},"readOnly":{"description":"readOnly defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.","type":"boolean"},"secretRef":{"description":"secretRef specifies the secret to use for obtaining the StorageOS API credentials. If not specified, default values will be attempted.","$ref":"#/components/schemas/io.k8s.api.core.v1.LocalObjectReference"},"volumeName":{"description":"volumeName is the human-readable name of the StorageOS volume. Volume names are only unique within a namespace.","type":"string"},"volumeNamespace":{"description":"volumeNamespace specifies the scope of the volume within StorageOS. If no namespace is specified then the Pod's namespace will be used. This allows the Kubernetes name scoping to be mirrored within StorageOS for tighter integration. Set VolumeName to any name to override the default behaviour. Set to \"default\" if you are not using namespaces within StorageOS. Namespaces that do not pre-exist within StorageOS will be created.","type":"string"}}},"io.k8s.api.core.v1.Sysctl":{"description":"Sysctl defines a kernel parameter to be set","type":"object","required":["name","value"],"properties":{"name":{"description":"Name of a property to set","type":"string","default":""},"value":{"description":"Value of a property to set","type":"string","default":""}}},"io.k8s.api.core.v1.TCPSocketAction":{"description":"TCPSocketAction describes an action based on opening a socket","type":"object","required":["port"],"properties":{"host":{"description":"Optional: Host name to connect to, defaults to the pod IP.","type":"string"},"port":{"description":"Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME.","default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.util.intstr.IntOrString"}}},"io.k8s.api.core.v1.Toleration":{"description":"The pod this Toleration is attached to tolerates any taint that matches the triple \u003ckey,value,effect\u003e using the matching operator \u003coperator\u003e.","type":"object","properties":{"effect":{"description":"Effect indicates the taint effect to match. Empty means match all taint effects. When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute.\n\n","type":"string"},"key":{"description":"Key is the taint key that the toleration applies to. Empty means match all taint keys. If the key is empty, operator must be Exists; this combination means to match all values and all keys.","type":"string"},"operator":{"description":"Operator represents a key's relationship to the value. Valid operators are Exists and Equal. Defaults to Equal. Exists is equivalent to wildcard for value, so that a pod can tolerate all taints of a particular category.\n\n","type":"string"},"tolerationSeconds":{"description":"TolerationSeconds represents the period of time the toleration (which must be of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default, it is not set, which means tolerate the taint forever (do not evict). Zero and negative values will be treated as 0 (evict immediately) by the system.","type":"integer","format":"int64"},"value":{"description":"Value is the taint value the toleration matches to. If the operator is Exists, the value should be empty, otherwise just a regular string.","type":"string"}}},"io.k8s.api.core.v1.TopologySpreadConstraint":{"description":"TopologySpreadConstraint specifies how to spread matching pods among the given topology.","type":"object","required":["maxSkew","topologyKey","whenUnsatisfiable"],"properties":{"labelSelector":{"description":"LabelSelector is used to find matching pods. Pods that match this label selector are counted to determine the number of pods in their corresponding topology domain.","$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector"},"maxSkew":{"description":"MaxSkew describes the degree to which pods may be unevenly distributed. When `whenUnsatisfiable=DoNotSchedule`, it is the maximum permitted difference between the number of matching pods in the target topology and the global minimum. For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same labelSelector spread as 1/1/0: | zone1 | zone2 | zone3 | | P | P | | - if MaxSkew is 1, incoming pod can only be scheduled to zone3 to become 1/1/1; scheduling it onto zone1(zone2) would make the ActualSkew(2-0) on zone1(zone2) violate MaxSkew(1). - if MaxSkew is 2, incoming pod can be scheduled onto any zone. When `whenUnsatisfiable=ScheduleAnyway`, it is used to give higher precedence to topologies that satisfy it. It's a required field. Default value is 1 and 0 is not allowed.","type":"integer","format":"int32","default":0},"topologyKey":{"description":"TopologyKey is the key of node labels. Nodes that have a label with this key and identical values are considered to be in the same topology. We consider each \u003ckey, value\u003e as a \"bucket\", and try to put balanced number of pods into each bucket. It's a required field.","type":"string","default":""},"whenUnsatisfiable":{"description":"WhenUnsatisfiable indicates how to deal with a pod if it doesn't satisfy the spread constraint. - DoNotSchedule (default) tells the scheduler not to schedule it. - ScheduleAnyway tells the scheduler to schedule the pod in any location,\n but giving higher precedence to topologies that would help reduce the\n skew.\nA constraint is considered \"Unsatisfiable\" for an incoming pod if and only if every possible node assignment for that pod would violate \"MaxSkew\" on some topology. For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same labelSelector spread as 3/1/1: | zone1 | zone2 | zone3 | | P P P | P | P | If WhenUnsatisfiable is set to DoNotSchedule, incoming pod can only be scheduled to zone2(zone3) to become 3/2/1(3/1/2) as ActualSkew(2-1) on zone2(zone3) satisfies MaxSkew(1). In other words, the cluster can still be imbalanced, but scheduler won't make it *more* imbalanced. It's a required field.\n\n","type":"string","default":""}}},"io.k8s.api.core.v1.TypedLocalObjectReference":{"description":"TypedLocalObjectReference contains enough information to let you locate the typed referenced object inside the same namespace.","type":"object","required":["kind","name"],"properties":{"apiGroup":{"description":"APIGroup is the group for the resource being referenced. If APIGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, APIGroup is required.","type":"string"},"kind":{"description":"Kind is the type of resource being referenced","type":"string","default":""},"name":{"description":"Name is the name of resource being referenced","type":"string","default":""}},"x-kubernetes-map-type":"atomic"},"io.k8s.api.core.v1.Volume":{"description":"Volume represents a named volume in a pod that may be accessed by any container in the pod.","type":"object","required":["name"],"properties":{"awsElasticBlockStore":{"description":"awsElasticBlockStore represents an AWS Disk resource that is attached to a kubelet's host machine and then exposed to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore","$ref":"#/components/schemas/io.k8s.api.core.v1.AWSElasticBlockStoreVolumeSource"},"azureDisk":{"description":"azureDisk represents an Azure Data Disk mount on the host and bind mount to the pod.","$ref":"#/components/schemas/io.k8s.api.core.v1.AzureDiskVolumeSource"},"azureFile":{"description":"azureFile represents an Azure File Service mount on the host and bind mount to the pod.","$ref":"#/components/schemas/io.k8s.api.core.v1.AzureFileVolumeSource"},"cephfs":{"description":"cephFS represents a Ceph FS mount on the host that shares a pod's lifetime","$ref":"#/components/schemas/io.k8s.api.core.v1.CephFSVolumeSource"},"cinder":{"description":"cinder represents a cinder volume attached and mounted on kubelets host machine. More info: https://examples.k8s.io/mysql-cinder-pd/README.md","$ref":"#/components/schemas/io.k8s.api.core.v1.CinderVolumeSource"},"configMap":{"description":"configMap represents a configMap that should populate this volume","$ref":"#/components/schemas/io.k8s.api.core.v1.ConfigMapVolumeSource"},"csi":{"description":"csi (Container Storage Interface) represents ephemeral storage that is handled by certain external CSI drivers (Beta feature).","$ref":"#/components/schemas/io.k8s.api.core.v1.CSIVolumeSource"},"downwardAPI":{"description":"downwardAPI represents downward API about the pod that should populate this volume","$ref":"#/components/schemas/io.k8s.api.core.v1.DownwardAPIVolumeSource"},"emptyDir":{"description":"emptyDir represents a temporary directory that shares a pod's lifetime. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir","$ref":"#/components/schemas/io.k8s.api.core.v1.EmptyDirVolumeSource"},"ephemeral":{"description":"ephemeral represents a volume that is handled by a cluster storage driver. The volume's lifecycle is tied to the pod that defines it - it will be created before the pod starts, and deleted when the pod is removed.\n\nUse this if: a) the volume is only needed while the pod runs, b) features of normal volumes like restoring from snapshot or capacity\n tracking are needed,\nc) the storage driver is specified through a storage class, and d) the storage driver supports dynamic volume provisioning through\n a PersistentVolumeClaim (see EphemeralVolumeSource for more\n information on the connection between this volume type\n and PersistentVolumeClaim).\n\nUse PersistentVolumeClaim or one of the vendor-specific APIs for volumes that persist for longer than the lifecycle of an individual pod.\n\nUse CSI for light-weight local ephemeral volumes if the CSI driver is meant to be used that way - see the documentation of the driver for more information.\n\nA pod can use both types of ephemeral volumes and persistent volumes at the same time.","$ref":"#/components/schemas/io.k8s.api.core.v1.EphemeralVolumeSource"},"fc":{"description":"fc represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod.","$ref":"#/components/schemas/io.k8s.api.core.v1.FCVolumeSource"},"flexVolume":{"description":"flexVolume represents a generic volume resource that is provisioned/attached using an exec based plugin.","$ref":"#/components/schemas/io.k8s.api.core.v1.FlexVolumeSource"},"flocker":{"description":"flocker represents a Flocker volume attached to a kubelet's host machine. This depends on the Flocker control service being running","$ref":"#/components/schemas/io.k8s.api.core.v1.FlockerVolumeSource"},"gcePersistentDisk":{"description":"gcePersistentDisk represents a GCE Disk resource that is attached to a kubelet's host machine and then exposed to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk","$ref":"#/components/schemas/io.k8s.api.core.v1.GCEPersistentDiskVolumeSource"},"gitRepo":{"description":"gitRepo represents a git repository at a particular revision. DEPRECATED: GitRepo is deprecated. To provision a container with a git repo, mount an EmptyDir into an InitContainer that clones the repo using git, then mount the EmptyDir into the Pod's container.","$ref":"#/components/schemas/io.k8s.api.core.v1.GitRepoVolumeSource"},"glusterfs":{"description":"glusterfs represents a Glusterfs mount on the host that shares a pod's lifetime. More info: https://examples.k8s.io/volumes/glusterfs/README.md","$ref":"#/components/schemas/io.k8s.api.core.v1.GlusterfsVolumeSource"},"hostPath":{"description":"hostPath represents a pre-existing file or directory on the host machine that is directly exposed to the container. This is generally used for system agents or other privileged things that are allowed to see the host machine. Most containers will NOT need this. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath","$ref":"#/components/schemas/io.k8s.api.core.v1.HostPathVolumeSource"},"iscsi":{"description":"iscsi represents an ISCSI Disk resource that is attached to a kubelet's host machine and then exposed to the pod. More info: https://examples.k8s.io/volumes/iscsi/README.md","$ref":"#/components/schemas/io.k8s.api.core.v1.ISCSIVolumeSource"},"name":{"description":"name of the volume. Must be a DNS_LABEL and unique within the pod. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names","type":"string","default":""},"nfs":{"description":"nfs represents an NFS mount on the host that shares a pod's lifetime More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs","$ref":"#/components/schemas/io.k8s.api.core.v1.NFSVolumeSource"},"persistentVolumeClaim":{"description":"persistentVolumeClaimVolumeSource represents a reference to a PersistentVolumeClaim in the same namespace. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims","$ref":"#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaimVolumeSource"},"photonPersistentDisk":{"description":"photonPersistentDisk represents a PhotonController persistent disk attached and mounted on kubelets host machine","$ref":"#/components/schemas/io.k8s.api.core.v1.PhotonPersistentDiskVolumeSource"},"portworxVolume":{"description":"portworxVolume represents a portworx volume attached and mounted on kubelets host machine","$ref":"#/components/schemas/io.k8s.api.core.v1.PortworxVolumeSource"},"projected":{"description":"projected items for all in one resources secrets, configmaps, and downward API","$ref":"#/components/schemas/io.k8s.api.core.v1.ProjectedVolumeSource"},"quobyte":{"description":"quobyte represents a Quobyte mount on the host that shares a pod's lifetime","$ref":"#/components/schemas/io.k8s.api.core.v1.QuobyteVolumeSource"},"rbd":{"description":"rbd represents a Rados Block Device mount on the host that shares a pod's lifetime. More info: https://examples.k8s.io/volumes/rbd/README.md","$ref":"#/components/schemas/io.k8s.api.core.v1.RBDVolumeSource"},"scaleIO":{"description":"scaleIO represents a ScaleIO persistent volume attached and mounted on Kubernetes nodes.","$ref":"#/components/schemas/io.k8s.api.core.v1.ScaleIOVolumeSource"},"secret":{"description":"secret represents a secret that should populate this volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret","$ref":"#/components/schemas/io.k8s.api.core.v1.SecretVolumeSource"},"storageos":{"description":"storageOS represents a StorageOS volume attached and mounted on Kubernetes nodes.","$ref":"#/components/schemas/io.k8s.api.core.v1.StorageOSVolumeSource"},"vsphereVolume":{"description":"vsphereVolume represents a vSphere volume attached and mounted on kubelets host machine","$ref":"#/components/schemas/io.k8s.api.core.v1.VsphereVirtualDiskVolumeSource"}}},"io.k8s.api.core.v1.VolumeDevice":{"description":"volumeDevice describes a mapping of a raw block device within a container.","type":"object","required":["name","devicePath"],"properties":{"devicePath":{"description":"devicePath is the path inside of the container that the device will be mapped to.","type":"string","default":""},"name":{"description":"name must match the name of a persistentVolumeClaim in the pod","type":"string","default":""}}},"io.k8s.api.core.v1.VolumeMount":{"description":"VolumeMount describes a mounting of a Volume within a container.","type":"object","required":["name","mountPath"],"properties":{"mountPath":{"description":"Path within the container at which the volume should be mounted. Must not contain ':'.","type":"string","default":""},"mountPropagation":{"description":"mountPropagation determines how mounts are propagated from the host to container and the other way around. When not set, MountPropagationNone is used. This field is beta in 1.10.","type":"string"},"name":{"description":"This must match the Name of a Volume.","type":"string","default":""},"readOnly":{"description":"Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false.","type":"boolean"},"subPath":{"description":"Path within the volume from which the container's volume should be mounted. Defaults to \"\" (volume's root).","type":"string"},"subPathExpr":{"description":"Expanded path within the volume from which the container's volume should be mounted. Behaves similarly to SubPath but environment variable references $(VAR_NAME) are expanded using the container's environment. Defaults to \"\" (volume's root). SubPathExpr and SubPath are mutually exclusive.","type":"string"}}},"io.k8s.api.core.v1.VolumeProjection":{"description":"Projection that may be projected along with other supported volume types","type":"object","properties":{"configMap":{"description":"configMap information about the configMap data to project","$ref":"#/components/schemas/io.k8s.api.core.v1.ConfigMapProjection"},"downwardAPI":{"description":"downwardAPI information about the downwardAPI data to project","$ref":"#/components/schemas/io.k8s.api.core.v1.DownwardAPIProjection"},"secret":{"description":"secret information about the secret data to project","$ref":"#/components/schemas/io.k8s.api.core.v1.SecretProjection"},"serviceAccountToken":{"description":"serviceAccountToken is information about the serviceAccountToken data to project","$ref":"#/components/schemas/io.k8s.api.core.v1.ServiceAccountTokenProjection"}}},"io.k8s.api.core.v1.VsphereVirtualDiskVolumeSource":{"description":"Represents a vSphere volume resource.","type":"object","required":["volumePath"],"properties":{"fsType":{"description":"fsType is filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.","type":"string"},"storagePolicyID":{"description":"storagePolicyID is the storage Policy Based Management (SPBM) profile ID associated with the StoragePolicyName.","type":"string"},"storagePolicyName":{"description":"storagePolicyName is the storage Policy Based Management (SPBM) profile name.","type":"string"},"volumePath":{"description":"volumePath is the path that identifies vSphere volume vmdk","type":"string","default":""}}},"io.k8s.api.core.v1.WeightedPodAffinityTerm":{"description":"The weights of all of the matched WeightedPodAffinityTerm fields are added per-node to find the most preferred node(s)","type":"object","required":["weight","podAffinityTerm"],"properties":{"podAffinityTerm":{"description":"Required. A pod affinity term, associated with the corresponding weight.","default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.PodAffinityTerm"},"weight":{"description":"weight associated with matching the corresponding podAffinityTerm, in the range 1-100.","type":"integer","format":"int32","default":0}}},"io.k8s.api.core.v1.WindowsSecurityContextOptions":{"description":"WindowsSecurityContextOptions contain Windows-specific options and credentials.","type":"object","properties":{"gmsaCredentialSpec":{"description":"GMSACredentialSpec is where the GMSA admission webhook (https://github.com/kubernetes-sigs/windows-gmsa) inlines the contents of the GMSA credential spec named by the GMSACredentialSpecName field.","type":"string"},"gmsaCredentialSpecName":{"description":"GMSACredentialSpecName is the name of the GMSA credential spec to use.","type":"string"},"hostProcess":{"description":"HostProcess determines if a container should be run as a 'Host Process' container. This field is alpha-level and will only be honored by components that enable the WindowsHostProcessContainers feature flag. Setting this field without the feature flag will result in errors when validating the Pod. All of a Pod's containers must have the same effective HostProcess value (it is not allowed to have a mix of HostProcess containers and non-HostProcess containers). In addition, if HostProcess is true then HostNetwork must also be set to true.","type":"boolean"},"runAsUserName":{"description":"The UserName in Windows to run the entrypoint of the container process. Defaults to the user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.","type":"string"}}},"io.k8s.apimachinery.pkg.api.resource.Quantity":{"description":"Quantity is a fixed-point representation of a number. It provides convenient marshaling/unmarshaling in JSON and YAML, in addition to String() and AsInt64() accessors.\n\nThe serialization format is:\n\n\u003cquantity\u003e ::= \u003csignedNumber\u003e\u003csuffix\u003e\n (Note that \u003csuffix\u003e may be empty, from the \"\" case in \u003cdecimalSI\u003e.)\n\u003cdigit\u003e ::= 0 | 1 | ... | 9 \u003cdigits\u003e ::= \u003cdigit\u003e | \u003cdigit\u003e\u003cdigits\u003e \u003cnumber\u003e ::= \u003cdigits\u003e | \u003cdigits\u003e.\u003cdigits\u003e | \u003cdigits\u003e. | .\u003cdigits\u003e \u003csign\u003e ::= \"+\" | \"-\" \u003csignedNumber\u003e ::= \u003cnumber\u003e | \u003csign\u003e\u003cnumber\u003e \u003csuffix\u003e ::= \u003cbinarySI\u003e | \u003cdecimalExponent\u003e | \u003cdecimalSI\u003e \u003cbinarySI\u003e ::= Ki | Mi | Gi | Ti | Pi | Ei\n (International System of units; See: http://physics.nist.gov/cuu/Units/binary.html)\n\u003cdecimalSI\u003e ::= m | \"\" | k | M | G | T | P | E\n (Note that 1024 = 1Ki but 1000 = 1k; I didn't choose the capitalization.)\n\u003cdecimalExponent\u003e ::= \"e\" \u003csignedNumber\u003e | \"E\" \u003csignedNumber\u003e\n\nNo matter which of the three exponent forms is used, no quantity may represent a number greater than 2^63-1 in magnitude, nor may it have more than 3 decimal places. Numbers larger or more precise will be capped or rounded up. (E.g.: 0.1m will rounded up to 1m.) This may be extended in the future if we require larger or smaller quantities.\n\nWhen a Quantity is parsed from a string, it will remember the type of suffix it had, and will use the same type again when it is serialized.\n\nBefore serializing, Quantity will be put in \"canonical form\". This means that Exponent/suffix will be adjusted up or down (with a corresponding increase or decrease in Mantissa) such that:\n a. No precision is lost\n b. No fractional digits will be emitted\n c. The exponent (or suffix) is as large as possible.\nThe sign will be omitted unless the number is negative.\n\nExamples:\n 1.5 will be serialized as \"1500m\"\n 1.5Gi will be serialized as \"1536Mi\"\n\nNote that the quantity will NEVER be internally represented by a floating point number. That is the whole point of this exercise.\n\nNon-canonical values will still parse as long as they are well formed, but will be re-emitted in their canonical form. (So always use canonical form, or don't diff.)\n\nThis format is intended to make it difficult to use these numbers without writing some sort of special handling code in the hopes that that will cause implementors to also use a fixed point implementation.","type":"string"},"io.k8s.apimachinery.pkg.apis.meta.v1.APIResource":{"description":"APIResource specifies the name of a resource and whether it is namespaced.","type":"object","required":["name","singularName","namespaced","kind","verbs"],"properties":{"categories":{"description":"categories is a list of the grouped resources this resource belongs to (e.g. 'all')","type":"array","items":{"type":"string","default":""}},"group":{"description":"group is the preferred group of the resource. Empty implies the group of the containing resource list. For subresources, this may have a different value, for example: Scale\".","type":"string"},"kind":{"description":"kind is the kind for the resource (e.g. 'Foo' is the kind for a resource 'foo')","type":"string","default":""},"name":{"description":"name is the plural name of the resource.","type":"string","default":""},"namespaced":{"description":"namespaced indicates if a resource is namespaced or not.","type":"boolean","default":false},"shortNames":{"description":"shortNames is a list of suggested short names of the resource.","type":"array","items":{"type":"string","default":""}},"singularName":{"description":"singularName is the singular name of the resource. This allows clients to handle plural and singular opaquely. The singularName is more correct for reporting status on a single item and both singular and plural are allowed from the kubectl CLI interface.","type":"string","default":""},"storageVersionHash":{"description":"The hash value of the storage version, the version this resource is converted to when written to the data store. Value must be treated as opaque by clients. Only equality comparison on the value is valid. This is an alpha feature and may change or be removed in the future. The field is populated by the apiserver only if the StorageVersionHash feature gate is enabled. This field will remain optional even if it graduates.","type":"string"},"verbs":{"description":"verbs is a list of supported kube verbs (this includes get, list, watch, create, update, patch, delete, deletecollection, and proxy)","type":"array","items":{"type":"string","default":""}},"version":{"description":"version is the preferred version of the resource. Empty implies the version of the containing resource list For subresources, this may have a different value, for example: v1 (while inside a v1beta1 version of the core resource's group)\".","type":"string"}}},"io.k8s.apimachinery.pkg.apis.meta.v1.APIResourceList":{"description":"APIResourceList is a list of APIResource, it is used to expose the name of the resources supported in a specific group and version, and if the resource is namespaced.","type":"object","required":["groupVersion","resources"],"properties":{"apiVersion":{"description":"APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources","type":"string"},"groupVersion":{"description":"groupVersion is the group and version this APIResourceList is for.","type":"string","default":""},"kind":{"description":"Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds","type":"string"},"resources":{"description":"resources contains the name of the resources and if they are namespaced.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.APIResource"}}},"x-kubernetes-group-version-kind":[{"group":"","kind":"APIResourceList","version":"v1"}]},"io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions":{"description":"DeleteOptions may be provided when deleting an API object.","type":"object","properties":{"apiVersion":{"description":"APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources","type":"string"},"dryRun":{"description":"When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed","type":"array","items":{"type":"string","default":""}},"gracePeriodSeconds":{"description":"The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.","type":"integer","format":"int64"},"kind":{"description":"Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds","type":"string"},"orphanDependents":{"description":"Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.","type":"boolean"},"preconditions":{"description":"Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned.","$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Preconditions"},"propagationPolicy":{"description":"Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.","type":"string"}},"x-kubernetes-group-version-kind":[{"group":"","kind":"DeleteOptions","version":"v1"},{"group":"admission.k8s.io","kind":"DeleteOptions","version":"v1"},{"group":"admission.k8s.io","kind":"DeleteOptions","version":"v1beta1"},{"group":"admissionregistration.k8s.io","kind":"DeleteOptions","version":"v1"},{"group":"admissionregistration.k8s.io","kind":"DeleteOptions","version":"v1beta1"},{"group":"apiextensions.k8s.io","kind":"DeleteOptions","version":"v1"},{"group":"apiextensions.k8s.io","kind":"DeleteOptions","version":"v1beta1"},{"group":"apiregistration.k8s.io","kind":"DeleteOptions","version":"v1"},{"group":"apiregistration.k8s.io","kind":"DeleteOptions","version":"v1beta1"},{"group":"apps","kind":"DeleteOptions","version":"v1"},{"group":"apps","kind":"DeleteOptions","version":"v1beta1"},{"group":"apps","kind":"DeleteOptions","version":"v1beta2"},{"group":"authentication.k8s.io","kind":"DeleteOptions","version":"v1"},{"group":"authentication.k8s.io","kind":"DeleteOptions","version":"v1beta1"},{"group":"authorization.k8s.io","kind":"DeleteOptions","version":"v1"},{"group":"authorization.k8s.io","kind":"DeleteOptions","version":"v1beta1"},{"group":"autoscaling","kind":"DeleteOptions","version":"v1"},{"group":"autoscaling","kind":"DeleteOptions","version":"v2"},{"group":"autoscaling","kind":"DeleteOptions","version":"v2beta1"},{"group":"autoscaling","kind":"DeleteOptions","version":"v2beta2"},{"group":"batch","kind":"DeleteOptions","version":"v1"},{"group":"batch","kind":"DeleteOptions","version":"v1beta1"},{"group":"certificates.k8s.io","kind":"DeleteOptions","version":"v1"},{"group":"certificates.k8s.io","kind":"DeleteOptions","version":"v1beta1"},{"group":"coordination.k8s.io","kind":"DeleteOptions","version":"v1"},{"group":"coordination.k8s.io","kind":"DeleteOptions","version":"v1beta1"},{"group":"discovery.k8s.io","kind":"DeleteOptions","version":"v1"},{"group":"discovery.k8s.io","kind":"DeleteOptions","version":"v1beta1"},{"group":"events.k8s.io","kind":"DeleteOptions","version":"v1"},{"group":"events.k8s.io","kind":"DeleteOptions","version":"v1beta1"},{"group":"extensions","kind":"DeleteOptions","version":"v1beta1"},{"group":"flowcontrol.apiserver.k8s.io","kind":"DeleteOptions","version":"v1alpha1"},{"group":"flowcontrol.apiserver.k8s.io","kind":"DeleteOptions","version":"v1beta1"},{"group":"flowcontrol.apiserver.k8s.io","kind":"DeleteOptions","version":"v1beta2"},{"group":"imagepolicy.k8s.io","kind":"DeleteOptions","version":"v1alpha1"},{"group":"internal.apiserver.k8s.io","kind":"DeleteOptions","version":"v1alpha1"},{"group":"networking.k8s.io","kind":"DeleteOptions","version":"v1"},{"group":"networking.k8s.io","kind":"DeleteOptions","version":"v1beta1"},{"group":"node.k8s.io","kind":"DeleteOptions","version":"v1"},{"group":"node.k8s.io","kind":"DeleteOptions","version":"v1alpha1"},{"group":"node.k8s.io","kind":"DeleteOptions","version":"v1beta1"},{"group":"policy","kind":"DeleteOptions","version":"v1"},{"group":"policy","kind":"DeleteOptions","version":"v1beta1"},{"group":"rbac.authorization.k8s.io","kind":"DeleteOptions","version":"v1"},{"group":"rbac.authorization.k8s.io","kind":"DeleteOptions","version":"v1alpha1"},{"group":"rbac.authorization.k8s.io","kind":"DeleteOptions","version":"v1beta1"},{"group":"scheduling.k8s.io","kind":"DeleteOptions","version":"v1"},{"group":"scheduling.k8s.io","kind":"DeleteOptions","version":"v1alpha1"},{"group":"scheduling.k8s.io","kind":"DeleteOptions","version":"v1beta1"},{"group":"storage.k8s.io","kind":"DeleteOptions","version":"v1"},{"group":"storage.k8s.io","kind":"DeleteOptions","version":"v1alpha1"},{"group":"storage.k8s.io","kind":"DeleteOptions","version":"v1beta1"}]},"io.k8s.apimachinery.pkg.apis.meta.v1.FieldsV1":{"description":"FieldsV1 stores a set of fields in a data structure like a Trie, in JSON format.\n\nEach key is either a '.' representing the field itself, and will always map to an empty set, or a string representing a sub-field or item. The string will follow one of these four formats: 'f:\u003cname\u003e', where \u003cname\u003e is the name of a field in a struct, or key in a map 'v:\u003cvalue\u003e', where \u003cvalue\u003e is the exact json formatted value of a list item 'i:\u003cindex\u003e', where \u003cindex\u003e is position of a item in a list 'k:\u003ckeys\u003e', where \u003ckeys\u003e is a map of a list item's key fields to their unique values If a key maps to an empty Fields value, the field that key represents is part of the set.\n\nThe exact format is defined in sigs.k8s.io/structured-merge-diff","type":"object"},"io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector":{"description":"A label selector is a label query over a set of resources. The result of matchLabels and matchExpressions are ANDed. An empty label selector matches all objects. A null label selector matches no objects.","type":"object","properties":{"matchExpressions":{"description":"matchExpressions is a list of label selector requirements. The requirements are ANDed.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelectorRequirement"}},"matchLabels":{"description":"matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is \"key\", the operator is \"In\", and the values array contains only \"value\". The requirements are ANDed.","type":"object","additionalProperties":{"type":"string","default":""}}},"x-kubernetes-map-type":"atomic"},"io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelectorRequirement":{"description":"A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.","type":"object","required":["key","operator"],"properties":{"key":{"description":"key is the label key that the selector applies to.","type":"string","default":"","x-kubernetes-patch-merge-key":"key","x-kubernetes-patch-strategy":"merge"},"operator":{"description":"operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.","type":"string","default":""},"values":{"description":"values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.","type":"array","items":{"type":"string","default":""}}}},"io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta":{"description":"ListMeta describes metadata that synthetic resources must have, including lists and various status objects. A resource may have only one of {ObjectMeta, ListMeta}.","type":"object","properties":{"continue":{"description":"continue may be set if the user set a limit on the number of items returned, and indicates that the server has more data available. The value is opaque and may be used to issue another request to the endpoint that served this list to retrieve the next set of available objects. Continuing a consistent list may not be possible if the server configuration has changed or more than a few minutes have passed. The resourceVersion field returned when using this continue value will be identical to the value in the first response, unless you have received this token from an error message.","type":"string"},"remainingItemCount":{"description":"remainingItemCount is the number of subsequent items in the list which are not included in this list response. If the list request contained label or field selectors, then the number of remaining items is unknown and the field will be left unset and omitted during serialization. If the list is complete (either because it is not chunking or because this is the last chunk), then there are no more remaining items and this field will be left unset and omitted during serialization. Servers older than v1.15 do not set this field. The intended use of the remainingItemCount is *estimating* the size of a collection. Clients should not rely on the remainingItemCount to be set or to be exact.","type":"integer","format":"int64"},"resourceVersion":{"description":"String that identifies the server's internal version of this object that can be used by clients to determine when objects have changed. Value must be treated as opaque by clients and passed unmodified back to the server. Populated by the system. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency","type":"string"},"selfLink":{"description":"selfLink is DEPRECATED read-only field that is no longer populated by the system.","type":"string"}}},"io.k8s.apimachinery.pkg.apis.meta.v1.ManagedFieldsEntry":{"description":"ManagedFieldsEntry is a workflow-id, a FieldSet and the group version of the resource that the fieldset applies to.","type":"object","properties":{"apiVersion":{"description":"APIVersion defines the version of this resource that this field set applies to. The format is \"group/version\" just like the top-level APIVersion field. It is necessary to track the version of a field set because it cannot be automatically converted.","type":"string"},"fieldsType":{"description":"FieldsType is the discriminator for the different fields format and version. There is currently only one possible value: \"FieldsV1\"","type":"string"},"fieldsV1":{"description":"FieldsV1 holds the first JSON version format as described in the \"FieldsV1\" type.","$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.FieldsV1"},"manager":{"description":"Manager is an identifier of the workflow managing these fields.","type":"string"},"operation":{"description":"Operation is the type of operation which lead to this ManagedFieldsEntry being created. The only valid values for this field are 'Apply' and 'Update'.","type":"string"},"subresource":{"description":"Subresource is the name of the subresource used to update that object, or empty string if the object was updated through the main resource. The value of this field is used to distinguish between managers, even if they share the same name. For example, a status update will be distinct from a regular update using the same manager name. Note that the APIVersion field is not related to the Subresource field and it always corresponds to the version of the main resource.","type":"string"},"time":{"description":"Time is the timestamp of when the ManagedFields entry was added. The timestamp will also be updated if a field is added, the manager changes any of the owned fields value or removes a field. The timestamp does not update when a field is removed from the entry because another manager took it over.","$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time"}}},"io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta":{"description":"ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create.","type":"object","properties":{"annotations":{"description":"Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations","type":"object","additionalProperties":{"type":"string","default":""}},"clusterName":{"description":"The name of the cluster which the object belongs to. This is used to distinguish resources with same name and namespace in different clusters. This field is not set anywhere right now and apiserver is going to ignore it if set in create or update request.","type":"string"},"creationTimestamp":{"description":"CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC.\n\nPopulated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata","default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time"},"deletionGracePeriodSeconds":{"description":"Number of seconds allowed for this object to gracefully terminate before it will be removed from the system. Only set when deletionTimestamp is also set. May only be shortened. Read-only.","type":"integer","format":"int64"},"deletionTimestamp":{"description":"DeletionTimestamp is RFC 3339 date and time at which this resource will be deleted. This field is set by the server when a graceful deletion is requested by the user, and is not directly settable by a client. The resource is expected to be deleted (no longer visible from resource lists, and not reachable by name) after the time in this field, once the finalizers list is empty. As long as the finalizers list contains items, deletion is blocked. Once the deletionTimestamp is set, this value may not be unset or be set further into the future, although it may be shortened or the resource may be deleted prior to this time. For example, a user may request that a pod is deleted in 30 seconds. The Kubelet will react by sending a graceful termination signal to the containers in the pod. After that 30 seconds, the Kubelet will send a hard termination signal (SIGKILL) to the container and after cleanup, remove the pod from the API. In the presence of network partitions, this object may still exist after this timestamp, until an administrator or automated process can determine the resource is fully terminated. If not set, graceful deletion of the object has not been requested.\n\nPopulated by the system when a graceful deletion is requested. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata","$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time"},"finalizers":{"description":"Must be empty before the object is deleted from the registry. Each entry is an identifier for the responsible component that will remove the entry from the list. If the deletionTimestamp of the object is non-nil, entries in this list can only be removed. Finalizers may be processed and removed in any order. Order is NOT enforced because it introduces significant risk of stuck finalizers. finalizers is a shared field, any actor with permission can reorder it. If the finalizer list is processed in order, then this can lead to a situation in which the component responsible for the first finalizer in the list is waiting for a signal (field value, external system, or other) produced by a component responsible for a finalizer later in the list, resulting in a deadlock. Without enforced ordering finalizers are free to order amongst themselves and are not vulnerable to ordering changes in the list.","type":"array","items":{"type":"string","default":""},"x-kubernetes-patch-strategy":"merge"},"generateName":{"description":"GenerateName is an optional prefix, used by the server, to generate a unique name ONLY IF the Name field has not been provided. If this field is used, the name returned to the client will be different than the name passed. This value will also be combined with a unique suffix. The provided value has the same validation rules as the Name field, and may be truncated by the length of the suffix required to make the value unique on the server.\n\nIf this field is specified and the generated name exists, the server will NOT return a 409 - instead, it will either return 201 Created or 500 with Reason ServerTimeout indicating a unique name could not be found in the time allotted, and the client should retry (optionally after the time indicated in the Retry-After header).\n\nApplied only if Name is not specified. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#idempotency","type":"string"},"generation":{"description":"A sequence number representing a specific generation of the desired state. Populated by the system. Read-only.","type":"integer","format":"int64"},"labels":{"description":"Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels","type":"object","additionalProperties":{"type":"string","default":""}},"managedFields":{"description":"ManagedFields maps workflow-id and version to the set of fields that are managed by that workflow. This is mostly for internal housekeeping, and users typically shouldn't need to set or understand this field. A workflow can be the user's name, a controller's name, or the name of a specific apply path like \"ci-cd\". The set of fields is always in the version that the workflow used when modifying the object.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ManagedFieldsEntry"}},"name":{"description":"Name must be unique within a namespace. Is required when creating resources, although some resources may allow a client to request the generation of an appropriate name automatically. Name is primarily intended for creation idempotence and configuration definition. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#names","type":"string"},"namespace":{"description":"Namespace defines the space within which each name must be unique. An empty namespace is equivalent to the \"default\" namespace, but \"default\" is the canonical representation. Not all objects are required to be scoped to a namespace - the value of this field for those objects will be empty.\n\nMust be a DNS_LABEL. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces","type":"string"},"ownerReferences":{"description":"List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, then an entry in this list will point to this controller, with the controller field set to true. There cannot be more than one managing controller.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.OwnerReference"},"x-kubernetes-patch-merge-key":"uid","x-kubernetes-patch-strategy":"merge"},"resourceVersion":{"description":"An opaque value that represents the internal version of this object that can be used by clients to determine when objects have changed. May be used for optimistic concurrency, change detection, and the watch operation on a resource or set of resources. Clients must treat these values as opaque and passed unmodified back to the server. They may only be valid for a particular resource or set of resources.\n\nPopulated by the system. Read-only. Value must be treated as opaque by clients and . More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency","type":"string"},"selfLink":{"description":"selfLink is DEPRECATED read-only field that is no longer populated by the system.","type":"string"},"uid":{"description":"UID is the unique in time and space value for this object. It is typically generated by the server on successful creation of a resource and is not allowed to change on PUT operations.\n\nPopulated by the system. Read-only. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#uids","type":"string"}}},"io.k8s.apimachinery.pkg.apis.meta.v1.OwnerReference":{"description":"OwnerReference contains enough information to let you identify an owning object. An owning object must be in the same namespace as the dependent, or be cluster-scoped, so there is no namespace field.","type":"object","required":["apiVersion","kind","name","uid"],"properties":{"apiVersion":{"description":"API version of the referent.","type":"string","default":""},"blockOwnerDeletion":{"description":"If true, AND if the owner has the \"foregroundDeletion\" finalizer, then the owner cannot be deleted from the key-value store until this reference is removed. See https://kubernetes.io/docs/concepts/architecture/garbage-collection/#foreground-deletion for how the garbage collector interacts with this field and enforces the foreground deletion. Defaults to false. To set this field, a user needs \"delete\" permission of the owner, otherwise 422 (Unprocessable Entity) will be returned.","type":"boolean"},"controller":{"description":"If true, this reference points to the managing controller.","type":"boolean"},"kind":{"description":"Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds","type":"string","default":""},"name":{"description":"Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#names","type":"string","default":""},"uid":{"description":"UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#uids","type":"string","default":""}},"x-kubernetes-map-type":"atomic"},"io.k8s.apimachinery.pkg.apis.meta.v1.Patch":{"description":"Patch is provided to give a concrete name and type to the Kubernetes PATCH request body.","type":"object"},"io.k8s.apimachinery.pkg.apis.meta.v1.Preconditions":{"description":"Preconditions must be fulfilled before an operation (update, delete, etc.) is carried out.","type":"object","properties":{"resourceVersion":{"description":"Specifies the target ResourceVersion","type":"string"},"uid":{"description":"Specifies the target UID.","type":"string"}}},"io.k8s.apimachinery.pkg.apis.meta.v1.Status":{"description":"Status is a return value for calls that don't return other objects.","type":"object","properties":{"apiVersion":{"description":"APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources","type":"string"},"code":{"description":"Suggested HTTP return code for this status, 0 if not set.","type":"integer","format":"int32"},"details":{"description":"Extended data associated with the reason. Each reason may define its own extended details. This field is optional and the data returned is not guaranteed to conform to any schema except that defined by the reason type.","$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.StatusDetails"},"kind":{"description":"Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds","type":"string"},"message":{"description":"A human-readable description of the status of this operation.","type":"string"},"metadata":{"description":"Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds","default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta"},"reason":{"description":"A machine-readable description of why this operation is in the \"Failure\" status. If this value is empty there is no information available. A Reason clarifies an HTTP status code but does not override it.","type":"string"},"status":{"description":"Status of the operation. One of: \"Success\" or \"Failure\". More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status","type":"string"}},"x-kubernetes-group-version-kind":[{"group":"","kind":"Status","version":"v1"}]},"io.k8s.apimachinery.pkg.apis.meta.v1.StatusCause":{"description":"StatusCause provides more information about an api.Status failure, including cases when multiple errors are encountered.","type":"object","properties":{"field":{"description":"The field of the resource that has caused this error, as named by its JSON serialization. May include dot and postfix notation for nested attributes. Arrays are zero-indexed. Fields may appear more than once in an array of causes due to fields having multiple errors. Optional.\n\nExamples:\n \"name\" - the field \"name\" on the current resource\n \"items[0].name\" - the field \"name\" on the first array entry in \"items\"","type":"string"},"message":{"description":"A human-readable description of the cause of the error. This field may be presented as-is to a reader.","type":"string"},"reason":{"description":"A machine-readable description of the cause of the error. If this value is empty there is no information available.","type":"string"}}},"io.k8s.apimachinery.pkg.apis.meta.v1.StatusDetails":{"description":"StatusDetails is a set of additional properties that MAY be set by the server to provide additional information about a response. The Reason field of a Status object defines what attributes will be set. Clients must ignore fields that do not match the defined type of each attribute, and should assume that any attribute may be empty, invalid, or under defined.","type":"object","properties":{"causes":{"description":"The Causes array includes more details associated with the StatusReason failure. Not all StatusReasons may provide detailed causes.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.StatusCause"}},"group":{"description":"The group attribute of the resource associated with the status StatusReason.","type":"string"},"kind":{"description":"The kind attribute of the resource associated with the status StatusReason. On some operations may differ from the requested resource Kind. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds","type":"string"},"name":{"description":"The name attribute of the resource associated with the status StatusReason (when there is a single name which can be described).","type":"string"},"retryAfterSeconds":{"description":"If specified, the time in seconds before the operation should be retried. Some errors may indicate the client must take an alternate action - for those errors this field may indicate how long to wait before taking the alternate action.","type":"integer","format":"int32"},"uid":{"description":"UID of the resource. (when there is a single resource which can be described). More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#uids","type":"string"}}},"io.k8s.apimachinery.pkg.apis.meta.v1.Time":{"description":"Time is a wrapper around time.Time which supports correct marshaling to YAML and JSON. Wrappers are provided for many of the factory methods that the time package offers.","type":"string","format":"date-time"},"io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent":{"description":"Event represents a single event to a watched resource.","type":"object","required":["type","object"],"properties":{"object":{"description":"Object is:\n * If Type is Added or Modified: the new state of the object.\n * If Type is Deleted: the state of the object immediately before deletion.\n * If Type is Error: *Status is recommended; other types may make sense\n depending on context.","default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.runtime.RawExtension"},"type":{"type":"string","default":""}},"x-kubernetes-group-version-kind":[{"group":"","kind":"WatchEvent","version":"v1"},{"group":"admission.k8s.io","kind":"WatchEvent","version":"v1"},{"group":"admission.k8s.io","kind":"WatchEvent","version":"v1beta1"},{"group":"admissionregistration.k8s.io","kind":"WatchEvent","version":"v1"},{"group":"admissionregistration.k8s.io","kind":"WatchEvent","version":"v1beta1"},{"group":"apiextensions.k8s.io","kind":"WatchEvent","version":"v1"},{"group":"apiextensions.k8s.io","kind":"WatchEvent","version":"v1beta1"},{"group":"apiregistration.k8s.io","kind":"WatchEvent","version":"v1"},{"group":"apiregistration.k8s.io","kind":"WatchEvent","version":"v1beta1"},{"group":"apps","kind":"WatchEvent","version":"v1"},{"group":"apps","kind":"WatchEvent","version":"v1beta1"},{"group":"apps","kind":"WatchEvent","version":"v1beta2"},{"group":"authentication.k8s.io","kind":"WatchEvent","version":"v1"},{"group":"authentication.k8s.io","kind":"WatchEvent","version":"v1beta1"},{"group":"authorization.k8s.io","kind":"WatchEvent","version":"v1"},{"group":"authorization.k8s.io","kind":"WatchEvent","version":"v1beta1"},{"group":"autoscaling","kind":"WatchEvent","version":"v1"},{"group":"autoscaling","kind":"WatchEvent","version":"v2"},{"group":"autoscaling","kind":"WatchEvent","version":"v2beta1"},{"group":"autoscaling","kind":"WatchEvent","version":"v2beta2"},{"group":"batch","kind":"WatchEvent","version":"v1"},{"group":"batch","kind":"WatchEvent","version":"v1beta1"},{"group":"certificates.k8s.io","kind":"WatchEvent","version":"v1"},{"group":"certificates.k8s.io","kind":"WatchEvent","version":"v1beta1"},{"group":"coordination.k8s.io","kind":"WatchEvent","version":"v1"},{"group":"coordination.k8s.io","kind":"WatchEvent","version":"v1beta1"},{"group":"discovery.k8s.io","kind":"WatchEvent","version":"v1"},{"group":"discovery.k8s.io","kind":"WatchEvent","version":"v1beta1"},{"group":"events.k8s.io","kind":"WatchEvent","version":"v1"},{"group":"events.k8s.io","kind":"WatchEvent","version":"v1beta1"},{"group":"extensions","kind":"WatchEvent","version":"v1beta1"},{"group":"flowcontrol.apiserver.k8s.io","kind":"WatchEvent","version":"v1alpha1"},{"group":"flowcontrol.apiserver.k8s.io","kind":"WatchEvent","version":"v1beta1"},{"group":"flowcontrol.apiserver.k8s.io","kind":"WatchEvent","version":"v1beta2"},{"group":"imagepolicy.k8s.io","kind":"WatchEvent","version":"v1alpha1"},{"group":"internal.apiserver.k8s.io","kind":"WatchEvent","version":"v1alpha1"},{"group":"networking.k8s.io","kind":"WatchEvent","version":"v1"},{"group":"networking.k8s.io","kind":"WatchEvent","version":"v1beta1"},{"group":"node.k8s.io","kind":"WatchEvent","version":"v1"},{"group":"node.k8s.io","kind":"WatchEvent","version":"v1alpha1"},{"group":"node.k8s.io","kind":"WatchEvent","version":"v1beta1"},{"group":"policy","kind":"WatchEvent","version":"v1"},{"group":"policy","kind":"WatchEvent","version":"v1beta1"},{"group":"rbac.authorization.k8s.io","kind":"WatchEvent","version":"v1"},{"group":"rbac.authorization.k8s.io","kind":"WatchEvent","version":"v1alpha1"},{"group":"rbac.authorization.k8s.io","kind":"WatchEvent","version":"v1beta1"},{"group":"scheduling.k8s.io","kind":"WatchEvent","version":"v1"},{"group":"scheduling.k8s.io","kind":"WatchEvent","version":"v1alpha1"},{"group":"scheduling.k8s.io","kind":"WatchEvent","version":"v1beta1"},{"group":"storage.k8s.io","kind":"WatchEvent","version":"v1"},{"group":"storage.k8s.io","kind":"WatchEvent","version":"v1alpha1"},{"group":"storage.k8s.io","kind":"WatchEvent","version":"v1beta1"}]},"io.k8s.apimachinery.pkg.runtime.RawExtension":{"description":"RawExtension is used to hold extensions in external versions.\n\nTo use this, make a field which has RawExtension as its type in your external, versioned struct, and Object in your internal struct. You also need to register your various plugin types.\n\n// Internal package: type MyAPIObject struct {\n\truntime.TypeMeta `json:\",inline\"`\n\tMyPlugin runtime.Object `json:\"myPlugin\"`\n} type PluginA struct {\n\tAOption string `json:\"aOption\"`\n}\n\n// External package: type MyAPIObject struct {\n\truntime.TypeMeta `json:\",inline\"`\n\tMyPlugin runtime.RawExtension `json:\"myPlugin\"`\n} type PluginA struct {\n\tAOption string `json:\"aOption\"`\n}\n\n// On the wire, the JSON will look something like this: {\n\t\"kind\":\"MyAPIObject\",\n\t\"apiVersion\":\"v1\",\n\t\"myPlugin\": {\n\t\t\"kind\":\"PluginA\",\n\t\t\"aOption\":\"foo\",\n\t},\n}\n\nSo what happens? Decode first uses json or yaml to unmarshal the serialized data into your external MyAPIObject. That causes the raw JSON to be stored, but not unpacked. The next step is to copy (using pkg/conversion) into the internal struct. The runtime package's DefaultScheme has conversion functions installed which will unpack the JSON stored in RawExtension, turning it into the correct object type, and storing it in the Object. (TODO: In the case where the object is of an unknown type, a runtime.Unknown object will be created and stored.)","type":"object"},"io.k8s.apimachinery.pkg.util.intstr.IntOrString":{"description":"IntOrString is a type that can hold an int32 or a string. When used in JSON or YAML marshalling and unmarshalling, it produces or consumes the inner type. This allows you to have, for example, a JSON field that can accept a name or number.","type":"string","format":"int-or-string"}}}} +{"openapi":"3.0.0","info":{"title":"Kubernetes","version":"v1.24.0"},"paths":{"/apis/batch/v1/":{"get":{"tags":["batch_v1"],"description":"get available resources","operationId":"getBatchV1APIResources","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.APIResourceList"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.APIResourceList"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.APIResourceList"}}}}}}},"/apis/batch/v1/cronjobs":{"get":{"tags":["batch_v1"],"description":"list or watch objects of kind CronJob","operationId":"listBatchV1CronJobForAllNamespaces","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJobList"}},"application/json;stream=watch":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJobList"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJobList"}},"application/vnd.kubernetes.protobuf;stream=watch":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJobList"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJobList"}}}}}},"parameters":[{"name":"allowWatchBookmarks","in":"query","description":"allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.","schema":{"type":"boolean","uniqueItems":true}},{"name":"continue","in":"query","description":"The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.","schema":{"type":"string","uniqueItems":true}},{"name":"fieldSelector","in":"query","description":"A selector to restrict the list of returned objects by their fields. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"labelSelector","in":"query","description":"A selector to restrict the list of returned objects by their labels. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"limit","in":"query","description":"limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.","schema":{"type":"integer","uniqueItems":true}},{"name":"pretty","in":"query","description":"If 'true', then the output is pretty printed.","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersion","in":"query","description":"resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersionMatch","in":"query","description":"resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"timeoutSeconds","in":"query","description":"Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.","schema":{"type":"integer","uniqueItems":true}},{"name":"watch","in":"query","description":"Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.","schema":{"type":"boolean","uniqueItems":true}}]},"/apis/batch/v1/jobs":{"get":{"tags":["batch_v1"],"description":"list or watch objects of kind Job","operationId":"listBatchV1JobForAllNamespaces","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.JobList"}},"application/json;stream=watch":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.JobList"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.JobList"}},"application/vnd.kubernetes.protobuf;stream=watch":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.JobList"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.JobList"}}}}}},"parameters":[{"name":"allowWatchBookmarks","in":"query","description":"allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.","schema":{"type":"boolean","uniqueItems":true}},{"name":"continue","in":"query","description":"The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.","schema":{"type":"string","uniqueItems":true}},{"name":"fieldSelector","in":"query","description":"A selector to restrict the list of returned objects by their fields. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"labelSelector","in":"query","description":"A selector to restrict the list of returned objects by their labels. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"limit","in":"query","description":"limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.","schema":{"type":"integer","uniqueItems":true}},{"name":"pretty","in":"query","description":"If 'true', then the output is pretty printed.","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersion","in":"query","description":"resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersionMatch","in":"query","description":"resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"timeoutSeconds","in":"query","description":"Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.","schema":{"type":"integer","uniqueItems":true}},{"name":"watch","in":"query","description":"Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.","schema":{"type":"boolean","uniqueItems":true}}]},"/apis/batch/v1/namespaces/{namespace}/cronjobs":{"get":{"tags":["batch_v1"],"description":"list or watch objects of kind CronJob","operationId":"listBatchV1NamespacedCronJob","parameters":[{"name":"labelSelector","in":"query","description":"A selector to restrict the list of returned objects by their labels. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"fieldSelector","in":"query","description":"A selector to restrict the list of returned objects by their fields. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"watch","in":"query","description":"Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.","schema":{"type":"boolean","uniqueItems":true}},{"name":"allowWatchBookmarks","in":"query","description":"allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.","schema":{"type":"boolean","uniqueItems":true}},{"name":"resourceVersion","in":"query","description":"resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersionMatch","in":"query","description":"resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"timeoutSeconds","in":"query","description":"Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.","schema":{"type":"integer","uniqueItems":true}},{"name":"limit","in":"query","description":"limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.","schema":{"type":"integer","uniqueItems":true}},{"name":"continue","in":"query","description":"The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.","schema":{"type":"string","uniqueItems":true}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJobList"}},"application/json;stream=watch":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJobList"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJobList"}},"application/vnd.kubernetes.protobuf;stream=watch":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJobList"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJobList"}}}}}},"post":{"tags":["batch_v1"],"description":"create a CronJob","operationId":"createBatchV1NamespacedCronJob","parameters":[{"name":"dryRun","in":"query","description":"When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed","schema":{"type":"string","uniqueItems":true}},{"name":"fieldManager","in":"query","description":"fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.","schema":{"type":"string","uniqueItems":true}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}}}},"202":{"description":"Accepted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}}}}}},"delete":{"tags":["batch_v1"],"description":"delete collection of CronJob","operationId":"deleteBatchV1CollectionNamespacedCronJob","parameters":[{"name":"gracePeriodSeconds","in":"query","description":"The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.","schema":{"type":"integer","uniqueItems":true}},{"name":"orphanDependents","in":"query","description":"Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.","schema":{"type":"boolean","uniqueItems":true}},{"name":"propagationPolicy","in":"query","description":"Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.","schema":{"type":"string","uniqueItems":true}},{"name":"dryRun","in":"query","description":"When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed","schema":{"type":"string","uniqueItems":true}},{"name":"labelSelector","in":"query","description":"A selector to restrict the list of returned objects by their labels. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"fieldSelector","in":"query","description":"A selector to restrict the list of returned objects by their fields. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersion","in":"query","description":"resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersionMatch","in":"query","description":"resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"timeoutSeconds","in":"query","description":"Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.","schema":{"type":"integer","uniqueItems":true}},{"name":"limit","in":"query","description":"limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.","schema":{"type":"integer","uniqueItems":true}},{"name":"continue","in":"query","description":"The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.","schema":{"type":"string","uniqueItems":true}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status"}}}}}},"parameters":[{"name":"namespace","in":"path","description":"object name and auth scope, such as for teams and projects","required":true,"schema":{"type":"string","uniqueItems":true}},{"name":"pretty","in":"query","description":"If 'true', then the output is pretty printed.","schema":{"type":"string","uniqueItems":true}}]},"/apis/batch/v1/namespaces/{namespace}/cronjobs/{name}":{"get":{"tags":["batch_v1"],"description":"read the specified CronJob","operationId":"readBatchV1NamespacedCronJob","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}}}}}},"put":{"tags":["batch_v1"],"description":"replace the specified CronJob","operationId":"replaceBatchV1NamespacedCronJob","parameters":[{"name":"dryRun","in":"query","description":"When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed","schema":{"type":"string","uniqueItems":true}},{"name":"fieldManager","in":"query","description":"fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.","schema":{"type":"string","uniqueItems":true}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}}}}}},"delete":{"tags":["batch_v1"],"description":"delete a CronJob","operationId":"deleteBatchV1NamespacedCronJob","parameters":[{"name":"gracePeriodSeconds","in":"query","description":"The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.","schema":{"type":"integer","uniqueItems":true}},{"name":"orphanDependents","in":"query","description":"Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.","schema":{"type":"boolean","uniqueItems":true}},{"name":"propagationPolicy","in":"query","description":"Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.","schema":{"type":"string","uniqueItems":true}},{"name":"dryRun","in":"query","description":"When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed","schema":{"type":"string","uniqueItems":true}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status"}}}},"202":{"description":"Accepted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status"}}}}}},"patch":{"tags":["batch_v1"],"description":"partially update the specified CronJob","operationId":"patchBatchV1NamespacedCronJob","parameters":[{"name":"dryRun","in":"query","description":"When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed","schema":{"type":"string","uniqueItems":true}},{"name":"force","in":"query","description":"Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.","schema":{"type":"boolean","uniqueItems":true}},{"name":"fieldManager","in":"query","description":"fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).","schema":{"type":"string","uniqueItems":true}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}}}}}},"parameters":[{"name":"name","in":"path","description":"name of the CronJob","required":true,"schema":{"type":"string","uniqueItems":true}},{"name":"namespace","in":"path","description":"object name and auth scope, such as for teams and projects","required":true,"schema":{"type":"string","uniqueItems":true}},{"name":"pretty","in":"query","description":"If 'true', then the output is pretty printed.","schema":{"type":"string","uniqueItems":true}}]},"/apis/batch/v1/namespaces/{namespace}/cronjobs/{name}/status":{"get":{"tags":["batch_v1"],"description":"read status of the specified CronJob","operationId":"readBatchV1NamespacedCronJobStatus","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}}}}}},"put":{"tags":["batch_v1"],"description":"replace status of the specified CronJob","operationId":"replaceBatchV1NamespacedCronJobStatus","parameters":[{"name":"dryRun","in":"query","description":"When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed","schema":{"type":"string","uniqueItems":true}},{"name":"fieldManager","in":"query","description":"fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.","schema":{"type":"string","uniqueItems":true}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}}}}}},"patch":{"tags":["batch_v1"],"description":"partially update status of the specified CronJob","operationId":"patchBatchV1NamespacedCronJobStatus","parameters":[{"name":"dryRun","in":"query","description":"When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed","schema":{"type":"string","uniqueItems":true}},{"name":"force","in":"query","description":"Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.","schema":{"type":"boolean","uniqueItems":true}},{"name":"fieldManager","in":"query","description":"fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).","schema":{"type":"string","uniqueItems":true}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}}}}}},"parameters":[{"name":"name","in":"path","description":"name of the CronJob","required":true,"schema":{"type":"string","uniqueItems":true}},{"name":"namespace","in":"path","description":"object name and auth scope, such as for teams and projects","required":true,"schema":{"type":"string","uniqueItems":true}},{"name":"pretty","in":"query","description":"If 'true', then the output is pretty printed.","schema":{"type":"string","uniqueItems":true}}]},"/apis/batch/v1/namespaces/{namespace}/jobs":{"get":{"tags":["batch_v1"],"description":"list or watch objects of kind Job","operationId":"listBatchV1NamespacedJob","parameters":[{"name":"labelSelector","in":"query","description":"A selector to restrict the list of returned objects by their labels. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"fieldSelector","in":"query","description":"A selector to restrict the list of returned objects by their fields. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"watch","in":"query","description":"Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.","schema":{"type":"boolean","uniqueItems":true}},{"name":"allowWatchBookmarks","in":"query","description":"allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.","schema":{"type":"boolean","uniqueItems":true}},{"name":"resourceVersion","in":"query","description":"resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersionMatch","in":"query","description":"resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"timeoutSeconds","in":"query","description":"Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.","schema":{"type":"integer","uniqueItems":true}},{"name":"limit","in":"query","description":"limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.","schema":{"type":"integer","uniqueItems":true}},{"name":"continue","in":"query","description":"The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.","schema":{"type":"string","uniqueItems":true}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.JobList"}},"application/json;stream=watch":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.JobList"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.JobList"}},"application/vnd.kubernetes.protobuf;stream=watch":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.JobList"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.JobList"}}}}}},"post":{"tags":["batch_v1"],"description":"create a Job","operationId":"createBatchV1NamespacedJob","parameters":[{"name":"dryRun","in":"query","description":"When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed","schema":{"type":"string","uniqueItems":true}},{"name":"fieldManager","in":"query","description":"fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.","schema":{"type":"string","uniqueItems":true}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}}}},"202":{"description":"Accepted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}}}}}},"delete":{"tags":["batch_v1"],"description":"delete collection of Job","operationId":"deleteBatchV1CollectionNamespacedJob","parameters":[{"name":"gracePeriodSeconds","in":"query","description":"The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.","schema":{"type":"integer","uniqueItems":true}},{"name":"orphanDependents","in":"query","description":"Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.","schema":{"type":"boolean","uniqueItems":true}},{"name":"propagationPolicy","in":"query","description":"Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.","schema":{"type":"string","uniqueItems":true}},{"name":"dryRun","in":"query","description":"When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed","schema":{"type":"string","uniqueItems":true}},{"name":"labelSelector","in":"query","description":"A selector to restrict the list of returned objects by their labels. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"fieldSelector","in":"query","description":"A selector to restrict the list of returned objects by their fields. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersion","in":"query","description":"resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersionMatch","in":"query","description":"resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"timeoutSeconds","in":"query","description":"Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.","schema":{"type":"integer","uniqueItems":true}},{"name":"limit","in":"query","description":"limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.","schema":{"type":"integer","uniqueItems":true}},{"name":"continue","in":"query","description":"The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.","schema":{"type":"string","uniqueItems":true}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status"}}}}}},"parameters":[{"name":"namespace","in":"path","description":"object name and auth scope, such as for teams and projects","required":true,"schema":{"type":"string","uniqueItems":true}},{"name":"pretty","in":"query","description":"If 'true', then the output is pretty printed.","schema":{"type":"string","uniqueItems":true}}]},"/apis/batch/v1/namespaces/{namespace}/jobs/{name}":{"get":{"tags":["batch_v1"],"description":"read the specified Job","operationId":"readBatchV1NamespacedJob","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}}}}}},"put":{"tags":["batch_v1"],"description":"replace the specified Job","operationId":"replaceBatchV1NamespacedJob","parameters":[{"name":"dryRun","in":"query","description":"When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed","schema":{"type":"string","uniqueItems":true}},{"name":"fieldManager","in":"query","description":"fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.","schema":{"type":"string","uniqueItems":true}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}}}}}},"delete":{"tags":["batch_v1"],"description":"delete a Job","operationId":"deleteBatchV1NamespacedJob","parameters":[{"name":"gracePeriodSeconds","in":"query","description":"The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.","schema":{"type":"integer","uniqueItems":true}},{"name":"orphanDependents","in":"query","description":"Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.","schema":{"type":"boolean","uniqueItems":true}},{"name":"propagationPolicy","in":"query","description":"Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.","schema":{"type":"string","uniqueItems":true}},{"name":"dryRun","in":"query","description":"When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed","schema":{"type":"string","uniqueItems":true}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status"}}}},"202":{"description":"Accepted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status"}}}}}},"patch":{"tags":["batch_v1"],"description":"partially update the specified Job","operationId":"patchBatchV1NamespacedJob","parameters":[{"name":"dryRun","in":"query","description":"When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed","schema":{"type":"string","uniqueItems":true}},{"name":"force","in":"query","description":"Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.","schema":{"type":"boolean","uniqueItems":true}},{"name":"fieldManager","in":"query","description":"fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).","schema":{"type":"string","uniqueItems":true}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}}}}}},"parameters":[{"name":"name","in":"path","description":"name of the Job","required":true,"schema":{"type":"string","uniqueItems":true}},{"name":"namespace","in":"path","description":"object name and auth scope, such as for teams and projects","required":true,"schema":{"type":"string","uniqueItems":true}},{"name":"pretty","in":"query","description":"If 'true', then the output is pretty printed.","schema":{"type":"string","uniqueItems":true}}]},"/apis/batch/v1/namespaces/{namespace}/jobs/{name}/status":{"get":{"tags":["batch_v1"],"description":"read status of the specified Job","operationId":"readBatchV1NamespacedJobStatus","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}}}}}},"put":{"tags":["batch_v1"],"description":"replace status of the specified Job","operationId":"replaceBatchV1NamespacedJobStatus","parameters":[{"name":"dryRun","in":"query","description":"When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed","schema":{"type":"string","uniqueItems":true}},{"name":"fieldManager","in":"query","description":"fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.","schema":{"type":"string","uniqueItems":true}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}}}}}},"patch":{"tags":["batch_v1"],"description":"partially update status of the specified Job","operationId":"patchBatchV1NamespacedJobStatus","parameters":[{"name":"dryRun","in":"query","description":"When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed","schema":{"type":"string","uniqueItems":true}},{"name":"force","in":"query","description":"Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.","schema":{"type":"boolean","uniqueItems":true}},{"name":"fieldManager","in":"query","description":"fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).","schema":{"type":"string","uniqueItems":true}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}}}}}},"parameters":[{"name":"name","in":"path","description":"name of the Job","required":true,"schema":{"type":"string","uniqueItems":true}},{"name":"namespace","in":"path","description":"object name and auth scope, such as for teams and projects","required":true,"schema":{"type":"string","uniqueItems":true}},{"name":"pretty","in":"query","description":"If 'true', then the output is pretty printed.","schema":{"type":"string","uniqueItems":true}}]},"/apis/batch/v1/watch/cronjobs":{"get":{"tags":["batch_v1"],"description":"watch individual changes to a list of CronJob. deprecated: use the 'watch' parameter with a list operation instead.","operationId":"watchBatchV1CronJobListForAllNamespaces","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/json;stream=watch":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/vnd.kubernetes.protobuf;stream=watch":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}}}}}},"parameters":[{"name":"allowWatchBookmarks","in":"query","description":"allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.","schema":{"type":"boolean","uniqueItems":true}},{"name":"continue","in":"query","description":"The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.","schema":{"type":"string","uniqueItems":true}},{"name":"fieldSelector","in":"query","description":"A selector to restrict the list of returned objects by their fields. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"labelSelector","in":"query","description":"A selector to restrict the list of returned objects by their labels. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"limit","in":"query","description":"limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.","schema":{"type":"integer","uniqueItems":true}},{"name":"pretty","in":"query","description":"If 'true', then the output is pretty printed.","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersion","in":"query","description":"resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersionMatch","in":"query","description":"resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"timeoutSeconds","in":"query","description":"Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.","schema":{"type":"integer","uniqueItems":true}},{"name":"watch","in":"query","description":"Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.","schema":{"type":"boolean","uniqueItems":true}}]},"/apis/batch/v1/watch/jobs":{"get":{"tags":["batch_v1"],"description":"watch individual changes to a list of Job. deprecated: use the 'watch' parameter with a list operation instead.","operationId":"watchBatchV1JobListForAllNamespaces","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/json;stream=watch":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/vnd.kubernetes.protobuf;stream=watch":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}}}}}},"parameters":[{"name":"allowWatchBookmarks","in":"query","description":"allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.","schema":{"type":"boolean","uniqueItems":true}},{"name":"continue","in":"query","description":"The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.","schema":{"type":"string","uniqueItems":true}},{"name":"fieldSelector","in":"query","description":"A selector to restrict the list of returned objects by their fields. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"labelSelector","in":"query","description":"A selector to restrict the list of returned objects by their labels. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"limit","in":"query","description":"limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.","schema":{"type":"integer","uniqueItems":true}},{"name":"pretty","in":"query","description":"If 'true', then the output is pretty printed.","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersion","in":"query","description":"resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersionMatch","in":"query","description":"resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"timeoutSeconds","in":"query","description":"Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.","schema":{"type":"integer","uniqueItems":true}},{"name":"watch","in":"query","description":"Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.","schema":{"type":"boolean","uniqueItems":true}}]},"/apis/batch/v1/watch/namespaces/{namespace}/cronjobs":{"get":{"tags":["batch_v1"],"description":"watch individual changes to a list of CronJob. deprecated: use the 'watch' parameter with a list operation instead.","operationId":"watchBatchV1NamespacedCronJobList","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/json;stream=watch":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/vnd.kubernetes.protobuf;stream=watch":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}}}}}},"parameters":[{"name":"allowWatchBookmarks","in":"query","description":"allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.","schema":{"type":"boolean","uniqueItems":true}},{"name":"continue","in":"query","description":"The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.","schema":{"type":"string","uniqueItems":true}},{"name":"fieldSelector","in":"query","description":"A selector to restrict the list of returned objects by their fields. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"labelSelector","in":"query","description":"A selector to restrict the list of returned objects by their labels. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"limit","in":"query","description":"limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.","schema":{"type":"integer","uniqueItems":true}},{"name":"namespace","in":"path","description":"object name and auth scope, such as for teams and projects","required":true,"schema":{"type":"string","uniqueItems":true}},{"name":"pretty","in":"query","description":"If 'true', then the output is pretty printed.","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersion","in":"query","description":"resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersionMatch","in":"query","description":"resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"timeoutSeconds","in":"query","description":"Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.","schema":{"type":"integer","uniqueItems":true}},{"name":"watch","in":"query","description":"Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.","schema":{"type":"boolean","uniqueItems":true}}]},"/apis/batch/v1/watch/namespaces/{namespace}/cronjobs/{name}":{"get":{"tags":["batch_v1"],"description":"watch changes to an object of kind CronJob. deprecated: use the 'watch' parameter with a list operation instead, filtered to a single item with the 'fieldSelector' parameter.","operationId":"watchBatchV1NamespacedCronJob","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/json;stream=watch":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/vnd.kubernetes.protobuf;stream=watch":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}}}}}},"parameters":[{"name":"allowWatchBookmarks","in":"query","description":"allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.","schema":{"type":"boolean","uniqueItems":true}},{"name":"continue","in":"query","description":"The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.","schema":{"type":"string","uniqueItems":true}},{"name":"fieldSelector","in":"query","description":"A selector to restrict the list of returned objects by their fields. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"labelSelector","in":"query","description":"A selector to restrict the list of returned objects by their labels. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"limit","in":"query","description":"limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.","schema":{"type":"integer","uniqueItems":true}},{"name":"name","in":"path","description":"name of the CronJob","required":true,"schema":{"type":"string","uniqueItems":true}},{"name":"namespace","in":"path","description":"object name and auth scope, such as for teams and projects","required":true,"schema":{"type":"string","uniqueItems":true}},{"name":"pretty","in":"query","description":"If 'true', then the output is pretty printed.","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersion","in":"query","description":"resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersionMatch","in":"query","description":"resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"timeoutSeconds","in":"query","description":"Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.","schema":{"type":"integer","uniqueItems":true}},{"name":"watch","in":"query","description":"Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.","schema":{"type":"boolean","uniqueItems":true}}]},"/apis/batch/v1/watch/namespaces/{namespace}/jobs":{"get":{"tags":["batch_v1"],"description":"watch individual changes to a list of Job. deprecated: use the 'watch' parameter with a list operation instead.","operationId":"watchBatchV1NamespacedJobList","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/json;stream=watch":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/vnd.kubernetes.protobuf;stream=watch":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}}}}}},"parameters":[{"name":"allowWatchBookmarks","in":"query","description":"allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.","schema":{"type":"boolean","uniqueItems":true}},{"name":"continue","in":"query","description":"The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.","schema":{"type":"string","uniqueItems":true}},{"name":"fieldSelector","in":"query","description":"A selector to restrict the list of returned objects by their fields. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"labelSelector","in":"query","description":"A selector to restrict the list of returned objects by their labels. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"limit","in":"query","description":"limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.","schema":{"type":"integer","uniqueItems":true}},{"name":"namespace","in":"path","description":"object name and auth scope, such as for teams and projects","required":true,"schema":{"type":"string","uniqueItems":true}},{"name":"pretty","in":"query","description":"If 'true', then the output is pretty printed.","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersion","in":"query","description":"resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersionMatch","in":"query","description":"resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"timeoutSeconds","in":"query","description":"Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.","schema":{"type":"integer","uniqueItems":true}},{"name":"watch","in":"query","description":"Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.","schema":{"type":"boolean","uniqueItems":true}}]},"/apis/batch/v1/watch/namespaces/{namespace}/jobs/{name}":{"get":{"tags":["batch_v1"],"description":"watch changes to an object of kind Job. deprecated: use the 'watch' parameter with a list operation instead, filtered to a single item with the 'fieldSelector' parameter.","operationId":"watchBatchV1NamespacedJob","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/json;stream=watch":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/vnd.kubernetes.protobuf;stream=watch":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}}}}}},"parameters":[{"name":"allowWatchBookmarks","in":"query","description":"allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.","schema":{"type":"boolean","uniqueItems":true}},{"name":"continue","in":"query","description":"The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.","schema":{"type":"string","uniqueItems":true}},{"name":"fieldSelector","in":"query","description":"A selector to restrict the list of returned objects by their fields. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"labelSelector","in":"query","description":"A selector to restrict the list of returned objects by their labels. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"limit","in":"query","description":"limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.","schema":{"type":"integer","uniqueItems":true}},{"name":"name","in":"path","description":"name of the Job","required":true,"schema":{"type":"string","uniqueItems":true}},{"name":"namespace","in":"path","description":"object name and auth scope, such as for teams and projects","required":true,"schema":{"type":"string","uniqueItems":true}},{"name":"pretty","in":"query","description":"If 'true', then the output is pretty printed.","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersion","in":"query","description":"resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersionMatch","in":"query","description":"resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"timeoutSeconds","in":"query","description":"Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.","schema":{"type":"integer","uniqueItems":true}},{"name":"watch","in":"query","description":"Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.","schema":{"type":"boolean","uniqueItems":true}}]}},"components":{"schemas":{"io.k8s.api.batch.v1.CronJob":{"description":"CronJob represents the configuration of a single cron job.","type":"object","properties":{"apiVersion":{"description":"APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources","type":"string"},"kind":{"description":"Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds","type":"string"},"metadata":{"description":"Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata","default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"},"spec":{"description":"Specification of the desired behavior of a cron job, including the schedule. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status","default":{},"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJobSpec"},"status":{"description":"Current status of a cron job. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status","default":{},"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJobStatus"}},"x-kubernetes-group-version-kind":[{"group":"batch","kind":"CronJob","version":"v1"}]},"io.k8s.api.batch.v1.CronJobList":{"description":"CronJobList is a collection of cron jobs.","type":"object","required":["items"],"properties":{"apiVersion":{"description":"APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources","type":"string"},"items":{"description":"items is the list of CronJobs.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}},"kind":{"description":"Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds","type":"string"},"metadata":{"description":"Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata","default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta"}},"x-kubernetes-group-version-kind":[{"group":"batch","kind":"CronJobList","version":"v1"}]},"io.k8s.api.batch.v1.CronJobSpec":{"description":"CronJobSpec describes how the job execution will look like and when it will actually run.","type":"object","required":["schedule","jobTemplate"],"properties":{"concurrencyPolicy":{"description":"Specifies how to treat concurrent executions of a Job. Valid values are: - \"Allow\" (default): allows CronJobs to run concurrently; - \"Forbid\": forbids concurrent runs, skipping next run if previous run hasn't finished yet; - \"Replace\": cancels currently running job and replaces it with a new one\n\n","type":"string"},"failedJobsHistoryLimit":{"description":"The number of failed finished jobs to retain. Value must be non-negative integer. Defaults to 1.","type":"integer","format":"int32"},"jobTemplate":{"description":"Specifies the job that will be created when executing a CronJob.","default":{},"$ref":"#/components/schemas/io.k8s.api.batch.v1.JobTemplateSpec"},"schedule":{"description":"The schedule in Cron format, see https://en.wikipedia.org/wiki/Cron.","type":"string","default":""},"startingDeadlineSeconds":{"description":"Optional deadline in seconds for starting the job if it misses scheduled time for any reason. Missed jobs executions will be counted as failed ones.","type":"integer","format":"int64"},"successfulJobsHistoryLimit":{"description":"The number of successful finished jobs to retain. Value must be non-negative integer. Defaults to 3.","type":"integer","format":"int32"},"suspend":{"description":"This flag tells the controller to suspend subsequent executions, it does not apply to already started executions. Defaults to false.","type":"boolean"}}},"io.k8s.api.batch.v1.CronJobStatus":{"description":"CronJobStatus represents the current state of a cron job.","type":"object","properties":{"active":{"description":"A list of pointers to currently running jobs.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.ObjectReference"},"x-kubernetes-list-type":"atomic"},"lastScheduleTime":{"description":"Information when was the last time the job was successfully scheduled.","$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time"},"lastSuccessfulTime":{"description":"Information when was the last time the job successfully completed.","$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time"}}},"io.k8s.api.batch.v1.Job":{"description":"Job represents the configuration of a single job.","type":"object","properties":{"apiVersion":{"description":"APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources","type":"string"},"kind":{"description":"Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds","type":"string"},"metadata":{"description":"Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata","default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"},"spec":{"description":"Specification of the desired behavior of a job. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status","default":{},"$ref":"#/components/schemas/io.k8s.api.batch.v1.JobSpec"},"status":{"description":"Current status of a job. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status","default":{},"$ref":"#/components/schemas/io.k8s.api.batch.v1.JobStatus"}},"x-kubernetes-group-version-kind":[{"group":"batch","kind":"Job","version":"v1"}]},"io.k8s.api.batch.v1.JobCondition":{"description":"JobCondition describes current state of a job.","type":"object","required":["type","status"],"properties":{"lastProbeTime":{"description":"Last time the condition was checked.","default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time"},"lastTransitionTime":{"description":"Last time the condition transit from one status to another.","default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time"},"message":{"description":"Human readable message indicating details about last transition.","type":"string"},"reason":{"description":"(brief) reason for the condition's last transition.","type":"string"},"status":{"description":"Status of the condition, one of True, False, Unknown.","type":"string","default":""},"type":{"description":"Type of job condition, Complete or Failed.\n\n","type":"string","default":""}}},"io.k8s.api.batch.v1.JobList":{"description":"JobList is a collection of jobs.","type":"object","required":["items"],"properties":{"apiVersion":{"description":"APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources","type":"string"},"items":{"description":"items is the list of Jobs.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}},"kind":{"description":"Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds","type":"string"},"metadata":{"description":"Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata","default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta"}},"x-kubernetes-group-version-kind":[{"group":"batch","kind":"JobList","version":"v1"}]},"io.k8s.api.batch.v1.JobSpec":{"description":"JobSpec describes how the job execution will look like.","type":"object","required":["template"],"properties":{"activeDeadlineSeconds":{"description":"Specifies the duration in seconds relative to the startTime that the job may be continuously active before the system tries to terminate it; value must be positive integer. If a Job is suspended (at creation or through an update), this timer will effectively be stopped and reset when the Job is resumed again.","type":"integer","format":"int64"},"backoffLimit":{"description":"Specifies the number of retries before marking this job failed. Defaults to 6","type":"integer","format":"int32"},"completionMode":{"description":"CompletionMode specifies how Pod completions are tracked. It can be `NonIndexed` (default) or `Indexed`.\n\n`NonIndexed` means that the Job is considered complete when there have been .spec.completions successfully completed Pods. Each Pod completion is homologous to each other.\n\n`Indexed` means that the Pods of a Job get an associated completion index from 0 to (.spec.completions - 1), available in the annotation batch.kubernetes.io/job-completion-index. The Job is considered complete when there is one successfully completed Pod for each index. When value is `Indexed`, .spec.completions must be specified and `.spec.parallelism` must be less than or equal to 10^5. In addition, The Pod name takes the form `$(job-name)-$(index)-$(random-string)`, the Pod hostname takes the form `$(job-name)-$(index)`.\n\nThis field is beta-level. More completion modes can be added in the future. If the Job controller observes a mode that it doesn't recognize, the controller skips updates for the Job.","type":"string"},"completions":{"description":"Specifies the desired number of successfully finished pods the job should be run with. Setting to nil means that the success of any pod signals the success of all pods, and allows parallelism to have any positive value. Setting to 1 means that parallelism is limited to 1 and the success of that pod signals the success of the job. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/","type":"integer","format":"int32"},"manualSelector":{"description":"manualSelector controls generation of pod labels and pod selectors. Leave `manualSelector` unset unless you are certain what you are doing. When false or unset, the system pick labels unique to this job and appends those labels to the pod template. When true, the user is responsible for picking unique labels and specifying the selector. Failure to pick a unique label may cause this and other jobs to not function correctly. However, You may see `manualSelector=true` in jobs that were created with the old `extensions/v1beta1` API. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/#specifying-your-own-pod-selector","type":"boolean"},"parallelism":{"description":"Specifies the maximum desired number of pods the job should run at any given time. The actual number of pods running in steady state will be less than this number when ((.spec.completions - .status.successful) \u003c .spec.parallelism), i.e. when the work left to do is less than max parallelism. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/","type":"integer","format":"int32"},"selector":{"description":"A label query over pods that should match the pod count. Normally, the system sets this field for you. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors","$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector"},"suspend":{"description":"Suspend specifies whether the Job controller should create Pods or not. If a Job is created with suspend set to true, no Pods are created by the Job controller. If a Job is suspended after creation (i.e. the flag goes from false to true), the Job controller will delete all active Pods associated with this Job. Users must design their workload to gracefully handle this. Suspending a Job will reset the StartTime field of the Job, effectively resetting the ActiveDeadlineSeconds timer too. Defaults to false.\n\nThis field is beta-level, gated by SuspendJob feature flag (enabled by default).","type":"boolean"},"template":{"description":"Describes the pod that will be created when executing a job. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/","default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.PodTemplateSpec"},"ttlSecondsAfterFinished":{"description":"ttlSecondsAfterFinished limits the lifetime of a Job that has finished execution (either Complete or Failed). If this field is set, ttlSecondsAfterFinished after the Job finishes, it is eligible to be automatically deleted. When the Job is being deleted, its lifecycle guarantees (e.g. finalizers) will be honored. If this field is unset, the Job won't be automatically deleted. If this field is set to zero, the Job becomes eligible to be deleted immediately after it finishes.","type":"integer","format":"int32"}}},"io.k8s.api.batch.v1.JobStatus":{"description":"JobStatus represents the current state of a Job.","type":"object","properties":{"active":{"description":"The number of pending and running pods.","type":"integer","format":"int32"},"completedIndexes":{"description":"CompletedIndexes holds the completed indexes when .spec.completionMode = \"Indexed\" in a text format. The indexes are represented as decimal integers separated by commas. The numbers are listed in increasing order. Three or more consecutive numbers are compressed and represented by the first and last element of the series, separated by a hyphen. For example, if the completed indexes are 1, 3, 4, 5 and 7, they are represented as \"1,3-5,7\".","type":"string"},"completionTime":{"description":"Represents time when the job was completed. It is not guaranteed to be set in happens-before order across separate operations. It is represented in RFC3339 form and is in UTC. The completion time is only set when the job finishes successfully.","$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time"},"conditions":{"description":"The latest available observations of an object's current state. When a Job fails, one of the conditions will have type \"Failed\" and status true. When a Job is suspended, one of the conditions will have type \"Suspended\" and status true; when the Job is resumed, the status of this condition will become false. When a Job is completed, one of the conditions will have type \"Complete\" and status true. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.batch.v1.JobCondition"},"x-kubernetes-list-type":"atomic","x-kubernetes-patch-merge-key":"type","x-kubernetes-patch-strategy":"merge"},"failed":{"description":"The number of pods which reached phase Failed.","type":"integer","format":"int32"},"ready":{"description":"The number of pods which have a Ready condition.\n\nThis field is alpha-level. The job controller populates the field when the feature gate JobReadyPods is enabled (disabled by default).","type":"integer","format":"int32"},"startTime":{"description":"Represents time when the job controller started processing a job. When a Job is created in the suspended state, this field is not set until the first time it is resumed. This field is reset every time a Job is resumed from suspension. It is represented in RFC3339 form and is in UTC.","$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time"},"succeeded":{"description":"The number of pods which reached phase Succeeded.","type":"integer","format":"int32"},"uncountedTerminatedPods":{"description":"UncountedTerminatedPods holds the UIDs of Pods that have terminated but the job controller hasn't yet accounted for in the status counters.\n\nThe job controller creates pods with a finalizer. When a pod terminates (succeeded or failed), the controller does three steps to account for it in the job status: (1) Add the pod UID to the arrays in this field. (2) Remove the pod finalizer. (3) Remove the pod UID from the arrays while increasing the corresponding\n counter.\n\nThis field is beta-level. The job controller only makes use of this field when the feature gate JobTrackingWithFinalizers is enabled (enabled by default). Old jobs might not be tracked using this field, in which case the field remains null.","$ref":"#/components/schemas/io.k8s.api.batch.v1.UncountedTerminatedPods"}}},"io.k8s.api.batch.v1.JobTemplateSpec":{"description":"JobTemplateSpec describes the data a Job should have when created from a template","type":"object","properties":{"metadata":{"description":"Standard object's metadata of the jobs created from this template. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata","default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"},"spec":{"description":"Specification of the desired behavior of the job. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status","default":{},"$ref":"#/components/schemas/io.k8s.api.batch.v1.JobSpec"}}},"io.k8s.api.batch.v1.UncountedTerminatedPods":{"description":"UncountedTerminatedPods holds UIDs of Pods that have terminated but haven't been accounted in Job status counters.","type":"object","properties":{"failed":{"description":"Failed holds UIDs of failed Pods.","type":"array","items":{"type":"string","default":""},"x-kubernetes-list-type":"set"},"succeeded":{"description":"Succeeded holds UIDs of succeeded Pods.","type":"array","items":{"type":"string","default":""},"x-kubernetes-list-type":"set"}}},"io.k8s.api.core.v1.AWSElasticBlockStoreVolumeSource":{"description":"Represents a Persistent Disk resource in AWS.\n\nAn AWS EBS disk must exist before mounting to a container. The disk must also be in the same AWS zone as the kubelet. An AWS EBS disk can only be mounted as read/write once. AWS EBS volumes support ownership management and SELinux relabeling.","type":"object","required":["volumeID"],"properties":{"fsType":{"description":"fsType is the filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore","type":"string"},"partition":{"description":"partition is the partition in the volume that you want to mount. If omitted, the default is to mount by volume name. Examples: For volume /dev/sda1, you specify the partition as \"1\". Similarly, the volume partition for /dev/sda is \"0\" (or you can leave the property empty).","type":"integer","format":"int32"},"readOnly":{"description":"readOnly value true will force the readOnly setting in VolumeMounts. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore","type":"boolean"},"volumeID":{"description":"volumeID is unique ID of the persistent disk resource in AWS (Amazon EBS volume). More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore","type":"string","default":""}}},"io.k8s.api.core.v1.Affinity":{"description":"Affinity is a group of affinity scheduling rules.","type":"object","properties":{"nodeAffinity":{"description":"Describes node affinity scheduling rules for the pod.","$ref":"#/components/schemas/io.k8s.api.core.v1.NodeAffinity"},"podAffinity":{"description":"Describes pod affinity scheduling rules (e.g. co-locate this pod in the same node, zone, etc. as some other pod(s)).","$ref":"#/components/schemas/io.k8s.api.core.v1.PodAffinity"},"podAntiAffinity":{"description":"Describes pod anti-affinity scheduling rules (e.g. avoid putting this pod in the same node, zone, etc. as some other pod(s)).","$ref":"#/components/schemas/io.k8s.api.core.v1.PodAntiAffinity"}}},"io.k8s.api.core.v1.AzureDiskVolumeSource":{"description":"AzureDisk represents an Azure Data Disk mount on the host and bind mount to the pod.","type":"object","required":["diskName","diskURI"],"properties":{"cachingMode":{"description":"cachingMode is the Host Caching mode: None, Read Only, Read Write.","type":"string"},"diskName":{"description":"diskName is the Name of the data disk in the blob storage","type":"string","default":""},"diskURI":{"description":"diskURI is the URI of data disk in the blob storage","type":"string","default":""},"fsType":{"description":"fsType is Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.","type":"string"},"kind":{"description":"kind expected values are Shared: multiple blob disks per storage account Dedicated: single blob disk per storage account Managed: azure managed data disk (only in managed availability set). defaults to shared","type":"string"},"readOnly":{"description":"readOnly Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.","type":"boolean"}}},"io.k8s.api.core.v1.AzureFileVolumeSource":{"description":"AzureFile represents an Azure File Service mount on the host and bind mount to the pod.","type":"object","required":["secretName","shareName"],"properties":{"readOnly":{"description":"readOnly defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.","type":"boolean"},"secretName":{"description":"secretName is the name of secret that contains Azure Storage Account Name and Key","type":"string","default":""},"shareName":{"description":"shareName is the azure share Name","type":"string","default":""}}},"io.k8s.api.core.v1.CSIVolumeSource":{"description":"Represents a source location of a volume to mount, managed by an external CSI driver","type":"object","required":["driver"],"properties":{"driver":{"description":"driver is the name of the CSI driver that handles this volume. Consult with your admin for the correct name as registered in the cluster.","type":"string","default":""},"fsType":{"description":"fsType to mount. Ex. \"ext4\", \"xfs\", \"ntfs\". If not provided, the empty value is passed to the associated CSI driver which will determine the default filesystem to apply.","type":"string"},"nodePublishSecretRef":{"description":"nodePublishSecretRef is a reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI NodePublishVolume and NodeUnpublishVolume calls. This field is optional, and may be empty if no secret is required. If the secret object contains more than one secret, all secret references are passed.","$ref":"#/components/schemas/io.k8s.api.core.v1.LocalObjectReference"},"readOnly":{"description":"readOnly specifies a read-only configuration for the volume. Defaults to false (read/write).","type":"boolean"},"volumeAttributes":{"description":"volumeAttributes stores driver-specific properties that are passed to the CSI driver. Consult your driver's documentation for supported values.","type":"object","additionalProperties":{"type":"string","default":""}}}},"io.k8s.api.core.v1.Capabilities":{"description":"Adds and removes POSIX capabilities from running containers.","type":"object","properties":{"add":{"description":"Added capabilities","type":"array","items":{"type":"string","default":""}},"drop":{"description":"Removed capabilities","type":"array","items":{"type":"string","default":""}}}},"io.k8s.api.core.v1.CephFSVolumeSource":{"description":"Represents a Ceph Filesystem mount that lasts the lifetime of a pod Cephfs volumes do not support ownership management or SELinux relabeling.","type":"object","required":["monitors"],"properties":{"monitors":{"description":"monitors is Required: Monitors is a collection of Ceph monitors More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it","type":"array","items":{"type":"string","default":""}},"path":{"description":"path is Optional: Used as the mounted root, rather than the full Ceph tree, default is /","type":"string"},"readOnly":{"description":"readOnly is Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it","type":"boolean"},"secretFile":{"description":"secretFile is Optional: SecretFile is the path to key ring for User, default is /etc/ceph/user.secret More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it","type":"string"},"secretRef":{"description":"secretRef is Optional: SecretRef is reference to the authentication secret for User, default is empty. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it","$ref":"#/components/schemas/io.k8s.api.core.v1.LocalObjectReference"},"user":{"description":"user is optional: User is the rados user name, default is admin More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it","type":"string"}}},"io.k8s.api.core.v1.CinderVolumeSource":{"description":"Represents a cinder volume resource in Openstack. A Cinder volume must exist before mounting to a container. The volume must also be in the same region as the kubelet. Cinder volumes support ownership management and SELinux relabeling.","type":"object","required":["volumeID"],"properties":{"fsType":{"description":"fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://examples.k8s.io/mysql-cinder-pd/README.md","type":"string"},"readOnly":{"description":"readOnly defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. More info: https://examples.k8s.io/mysql-cinder-pd/README.md","type":"boolean"},"secretRef":{"description":"secretRef is optional: points to a secret object containing parameters used to connect to OpenStack.","$ref":"#/components/schemas/io.k8s.api.core.v1.LocalObjectReference"},"volumeID":{"description":"volumeID used to identify the volume in cinder. More info: https://examples.k8s.io/mysql-cinder-pd/README.md","type":"string","default":""}}},"io.k8s.api.core.v1.ConfigMapEnvSource":{"description":"ConfigMapEnvSource selects a ConfigMap to populate the environment variables with.\n\nThe contents of the target ConfigMap's Data field will represent the key-value pairs as environment variables.","type":"object","properties":{"name":{"description":"Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names","type":"string"},"optional":{"description":"Specify whether the ConfigMap must be defined","type":"boolean"}}},"io.k8s.api.core.v1.ConfigMapKeySelector":{"description":"Selects a key from a ConfigMap.","type":"object","required":["key"],"properties":{"key":{"description":"The key to select.","type":"string","default":""},"name":{"description":"Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names","type":"string"},"optional":{"description":"Specify whether the ConfigMap or its key must be defined","type":"boolean"}},"x-kubernetes-map-type":"atomic"},"io.k8s.api.core.v1.ConfigMapProjection":{"description":"Adapts a ConfigMap into a projected volume.\n\nThe contents of the target ConfigMap's Data field will be presented in a projected volume as files using the keys in the Data field as the file names, unless the items element is populated with specific mappings of keys to paths. Note that this is identical to a configmap volume source without the default mode.","type":"object","properties":{"items":{"description":"items if unspecified, each key-value pair in the Data field of the referenced ConfigMap will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the ConfigMap, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.KeyToPath"}},"name":{"description":"Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names","type":"string"},"optional":{"description":"optional specify whether the ConfigMap or its keys must be defined","type":"boolean"}}},"io.k8s.api.core.v1.ConfigMapVolumeSource":{"description":"Adapts a ConfigMap into a volume.\n\nThe contents of the target ConfigMap's Data field will be presented in a volume as files using the keys in the Data field as the file names, unless the items element is populated with specific mappings of keys to paths. ConfigMap volumes support ownership management and SELinux relabeling.","type":"object","properties":{"defaultMode":{"description":"defaultMode is optional: mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.","type":"integer","format":"int32"},"items":{"description":"items if unspecified, each key-value pair in the Data field of the referenced ConfigMap will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the ConfigMap, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.KeyToPath"}},"name":{"description":"Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names","type":"string"},"optional":{"description":"optional specify whether the ConfigMap or its keys must be defined","type":"boolean"}}},"io.k8s.api.core.v1.Container":{"description":"A single application container that you want to run within a pod.","type":"object","required":["name"],"properties":{"args":{"description":"Arguments to the entrypoint. The container image's CMD is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \"$$(VAR_NAME)\" will produce the string literal \"$(VAR_NAME)\". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell","type":"array","items":{"type":"string","default":""}},"command":{"description":"Entrypoint array. Not executed within a shell. The container image's ENTRYPOINT is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \"$$(VAR_NAME)\" will produce the string literal \"$(VAR_NAME)\". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell","type":"array","items":{"type":"string","default":""}},"env":{"description":"List of environment variables to set in the container. Cannot be updated.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.EnvVar"},"x-kubernetes-patch-merge-key":"name","x-kubernetes-patch-strategy":"merge"},"envFrom":{"description":"List of sources to populate environment variables in the container. The keys defined within a source must be a C_IDENTIFIER. All invalid keys will be reported as an event when the container is starting. When a key exists in multiple sources, the value associated with the last source will take precedence. Values defined by an Env with a duplicate key will take precedence. Cannot be updated.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.EnvFromSource"}},"image":{"description":"Container image name. More info: https://kubernetes.io/docs/concepts/containers/images This field is optional to allow higher level config management to default or override container images in workload controllers like Deployments and StatefulSets.","type":"string"},"imagePullPolicy":{"description":"Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. Cannot be updated. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images\n\n","type":"string"},"lifecycle":{"description":"Actions that the management system should take in response to container lifecycle events. Cannot be updated.","$ref":"#/components/schemas/io.k8s.api.core.v1.Lifecycle"},"livenessProbe":{"description":"Periodic probe of container liveness. Container will be restarted if the probe fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes","$ref":"#/components/schemas/io.k8s.api.core.v1.Probe"},"name":{"description":"Name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated.","type":"string","default":""},"ports":{"description":"List of ports to expose from the container. Exposing a port here gives the system additional information about the network connections a container uses, but is primarily informational. Not specifying a port here DOES NOT prevent that port from being exposed. Any port which is listening on the default \"0.0.0.0\" address inside a container will be accessible from the network. Cannot be updated.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.ContainerPort"},"x-kubernetes-list-map-keys":["containerPort","protocol"],"x-kubernetes-list-type":"map","x-kubernetes-patch-merge-key":"containerPort","x-kubernetes-patch-strategy":"merge"},"readinessProbe":{"description":"Periodic probe of container service readiness. Container will be removed from service endpoints if the probe fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes","$ref":"#/components/schemas/io.k8s.api.core.v1.Probe"},"resources":{"description":"Compute Resources required by this container. Cannot be updated. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/","default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.ResourceRequirements"},"securityContext":{"description":"SecurityContext defines the security options the container should be run with. If set, the fields of SecurityContext override the equivalent fields of PodSecurityContext. More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/","$ref":"#/components/schemas/io.k8s.api.core.v1.SecurityContext"},"startupProbe":{"description":"StartupProbe indicates that the Pod has successfully initialized. If specified, no other probes are executed until this completes successfully. If this probe fails, the Pod will be restarted, just as if the livenessProbe failed. This can be used to provide different probe parameters at the beginning of a Pod's lifecycle, when it might take a long time to load data or warm a cache, than during steady-state operation. This cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes","$ref":"#/components/schemas/io.k8s.api.core.v1.Probe"},"stdin":{"description":"Whether this container should allocate a buffer for stdin in the container runtime. If this is not set, reads from stdin in the container will always result in EOF. Default is false.","type":"boolean"},"stdinOnce":{"description":"Whether the container runtime should close the stdin channel after it has been opened by a single attach. When stdin is true the stdin stream will remain open across multiple attach sessions. If stdinOnce is set to true, stdin is opened on container start, is empty until the first client attaches to stdin, and then remains open and accepts data until the client disconnects, at which time stdin is closed and remains closed until the container is restarted. If this flag is false, a container processes that reads from stdin will never receive an EOF. Default is false","type":"boolean"},"terminationMessagePath":{"description":"Optional: Path at which the file to which the container's termination message will be written is mounted into the container's filesystem. Message written is intended to be brief final status, such as an assertion failure message. Will be truncated by the node if greater than 4096 bytes. The total message length across all containers will be limited to 12kb. Defaults to /dev/termination-log. Cannot be updated.","type":"string"},"terminationMessagePolicy":{"description":"Indicate how the termination message should be populated. File will use the contents of terminationMessagePath to populate the container status message on both success and failure. FallbackToLogsOnError will use the last chunk of container log output if the termination message file is empty and the container exited with an error. The log output is limited to 2048 bytes or 80 lines, whichever is smaller. Defaults to File. Cannot be updated.\n\n","type":"string"},"tty":{"description":"Whether this container should allocate a TTY for itself, also requires 'stdin' to be true. Default is false.","type":"boolean"},"volumeDevices":{"description":"volumeDevices is the list of block devices to be used by the container.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.VolumeDevice"},"x-kubernetes-patch-merge-key":"devicePath","x-kubernetes-patch-strategy":"merge"},"volumeMounts":{"description":"Pod volumes to mount into the container's filesystem. Cannot be updated.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.VolumeMount"},"x-kubernetes-patch-merge-key":"mountPath","x-kubernetes-patch-strategy":"merge"},"workingDir":{"description":"Container's working directory. If not specified, the container runtime's default will be used, which might be configured in the container image. Cannot be updated.","type":"string"}}},"io.k8s.api.core.v1.ContainerPort":{"description":"ContainerPort represents a network port in a single container.","type":"object","required":["containerPort"],"properties":{"containerPort":{"description":"Number of port to expose on the pod's IP address. This must be a valid port number, 0 \u003c x \u003c 65536.","type":"integer","format":"int32","default":0},"hostIP":{"description":"What host IP to bind the external port to.","type":"string"},"hostPort":{"description":"Number of port to expose on the host. If specified, this must be a valid port number, 0 \u003c x \u003c 65536. If HostNetwork is specified, this must match ContainerPort. Most containers do not need this.","type":"integer","format":"int32"},"name":{"description":"If specified, this must be an IANA_SVC_NAME and unique within the pod. Each named port in a pod must have a unique name. Name for the port that can be referred to by services.","type":"string"},"protocol":{"description":"Protocol for port. Must be UDP, TCP, or SCTP. Defaults to \"TCP\".\n\n","type":"string","default":"TCP"}}},"io.k8s.api.core.v1.DownwardAPIProjection":{"description":"Represents downward API info for projecting into a projected volume. Note that this is identical to a downwardAPI volume source without the default mode.","type":"object","properties":{"items":{"description":"Items is a list of DownwardAPIVolume file","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.DownwardAPIVolumeFile"}}}},"io.k8s.api.core.v1.DownwardAPIVolumeFile":{"description":"DownwardAPIVolumeFile represents information to create the file containing the pod field","type":"object","required":["path"],"properties":{"fieldRef":{"description":"Required: Selects a field of the pod: only annotations, labels, name and namespace are supported.","$ref":"#/components/schemas/io.k8s.api.core.v1.ObjectFieldSelector"},"mode":{"description":"Optional: mode bits used to set permissions on this file, must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.","type":"integer","format":"int32"},"path":{"description":"Required: Path is the relative path name of the file to be created. Must not be absolute or contain the '..' path. Must be utf-8 encoded. The first item of the relative path must not start with '..'","type":"string","default":""},"resourceFieldRef":{"description":"Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported.","$ref":"#/components/schemas/io.k8s.api.core.v1.ResourceFieldSelector"}}},"io.k8s.api.core.v1.DownwardAPIVolumeSource":{"description":"DownwardAPIVolumeSource represents a volume containing downward API info. Downward API volumes support ownership management and SELinux relabeling.","type":"object","properties":{"defaultMode":{"description":"Optional: mode bits to use on created files by default. Must be a Optional: mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.","type":"integer","format":"int32"},"items":{"description":"Items is a list of downward API volume file","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.DownwardAPIVolumeFile"}}}},"io.k8s.api.core.v1.EmptyDirVolumeSource":{"description":"Represents an empty directory for a pod. Empty directory volumes support ownership management and SELinux relabeling.","type":"object","properties":{"medium":{"description":"medium represents what type of storage medium should back this directory. The default is \"\" which means to use the node's default medium. Must be an empty string (default) or Memory. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir","type":"string"},"sizeLimit":{"description":"sizeLimit is the total amount of local storage required for this EmptyDir volume. The size limit is also applicable for memory medium. The maximum usage on memory medium EmptyDir would be the minimum value between the SizeLimit specified here and the sum of memory limits of all containers in a pod. The default is nil which means that the limit is undefined. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir","$ref":"#/components/schemas/io.k8s.apimachinery.pkg.api.resource.Quantity"}}},"io.k8s.api.core.v1.EnvFromSource":{"description":"EnvFromSource represents the source of a set of ConfigMaps","type":"object","properties":{"configMapRef":{"description":"The ConfigMap to select from","$ref":"#/components/schemas/io.k8s.api.core.v1.ConfigMapEnvSource"},"prefix":{"description":"An optional identifier to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER.","type":"string"},"secretRef":{"description":"The Secret to select from","$ref":"#/components/schemas/io.k8s.api.core.v1.SecretEnvSource"}}},"io.k8s.api.core.v1.EnvVar":{"description":"EnvVar represents an environment variable present in a Container.","type":"object","required":["name"],"properties":{"name":{"description":"Name of the environment variable. Must be a C_IDENTIFIER.","type":"string","default":""},"value":{"description":"Variable references $(VAR_NAME) are expanded using the previously defined environment variables in the container and any service environment variables. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \"$$(VAR_NAME)\" will produce the string literal \"$(VAR_NAME)\". Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to \"\".","type":"string"},"valueFrom":{"description":"Source for the environment variable's value. Cannot be used if value is not empty.","$ref":"#/components/schemas/io.k8s.api.core.v1.EnvVarSource"}}},"io.k8s.api.core.v1.EnvVarSource":{"description":"EnvVarSource represents a source for the value of an EnvVar.","type":"object","properties":{"configMapKeyRef":{"description":"Selects a key of a ConfigMap.","$ref":"#/components/schemas/io.k8s.api.core.v1.ConfigMapKeySelector"},"fieldRef":{"description":"Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['\u003cKEY\u003e']`, `metadata.annotations['\u003cKEY\u003e']`, spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.","$ref":"#/components/schemas/io.k8s.api.core.v1.ObjectFieldSelector"},"resourceFieldRef":{"description":"Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.","$ref":"#/components/schemas/io.k8s.api.core.v1.ResourceFieldSelector"},"secretKeyRef":{"description":"Selects a key of a secret in the pod's namespace","$ref":"#/components/schemas/io.k8s.api.core.v1.SecretKeySelector"}}},"io.k8s.api.core.v1.EphemeralContainer":{"description":"An EphemeralContainer is a temporary container that you may add to an existing Pod for user-initiated activities such as debugging. Ephemeral containers have no resource or scheduling guarantees, and they will not be restarted when they exit or when a Pod is removed or restarted. The kubelet may evict a Pod if an ephemeral container causes the Pod to exceed its resource allocation.\n\nTo add an ephemeral container, use the ephemeralcontainers subresource of an existing Pod. Ephemeral containers may not be removed or restarted.","type":"object","required":["name"],"properties":{"args":{"description":"Arguments to the entrypoint. The image's CMD is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \"$$(VAR_NAME)\" will produce the string literal \"$(VAR_NAME)\". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell","type":"array","items":{"type":"string","default":""}},"command":{"description":"Entrypoint array. Not executed within a shell. The image's ENTRYPOINT is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \"$$(VAR_NAME)\" will produce the string literal \"$(VAR_NAME)\". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell","type":"array","items":{"type":"string","default":""}},"env":{"description":"List of environment variables to set in the container. Cannot be updated.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.EnvVar"},"x-kubernetes-patch-merge-key":"name","x-kubernetes-patch-strategy":"merge"},"envFrom":{"description":"List of sources to populate environment variables in the container. The keys defined within a source must be a C_IDENTIFIER. All invalid keys will be reported as an event when the container is starting. When a key exists in multiple sources, the value associated with the last source will take precedence. Values defined by an Env with a duplicate key will take precedence. Cannot be updated.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.EnvFromSource"}},"image":{"description":"Container image name. More info: https://kubernetes.io/docs/concepts/containers/images","type":"string"},"imagePullPolicy":{"description":"Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. Cannot be updated. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images\n\n","type":"string"},"lifecycle":{"description":"Lifecycle is not allowed for ephemeral containers.","$ref":"#/components/schemas/io.k8s.api.core.v1.Lifecycle"},"livenessProbe":{"description":"Probes are not allowed for ephemeral containers.","$ref":"#/components/schemas/io.k8s.api.core.v1.Probe"},"name":{"description":"Name of the ephemeral container specified as a DNS_LABEL. This name must be unique among all containers, init containers and ephemeral containers.","type":"string","default":""},"ports":{"description":"Ports are not allowed for ephemeral containers.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.ContainerPort"},"x-kubernetes-list-map-keys":["containerPort","protocol"],"x-kubernetes-list-type":"map","x-kubernetes-patch-merge-key":"containerPort","x-kubernetes-patch-strategy":"merge"},"readinessProbe":{"description":"Probes are not allowed for ephemeral containers.","$ref":"#/components/schemas/io.k8s.api.core.v1.Probe"},"resources":{"description":"Resources are not allowed for ephemeral containers. Ephemeral containers use spare resources already allocated to the pod.","default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.ResourceRequirements"},"securityContext":{"description":"Optional: SecurityContext defines the security options the ephemeral container should be run with. If set, the fields of SecurityContext override the equivalent fields of PodSecurityContext.","$ref":"#/components/schemas/io.k8s.api.core.v1.SecurityContext"},"startupProbe":{"description":"Probes are not allowed for ephemeral containers.","$ref":"#/components/schemas/io.k8s.api.core.v1.Probe"},"stdin":{"description":"Whether this container should allocate a buffer for stdin in the container runtime. If this is not set, reads from stdin in the container will always result in EOF. Default is false.","type":"boolean"},"stdinOnce":{"description":"Whether the container runtime should close the stdin channel after it has been opened by a single attach. When stdin is true the stdin stream will remain open across multiple attach sessions. If stdinOnce is set to true, stdin is opened on container start, is empty until the first client attaches to stdin, and then remains open and accepts data until the client disconnects, at which time stdin is closed and remains closed until the container is restarted. If this flag is false, a container processes that reads from stdin will never receive an EOF. Default is false","type":"boolean"},"targetContainerName":{"description":"If set, the name of the container from PodSpec that this ephemeral container targets. The ephemeral container will be run in the namespaces (IPC, PID, etc) of this container. If not set then the ephemeral container uses the namespaces configured in the Pod spec.\n\nThe container runtime must implement support for this feature. If the runtime does not support namespace targeting then the result of setting this field is undefined.","type":"string"},"terminationMessagePath":{"description":"Optional: Path at which the file to which the container's termination message will be written is mounted into the container's filesystem. Message written is intended to be brief final status, such as an assertion failure message. Will be truncated by the node if greater than 4096 bytes. The total message length across all containers will be limited to 12kb. Defaults to /dev/termination-log. Cannot be updated.","type":"string"},"terminationMessagePolicy":{"description":"Indicate how the termination message should be populated. File will use the contents of terminationMessagePath to populate the container status message on both success and failure. FallbackToLogsOnError will use the last chunk of container log output if the termination message file is empty and the container exited with an error. The log output is limited to 2048 bytes or 80 lines, whichever is smaller. Defaults to File. Cannot be updated.\n\n","type":"string"},"tty":{"description":"Whether this container should allocate a TTY for itself, also requires 'stdin' to be true. Default is false.","type":"boolean"},"volumeDevices":{"description":"volumeDevices is the list of block devices to be used by the container.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.VolumeDevice"},"x-kubernetes-patch-merge-key":"devicePath","x-kubernetes-patch-strategy":"merge"},"volumeMounts":{"description":"Pod volumes to mount into the container's filesystem. Subpath mounts are not allowed for ephemeral containers. Cannot be updated.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.VolumeMount"},"x-kubernetes-patch-merge-key":"mountPath","x-kubernetes-patch-strategy":"merge"},"workingDir":{"description":"Container's working directory. If not specified, the container runtime's default will be used, which might be configured in the container image. Cannot be updated.","type":"string"}}},"io.k8s.api.core.v1.EphemeralVolumeSource":{"description":"Represents an ephemeral volume that is handled by a normal storage driver.","type":"object","properties":{"volumeClaimTemplate":{"description":"Will be used to create a stand-alone PVC to provision the volume. The pod in which this EphemeralVolumeSource is embedded will be the owner of the PVC, i.e. the PVC will be deleted together with the pod. The name of the PVC will be `\u003cpod name\u003e-\u003cvolume name\u003e` where `\u003cvolume name\u003e` is the name from the `PodSpec.Volumes` array entry. Pod validation will reject the pod if the concatenated name is not valid for a PVC (for example, too long).\n\nAn existing PVC with that name that is not owned by the pod will *not* be used for the pod to avoid using an unrelated volume by mistake. Starting the pod is then blocked until the unrelated PVC is removed. If such a pre-created PVC is meant to be used by the pod, the PVC has to updated with an owner reference to the pod once the pod exists. Normally this should not be necessary, but it may be useful when manually reconstructing a broken cluster.\n\nThis field is read-only and no changes will be made by Kubernetes to the PVC after it has been created.\n\nRequired, must not be nil.","$ref":"#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaimTemplate"}}},"io.k8s.api.core.v1.ExecAction":{"description":"ExecAction describes a \"run in container\" action.","type":"object","properties":{"command":{"description":"Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is simply exec'd, it is not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy.","type":"array","items":{"type":"string","default":""}}}},"io.k8s.api.core.v1.FCVolumeSource":{"description":"Represents a Fibre Channel volume. Fibre Channel volumes can only be mounted as read/write once. Fibre Channel volumes support ownership management and SELinux relabeling.","type":"object","properties":{"fsType":{"description":"fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.","type":"string"},"lun":{"description":"lun is Optional: FC target lun number","type":"integer","format":"int32"},"readOnly":{"description":"readOnly is Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.","type":"boolean"},"targetWWNs":{"description":"targetWWNs is Optional: FC target worldwide names (WWNs)","type":"array","items":{"type":"string","default":""}},"wwids":{"description":"wwids Optional: FC volume world wide identifiers (wwids) Either wwids or combination of targetWWNs and lun must be set, but not both simultaneously.","type":"array","items":{"type":"string","default":""}}}},"io.k8s.api.core.v1.FlexVolumeSource":{"description":"FlexVolume represents a generic volume resource that is provisioned/attached using an exec based plugin.","type":"object","required":["driver"],"properties":{"driver":{"description":"driver is the name of the driver to use for this volume.","type":"string","default":""},"fsType":{"description":"fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". The default filesystem depends on FlexVolume script.","type":"string"},"options":{"description":"options is Optional: this field holds extra command options if any.","type":"object","additionalProperties":{"type":"string","default":""}},"readOnly":{"description":"readOnly is Optional: defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.","type":"boolean"},"secretRef":{"description":"secretRef is Optional: secretRef is reference to the secret object containing sensitive information to pass to the plugin scripts. This may be empty if no secret object is specified. If the secret object contains more than one secret, all secrets are passed to the plugin scripts.","$ref":"#/components/schemas/io.k8s.api.core.v1.LocalObjectReference"}}},"io.k8s.api.core.v1.FlockerVolumeSource":{"description":"Represents a Flocker volume mounted by the Flocker agent. One and only one of datasetName and datasetUUID should be set. Flocker volumes do not support ownership management or SELinux relabeling.","type":"object","properties":{"datasetName":{"description":"datasetName is Name of the dataset stored as metadata -\u003e name on the dataset for Flocker should be considered as deprecated","type":"string"},"datasetUUID":{"description":"datasetUUID is the UUID of the dataset. This is unique identifier of a Flocker dataset","type":"string"}}},"io.k8s.api.core.v1.GCEPersistentDiskVolumeSource":{"description":"Represents a Persistent Disk resource in Google Compute Engine.\n\nA GCE PD must exist before mounting to a container. The disk must also be in the same GCE project and zone as the kubelet. A GCE PD can only be mounted as read/write once or read-only many times. GCE PDs support ownership management and SELinux relabeling.","type":"object","required":["pdName"],"properties":{"fsType":{"description":"fsType is filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk","type":"string"},"partition":{"description":"partition is the partition in the volume that you want to mount. If omitted, the default is to mount by volume name. Examples: For volume /dev/sda1, you specify the partition as \"1\". Similarly, the volume partition for /dev/sda is \"0\" (or you can leave the property empty). More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk","type":"integer","format":"int32"},"pdName":{"description":"pdName is unique name of the PD resource in GCE. Used to identify the disk in GCE. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk","type":"string","default":""},"readOnly":{"description":"readOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk","type":"boolean"}}},"io.k8s.api.core.v1.GRPCAction":{"type":"object","required":["port"],"properties":{"port":{"description":"Port number of the gRPC service. Number must be in the range 1 to 65535.","type":"integer","format":"int32","default":0},"service":{"description":"Service is the name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md).\n\nIf this is not specified, the default behavior is defined by gRPC.","type":"string","default":""}}},"io.k8s.api.core.v1.GitRepoVolumeSource":{"description":"Represents a volume that is populated with the contents of a git repository. Git repo volumes do not support ownership management. Git repo volumes support SELinux relabeling.\n\nDEPRECATED: GitRepo is deprecated. To provision a container with a git repo, mount an EmptyDir into an InitContainer that clones the repo using git, then mount the EmptyDir into the Pod's container.","type":"object","required":["repository"],"properties":{"directory":{"description":"directory is the target directory name. Must not contain or start with '..'. If '.' is supplied, the volume directory will be the git repository. Otherwise, if specified, the volume will contain the git repository in the subdirectory with the given name.","type":"string"},"repository":{"description":"repository is the URL","type":"string","default":""},"revision":{"description":"revision is the commit hash for the specified revision.","type":"string"}}},"io.k8s.api.core.v1.GlusterfsVolumeSource":{"description":"Represents a Glusterfs mount that lasts the lifetime of a pod. Glusterfs volumes do not support ownership management or SELinux relabeling.","type":"object","required":["endpoints","path"],"properties":{"endpoints":{"description":"endpoints is the endpoint name that details Glusterfs topology. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod","type":"string","default":""},"path":{"description":"path is the Glusterfs volume path. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod","type":"string","default":""},"readOnly":{"description":"readOnly here will force the Glusterfs volume to be mounted with read-only permissions. Defaults to false. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod","type":"boolean"}}},"io.k8s.api.core.v1.HTTPGetAction":{"description":"HTTPGetAction describes an action based on HTTP Get requests.","type":"object","required":["port"],"properties":{"host":{"description":"Host name to connect to, defaults to the pod IP. You probably want to set \"Host\" in httpHeaders instead.","type":"string"},"httpHeaders":{"description":"Custom headers to set in the request. HTTP allows repeated headers.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.HTTPHeader"}},"path":{"description":"Path to access on the HTTP server.","type":"string"},"port":{"description":"Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME.","default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.util.intstr.IntOrString"},"scheme":{"description":"Scheme to use for connecting to the host. Defaults to HTTP.\n\n","type":"string"}}},"io.k8s.api.core.v1.HTTPHeader":{"description":"HTTPHeader describes a custom header to be used in HTTP probes","type":"object","required":["name","value"],"properties":{"name":{"description":"The header field name","type":"string","default":""},"value":{"description":"The header field value","type":"string","default":""}}},"io.k8s.api.core.v1.HostAlias":{"description":"HostAlias holds the mapping between IP and hostnames that will be injected as an entry in the pod's hosts file.","type":"object","properties":{"hostnames":{"description":"Hostnames for the above IP address.","type":"array","items":{"type":"string","default":""}},"ip":{"description":"IP address of the host file entry.","type":"string"}}},"io.k8s.api.core.v1.HostPathVolumeSource":{"description":"Represents a host path mapped into a pod. Host path volumes do not support ownership management or SELinux relabeling.","type":"object","required":["path"],"properties":{"path":{"description":"path of the directory on the host. If the path is a symlink, it will follow the link to the real path. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath","type":"string","default":""},"type":{"description":"type for HostPath Volume Defaults to \"\" More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath","type":"string"}}},"io.k8s.api.core.v1.ISCSIVolumeSource":{"description":"Represents an ISCSI disk. ISCSI volumes can only be mounted as read/write once. ISCSI volumes support ownership management and SELinux relabeling.","type":"object","required":["targetPortal","iqn","lun"],"properties":{"chapAuthDiscovery":{"description":"chapAuthDiscovery defines whether support iSCSI Discovery CHAP authentication","type":"boolean"},"chapAuthSession":{"description":"chapAuthSession defines whether support iSCSI Session CHAP authentication","type":"boolean"},"fsType":{"description":"fsType is the filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#iscsi","type":"string"},"initiatorName":{"description":"initiatorName is the custom iSCSI Initiator Name. If initiatorName is specified with iscsiInterface simultaneously, new iSCSI interface \u003ctarget portal\u003e:\u003cvolume name\u003e will be created for the connection.","type":"string"},"iqn":{"description":"iqn is the target iSCSI Qualified Name.","type":"string","default":""},"iscsiInterface":{"description":"iscsiInterface is the interface Name that uses an iSCSI transport. Defaults to 'default' (tcp).","type":"string"},"lun":{"description":"lun represents iSCSI Target Lun number.","type":"integer","format":"int32","default":0},"portals":{"description":"portals is the iSCSI Target Portal List. The portal is either an IP or ip_addr:port if the port is other than default (typically TCP ports 860 and 3260).","type":"array","items":{"type":"string","default":""}},"readOnly":{"description":"readOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false.","type":"boolean"},"secretRef":{"description":"secretRef is the CHAP Secret for iSCSI target and initiator authentication","$ref":"#/components/schemas/io.k8s.api.core.v1.LocalObjectReference"},"targetPortal":{"description":"targetPortal is iSCSI Target Portal. The Portal is either an IP or ip_addr:port if the port is other than default (typically TCP ports 860 and 3260).","type":"string","default":""}}},"io.k8s.api.core.v1.KeyToPath":{"description":"Maps a string key to a path within a volume.","type":"object","required":["key","path"],"properties":{"key":{"description":"key is the key to project.","type":"string","default":""},"mode":{"description":"mode is Optional: mode bits used to set permissions on this file. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.","type":"integer","format":"int32"},"path":{"description":"path is the relative path of the file to map the key to. May not be an absolute path. May not contain the path element '..'. May not start with the string '..'.","type":"string","default":""}}},"io.k8s.api.core.v1.Lifecycle":{"description":"Lifecycle describes actions that the management system should take in response to container lifecycle events. For the PostStart and PreStop lifecycle handlers, management of the container blocks until the action is complete, unless the container process fails, in which case the handler is aborted.","type":"object","properties":{"postStart":{"description":"PostStart is called immediately after a container is created. If the handler fails, the container is terminated and restarted according to its restart policy. Other management of the container blocks until the hook completes. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks","$ref":"#/components/schemas/io.k8s.api.core.v1.LifecycleHandler"},"preStop":{"description":"PreStop is called immediately before a container is terminated due to an API request or management event such as liveness/startup probe failure, preemption, resource contention, etc. The handler is not called if the container crashes or exits. The Pod's termination grace period countdown begins before the PreStop hook is executed. Regardless of the outcome of the handler, the container will eventually terminate within the Pod's termination grace period (unless delayed by finalizers). Other management of the container blocks until the hook completes or until the termination grace period is reached. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks","$ref":"#/components/schemas/io.k8s.api.core.v1.LifecycleHandler"}}},"io.k8s.api.core.v1.LifecycleHandler":{"description":"LifecycleHandler defines a specific action that should be taken in a lifecycle hook. One and only one of the fields, except TCPSocket must be specified.","type":"object","properties":{"exec":{"description":"Exec specifies the action to take.","$ref":"#/components/schemas/io.k8s.api.core.v1.ExecAction"},"httpGet":{"description":"HTTPGet specifies the http request to perform.","$ref":"#/components/schemas/io.k8s.api.core.v1.HTTPGetAction"},"tcpSocket":{"description":"Deprecated. TCPSocket is NOT supported as a LifecycleHandler and kept for the backward compatibility. There are no validation of this field and lifecycle hooks will fail in runtime when tcp handler is specified.","$ref":"#/components/schemas/io.k8s.api.core.v1.TCPSocketAction"}}},"io.k8s.api.core.v1.LocalObjectReference":{"description":"LocalObjectReference contains enough information to let you locate the referenced object inside the same namespace.","type":"object","properties":{"name":{"description":"Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names","type":"string"}},"x-kubernetes-map-type":"atomic"},"io.k8s.api.core.v1.NFSVolumeSource":{"description":"Represents an NFS mount that lasts the lifetime of a pod. NFS volumes do not support ownership management or SELinux relabeling.","type":"object","required":["server","path"],"properties":{"path":{"description":"path that is exported by the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs","type":"string","default":""},"readOnly":{"description":"readOnly here will force the NFS export to be mounted with read-only permissions. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs","type":"boolean"},"server":{"description":"server is the hostname or IP address of the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs","type":"string","default":""}}},"io.k8s.api.core.v1.NodeAffinity":{"description":"Node affinity is a group of node affinity scheduling rules.","type":"object","properties":{"preferredDuringSchedulingIgnoredDuringExecution":{"description":"The scheduler will prefer to schedule pods to nodes that satisfy the affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding \"weight\" to the sum if the node matches the corresponding matchExpressions; the node(s) with the highest sum are the most preferred.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.PreferredSchedulingTerm"}},"requiredDuringSchedulingIgnoredDuringExecution":{"description":"If the affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to an update), the system may or may not try to eventually evict the pod from its node.","$ref":"#/components/schemas/io.k8s.api.core.v1.NodeSelector"}}},"io.k8s.api.core.v1.NodeSelector":{"description":"A node selector represents the union of the results of one or more label queries over a set of nodes; that is, it represents the OR of the selectors represented by the node selector terms.","type":"object","required":["nodeSelectorTerms"],"properties":{"nodeSelectorTerms":{"description":"Required. A list of node selector terms. The terms are ORed.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.NodeSelectorTerm"}}},"x-kubernetes-map-type":"atomic"},"io.k8s.api.core.v1.NodeSelectorRequirement":{"description":"A node selector requirement is a selector that contains values, a key, and an operator that relates the key and values.","type":"object","required":["key","operator"],"properties":{"key":{"description":"The label key that the selector applies to.","type":"string","default":""},"operator":{"description":"Represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.\n\n","type":"string","default":""},"values":{"description":"An array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. If the operator is Gt or Lt, the values array must have a single element, which will be interpreted as an integer. This array is replaced during a strategic merge patch.","type":"array","items":{"type":"string","default":""}}}},"io.k8s.api.core.v1.NodeSelectorTerm":{"description":"A null or empty node selector term matches no objects. The requirements of them are ANDed. The TopologySelectorTerm type implements a subset of the NodeSelectorTerm.","type":"object","properties":{"matchExpressions":{"description":"A list of node selector requirements by node's labels.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.NodeSelectorRequirement"}},"matchFields":{"description":"A list of node selector requirements by node's fields.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.NodeSelectorRequirement"}}},"x-kubernetes-map-type":"atomic"},"io.k8s.api.core.v1.ObjectFieldSelector":{"description":"ObjectFieldSelector selects an APIVersioned field of an object.","type":"object","required":["fieldPath"],"properties":{"apiVersion":{"description":"Version of the schema the FieldPath is written in terms of, defaults to \"v1\".","type":"string"},"fieldPath":{"description":"Path of the field to select in the specified API version.","type":"string","default":""}},"x-kubernetes-map-type":"atomic"},"io.k8s.api.core.v1.ObjectReference":{"description":"ObjectReference contains enough information to let you inspect or modify the referred object.","type":"object","properties":{"apiVersion":{"description":"API version of the referent.","type":"string"},"fieldPath":{"description":"If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: \"spec.containers{name}\" (where \"name\" refers to the name of the container that triggered the event) or if no container name is specified \"spec.containers[2]\" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object.","type":"string"},"kind":{"description":"Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds","type":"string"},"name":{"description":"Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names","type":"string"},"namespace":{"description":"Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/","type":"string"},"resourceVersion":{"description":"Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency","type":"string"},"uid":{"description":"UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids","type":"string"}},"x-kubernetes-map-type":"atomic"},"io.k8s.api.core.v1.PersistentVolumeClaimSpec":{"description":"PersistentVolumeClaimSpec describes the common attributes of storage devices and allows a Source for provider-specific attributes","type":"object","properties":{"accessModes":{"description":"accessModes contains the desired access modes the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1","type":"array","items":{"type":"string","default":""}},"dataSource":{"description":"dataSource field can be used to specify either: * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot) * An existing PVC (PersistentVolumeClaim) If the provisioner or an external controller can support the specified data source, it will create a new volume based on the contents of the specified data source. If the AnyVolumeDataSource feature gate is enabled, this field will always have the same contents as the DataSourceRef field.","$ref":"#/components/schemas/io.k8s.api.core.v1.TypedLocalObjectReference"},"dataSourceRef":{"description":"dataSourceRef specifies the object from which to populate the volume with data, if a non-empty volume is desired. This may be any local object from a non-empty API group (non core object) or a PersistentVolumeClaim object. When this field is specified, volume binding will only succeed if the type of the specified object matches some installed volume populator or dynamic provisioner. This field will replace the functionality of the DataSource field and as such if both fields are non-empty, they must have the same value. For backwards compatibility, both fields (DataSource and DataSourceRef) will be set to the same value automatically if one of them is empty and the other is non-empty. There are two important differences between DataSource and DataSourceRef: * While DataSource only allows two specific types of objects, DataSourceRef\n allows any non-core object, as well as PersistentVolumeClaim objects.\n* While DataSource ignores disallowed values (dropping them), DataSourceRef\n preserves all values, and generates an error if a disallowed value is\n specified.\n(Alpha) Using this field requires the AnyVolumeDataSource feature gate to be enabled.","$ref":"#/components/schemas/io.k8s.api.core.v1.TypedLocalObjectReference"},"resources":{"description":"resources represents the minimum resources the volume should have. If RecoverVolumeExpansionFailure feature is enabled users are allowed to specify resource requirements that are lower than previous value but must still be higher than capacity recorded in the status field of the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources","default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.ResourceRequirements"},"selector":{"description":"selector is a label query over volumes to consider for binding.","$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector"},"storageClassName":{"description":"storageClassName is the name of the StorageClass required by the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1","type":"string"},"volumeMode":{"description":"volumeMode defines what type of volume is required by the claim. Value of Filesystem is implied when not included in claim spec.","type":"string"},"volumeName":{"description":"volumeName is the binding reference to the PersistentVolume backing this claim.","type":"string"}}},"io.k8s.api.core.v1.PersistentVolumeClaimTemplate":{"description":"PersistentVolumeClaimTemplate is used to produce PersistentVolumeClaim objects as part of an EphemeralVolumeSource.","type":"object","required":["spec"],"properties":{"metadata":{"description":"May contain labels and annotations that will be copied into the PVC when creating it. No other fields are allowed and will be rejected during validation.","default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"},"spec":{"description":"The specification for the PersistentVolumeClaim. The entire content is copied unchanged into the PVC that gets created from this template. The same fields as in a PersistentVolumeClaim are also valid here.","default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaimSpec"}}},"io.k8s.api.core.v1.PersistentVolumeClaimVolumeSource":{"description":"PersistentVolumeClaimVolumeSource references the user's PVC in the same namespace. This volume finds the bound PV and mounts that volume for the pod. A PersistentVolumeClaimVolumeSource is, essentially, a wrapper around another type of volume that is owned by someone else (the system).","type":"object","required":["claimName"],"properties":{"claimName":{"description":"claimName is the name of a PersistentVolumeClaim in the same namespace as the pod using this volume. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims","type":"string","default":""},"readOnly":{"description":"readOnly Will force the ReadOnly setting in VolumeMounts. Default false.","type":"boolean"}}},"io.k8s.api.core.v1.PhotonPersistentDiskVolumeSource":{"description":"Represents a Photon Controller persistent disk resource.","type":"object","required":["pdID"],"properties":{"fsType":{"description":"fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.","type":"string"},"pdID":{"description":"pdID is the ID that identifies Photon Controller persistent disk","type":"string","default":""}}},"io.k8s.api.core.v1.PodAffinity":{"description":"Pod affinity is a group of inter pod affinity scheduling rules.","type":"object","properties":{"preferredDuringSchedulingIgnoredDuringExecution":{"description":"The scheduler will prefer to schedule pods to nodes that satisfy the affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding \"weight\" to the sum if the node has pods which matches the corresponding podAffinityTerm; the node(s) with the highest sum are the most preferred.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.WeightedPodAffinityTerm"}},"requiredDuringSchedulingIgnoredDuringExecution":{"description":"If the affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to a pod label update), the system may or may not try to eventually evict the pod from its node. When there are multiple elements, the lists of nodes corresponding to each podAffinityTerm are intersected, i.e. all terms must be satisfied.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.PodAffinityTerm"}}}},"io.k8s.api.core.v1.PodAffinityTerm":{"description":"Defines a set of pods (namely those matching the labelSelector relative to the given namespace(s)) that this pod should be co-located (affinity) or not co-located (anti-affinity) with, where co-located is defined as running on a node whose value of the label with key \u003ctopologyKey\u003e matches that of any node on which a pod of the set of pods is running","type":"object","required":["topologyKey"],"properties":{"labelSelector":{"description":"A label query over a set of resources, in this case pods.","$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector"},"namespaceSelector":{"description":"A label query over the set of namespaces that the term applies to. The term is applied to the union of the namespaces selected by this field and the ones listed in the namespaces field. null selector and null or empty namespaces list means \"this pod's namespace\". An empty selector ({}) matches all namespaces. This field is beta-level and is only honored when PodAffinityNamespaceSelector feature is enabled.","$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector"},"namespaces":{"description":"namespaces specifies a static list of namespace names that the term applies to. The term is applied to the union of the namespaces listed in this field and the ones selected by namespaceSelector. null or empty namespaces list and null namespaceSelector means \"this pod's namespace\"","type":"array","items":{"type":"string","default":""}},"topologyKey":{"description":"This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching the labelSelector in the specified namespaces, where co-located is defined as running on a node whose value of the label with key topologyKey matches that of any node on which any of the selected pods is running. Empty topologyKey is not allowed.","type":"string","default":""}}},"io.k8s.api.core.v1.PodAntiAffinity":{"description":"Pod anti affinity is a group of inter pod anti affinity scheduling rules.","type":"object","properties":{"preferredDuringSchedulingIgnoredDuringExecution":{"description":"The scheduler will prefer to schedule pods to nodes that satisfy the anti-affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling anti-affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding \"weight\" to the sum if the node has pods which matches the corresponding podAffinityTerm; the node(s) with the highest sum are the most preferred.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.WeightedPodAffinityTerm"}},"requiredDuringSchedulingIgnoredDuringExecution":{"description":"If the anti-affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the anti-affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to a pod label update), the system may or may not try to eventually evict the pod from its node. When there are multiple elements, the lists of nodes corresponding to each podAffinityTerm are intersected, i.e. all terms must be satisfied.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.PodAffinityTerm"}}}},"io.k8s.api.core.v1.PodDNSConfig":{"description":"PodDNSConfig defines the DNS parameters of a pod in addition to those generated from DNSPolicy.","type":"object","properties":{"nameservers":{"description":"A list of DNS name server IP addresses. This will be appended to the base nameservers generated from DNSPolicy. Duplicated nameservers will be removed.","type":"array","items":{"type":"string","default":""}},"options":{"description":"A list of DNS resolver options. This will be merged with the base options generated from DNSPolicy. Duplicated entries will be removed. Resolution options given in Options will override those that appear in the base DNSPolicy.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.PodDNSConfigOption"}},"searches":{"description":"A list of DNS search domains for host-name lookup. This will be appended to the base search paths generated from DNSPolicy. Duplicated search paths will be removed.","type":"array","items":{"type":"string","default":""}}}},"io.k8s.api.core.v1.PodDNSConfigOption":{"description":"PodDNSConfigOption defines DNS resolver options of a pod.","type":"object","properties":{"name":{"description":"Required.","type":"string"},"value":{"type":"string"}}},"io.k8s.api.core.v1.PodOS":{"description":"PodOS defines the OS parameters of a pod.","type":"object","required":["name"],"properties":{"name":{"description":"Name is the name of the operating system. The currently supported values are linux and windows. Additional value may be defined in future and can be one of: https://github.com/opencontainers/runtime-spec/blob/master/config.md#platform-specific-configuration Clients should expect to handle additional values and treat unrecognized values in this field as os: null","type":"string","default":""}}},"io.k8s.api.core.v1.PodReadinessGate":{"description":"PodReadinessGate contains the reference to a pod condition","type":"object","required":["conditionType"],"properties":{"conditionType":{"description":"ConditionType refers to a condition in the pod's condition list with matching type.\n\n","type":"string","default":""}}},"io.k8s.api.core.v1.PodSecurityContext":{"description":"PodSecurityContext holds pod-level security attributes and common container settings. Some fields are also present in container.securityContext. Field values of container.securityContext take precedence over field values of PodSecurityContext.","type":"object","properties":{"fsGroup":{"description":"A special supplemental group that applies to all containers in a pod. Some volume types allow the Kubelet to change the ownership of that volume to be owned by the pod:\n\n1. The owning GID will be the FSGroup 2. The setgid bit is set (new files created in the volume will be owned by FSGroup) 3. The permission bits are OR'd with rw-rw----\n\nIf unset, the Kubelet will not modify the ownership and permissions of any volume. Note that this field cannot be set when spec.os.name is windows.","type":"integer","format":"int64"},"fsGroupChangePolicy":{"description":"fsGroupChangePolicy defines behavior of changing ownership and permission of the volume before being exposed inside Pod. This field will only apply to volume types which support fsGroup based ownership(and permissions). It will have no effect on ephemeral volume types such as: secret, configmaps and emptydir. Valid values are \"OnRootMismatch\" and \"Always\". If not specified, \"Always\" is used. Note that this field cannot be set when spec.os.name is windows.","type":"string"},"runAsGroup":{"description":"The GID to run the entrypoint of the container process. Uses runtime default if unset. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container. Note that this field cannot be set when spec.os.name is windows.","type":"integer","format":"int64"},"runAsNonRoot":{"description":"Indicates that the container must run as a non-root user. If true, the Kubelet will validate the image at runtime to ensure that it does not run as UID 0 (root) and fail to start the container if it does. If unset or false, no such validation will be performed. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.","type":"boolean"},"runAsUser":{"description":"The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container. Note that this field cannot be set when spec.os.name is windows.","type":"integer","format":"int64"},"seLinuxOptions":{"description":"The SELinux context to be applied to all containers. If unspecified, the container runtime will allocate a random SELinux context for each container. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container. Note that this field cannot be set when spec.os.name is windows.","$ref":"#/components/schemas/io.k8s.api.core.v1.SELinuxOptions"},"seccompProfile":{"description":"The seccomp options to use by the containers in this pod. Note that this field cannot be set when spec.os.name is windows.","$ref":"#/components/schemas/io.k8s.api.core.v1.SeccompProfile"},"supplementalGroups":{"description":"A list of groups applied to the first process run in each container, in addition to the container's primary GID. If unspecified, no groups will be added to any container. Note that this field cannot be set when spec.os.name is windows.","type":"array","items":{"type":"integer","format":"int64","default":0}},"sysctls":{"description":"Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported sysctls (by the container runtime) might fail to launch. Note that this field cannot be set when spec.os.name is windows.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.Sysctl"}},"windowsOptions":{"description":"The Windows specific settings applied to all containers. If unspecified, the options within a container's SecurityContext will be used. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. Note that this field cannot be set when spec.os.name is linux.","$ref":"#/components/schemas/io.k8s.api.core.v1.WindowsSecurityContextOptions"}}},"io.k8s.api.core.v1.PodSpec":{"description":"PodSpec is a description of a pod.","type":"object","required":["containers"],"properties":{"activeDeadlineSeconds":{"description":"Optional duration in seconds the pod may be active on the node relative to StartTime before the system will actively try to mark it failed and kill associated containers. Value must be a positive integer.","type":"integer","format":"int64"},"affinity":{"description":"If specified, the pod's scheduling constraints","$ref":"#/components/schemas/io.k8s.api.core.v1.Affinity"},"automountServiceAccountToken":{"description":"AutomountServiceAccountToken indicates whether a service account token should be automatically mounted.","type":"boolean"},"containers":{"description":"List of containers belonging to the pod. Containers cannot currently be added or removed. There must be at least one container in a Pod. Cannot be updated.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.Container"},"x-kubernetes-patch-merge-key":"name","x-kubernetes-patch-strategy":"merge"},"dnsConfig":{"description":"Specifies the DNS parameters of a pod. Parameters specified here will be merged to the generated DNS configuration based on DNSPolicy.","$ref":"#/components/schemas/io.k8s.api.core.v1.PodDNSConfig"},"dnsPolicy":{"description":"Set DNS policy for the pod. Defaults to \"ClusterFirst\". Valid values are 'ClusterFirstWithHostNet', 'ClusterFirst', 'Default' or 'None'. DNS parameters given in DNSConfig will be merged with the policy selected with DNSPolicy. To have DNS options set along with hostNetwork, you have to specify DNS policy explicitly to 'ClusterFirstWithHostNet'.\n\n","type":"string"},"enableServiceLinks":{"description":"EnableServiceLinks indicates whether information about services should be injected into pod's environment variables, matching the syntax of Docker links. Optional: Defaults to true.","type":"boolean"},"ephemeralContainers":{"description":"List of ephemeral containers run in this pod. Ephemeral containers may be run in an existing pod to perform user-initiated actions such as debugging. This list cannot be specified when creating a pod, and it cannot be modified by updating the pod spec. In order to add an ephemeral container to an existing pod, use the pod's ephemeralcontainers subresource.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.EphemeralContainer"},"x-kubernetes-patch-merge-key":"name","x-kubernetes-patch-strategy":"merge"},"hostAliases":{"description":"HostAliases is an optional list of hosts and IPs that will be injected into the pod's hosts file if specified. This is only valid for non-hostNetwork pods.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.HostAlias"},"x-kubernetes-patch-merge-key":"ip","x-kubernetes-patch-strategy":"merge"},"hostIPC":{"description":"Use the host's ipc namespace. Optional: Default to false.","type":"boolean"},"hostNetwork":{"description":"Host networking requested for this pod. Use the host's network namespace. If this option is set, the ports that will be used must be specified. Default to false.","type":"boolean"},"hostPID":{"description":"Use the host's pid namespace. Optional: Default to false.","type":"boolean"},"hostname":{"description":"Specifies the hostname of the Pod If not specified, the pod's hostname will be set to a system-defined value.","type":"string"},"imagePullSecrets":{"description":"ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this PodSpec. If specified, these secrets will be passed to individual puller implementations for them to use. For example, in the case of docker, only DockerConfig type secrets are honored. More info: https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.LocalObjectReference"},"x-kubernetes-patch-merge-key":"name","x-kubernetes-patch-strategy":"merge"},"initContainers":{"description":"List of initialization containers belonging to the pod. Init containers are executed in order prior to containers being started. If any init container fails, the pod is considered to have failed and is handled according to its restartPolicy. The name for an init container or normal container must be unique among all containers. Init containers may not have Lifecycle actions, Readiness probes, Liveness probes, or Startup probes. The resourceRequirements of an init container are taken into account during scheduling by finding the highest request/limit for each resource type, and then using the max of of that value or the sum of the normal containers. Limits are applied to init containers in a similar fashion. Init containers cannot currently be added or removed. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.Container"},"x-kubernetes-patch-merge-key":"name","x-kubernetes-patch-strategy":"merge"},"nodeName":{"description":"NodeName is a request to schedule this pod onto a specific node. If it is non-empty, the scheduler simply schedules this pod onto that node, assuming that it fits resource requirements.","type":"string"},"nodeSelector":{"description":"NodeSelector is a selector which must be true for the pod to fit on a node. Selector which must match a node's labels for the pod to be scheduled on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/","type":"object","additionalProperties":{"type":"string","default":""},"x-kubernetes-map-type":"atomic"},"os":{"description":"Specifies the OS of the containers in the pod. Some pod and container fields are restricted if this is set.\n\nIf the OS field is set to linux, the following fields must be unset: -securityContext.windowsOptions\n\nIf the OS field is set to windows, following fields must be unset: - spec.hostPID - spec.hostIPC - spec.securityContext.seLinuxOptions - spec.securityContext.seccompProfile - spec.securityContext.fsGroup - spec.securityContext.fsGroupChangePolicy - spec.securityContext.sysctls - spec.shareProcessNamespace - spec.securityContext.runAsUser - spec.securityContext.runAsGroup - spec.securityContext.supplementalGroups - spec.containers[*].securityContext.seLinuxOptions - spec.containers[*].securityContext.seccompProfile - spec.containers[*].securityContext.capabilities - spec.containers[*].securityContext.readOnlyRootFilesystem - spec.containers[*].securityContext.privileged - spec.containers[*].securityContext.allowPrivilegeEscalation - spec.containers[*].securityContext.procMount - spec.containers[*].securityContext.runAsUser - spec.containers[*].securityContext.runAsGroup This is an alpha field and requires the IdentifyPodOS feature","$ref":"#/components/schemas/io.k8s.api.core.v1.PodOS"},"overhead":{"description":"Overhead represents the resource overhead associated with running a pod for a given RuntimeClass. This field will be autopopulated at admission time by the RuntimeClass admission controller. If the RuntimeClass admission controller is enabled, overhead must not be set in Pod create requests. The RuntimeClass admission controller will reject Pod create requests which have the overhead already set. If RuntimeClass is configured and selected in the PodSpec, Overhead will be set to the value defined in the corresponding RuntimeClass, otherwise it will remain unset and treated as zero. More info: https://git.k8s.io/enhancements/keps/sig-node/688-pod-overhead/README.md This field is beta-level as of Kubernetes v1.18, and is only honored by servers that enable the PodOverhead feature.","type":"object","additionalProperties":{"default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.api.resource.Quantity"}},"preemptionPolicy":{"description":"PreemptionPolicy is the Policy for preempting pods with lower priority. One of Never, PreemptLowerPriority. Defaults to PreemptLowerPriority if unset.","type":"string"},"priority":{"description":"The priority value. Various system components use this field to find the priority of the pod. When Priority Admission Controller is enabled, it prevents users from setting this field. The admission controller populates this field from PriorityClassName. The higher the value, the higher the priority.","type":"integer","format":"int32"},"priorityClassName":{"description":"If specified, indicates the pod's priority. \"system-node-critical\" and \"system-cluster-critical\" are two special keywords which indicate the highest priorities with the former being the highest priority. Any other name must be defined by creating a PriorityClass object with that name. If not specified, the pod priority will be default or zero if there is no default.","type":"string"},"readinessGates":{"description":"If specified, all readiness gates will be evaluated for pod readiness. A pod is ready when all its containers are ready AND all conditions specified in the readiness gates have status equal to \"True\" More info: https://git.k8s.io/enhancements/keps/sig-network/580-pod-readiness-gates","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.PodReadinessGate"}},"restartPolicy":{"description":"Restart policy for all containers within the pod. One of Always, OnFailure, Never. Default to Always. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy\n\n","type":"string"},"runtimeClassName":{"description":"RuntimeClassName refers to a RuntimeClass object in the node.k8s.io group, which should be used to run this pod. If no RuntimeClass resource matches the named class, the pod will not be run. If unset or empty, the \"legacy\" RuntimeClass will be used, which is an implicit class with an empty definition that uses the default runtime handler. More info: https://git.k8s.io/enhancements/keps/sig-node/585-runtime-class This is a beta feature as of Kubernetes v1.14.","type":"string"},"schedulerName":{"description":"If specified, the pod will be dispatched by specified scheduler. If not specified, the pod will be dispatched by default scheduler.","type":"string"},"securityContext":{"description":"SecurityContext holds pod-level security attributes and common container settings. Optional: Defaults to empty. See type description for default values of each field.","$ref":"#/components/schemas/io.k8s.api.core.v1.PodSecurityContext"},"serviceAccount":{"description":"DeprecatedServiceAccount is a deprecated alias for ServiceAccountName. Deprecated: Use serviceAccountName instead.","type":"string"},"serviceAccountName":{"description":"ServiceAccountName is the name of the ServiceAccount to use to run this pod. More info: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/","type":"string"},"setHostnameAsFQDN":{"description":"If true the pod's hostname will be configured as the pod's FQDN, rather than the leaf name (the default). In Linux containers, this means setting the FQDN in the hostname field of the kernel (the nodename field of struct utsname). In Windows containers, this means setting the registry value of hostname for the registry key HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters to FQDN. If a pod does not have FQDN, this has no effect. Default to false.","type":"boolean"},"shareProcessNamespace":{"description":"Share a single process namespace between all of the containers in a pod. When this is set containers will be able to view and signal processes from other containers in the same pod, and the first process in each container will not be assigned PID 1. HostPID and ShareProcessNamespace cannot both be set. Optional: Default to false.","type":"boolean"},"subdomain":{"description":"If specified, the fully qualified Pod hostname will be \"\u003chostname\u003e.\u003csubdomain\u003e.\u003cpod namespace\u003e.svc.\u003ccluster domain\u003e\". If not specified, the pod will not have a domainname at all.","type":"string"},"terminationGracePeriodSeconds":{"description":"Optional duration in seconds the pod needs to terminate gracefully. May be decreased in delete request. Value must be non-negative integer. The value zero indicates stop immediately via the kill signal (no opportunity to shut down). If this value is nil, the default grace period will be used instead. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. Defaults to 30 seconds.","type":"integer","format":"int64"},"tolerations":{"description":"If specified, the pod's tolerations.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.Toleration"}},"topologySpreadConstraints":{"description":"TopologySpreadConstraints describes how a group of pods ought to spread across topology domains. Scheduler will schedule pods in a way which abides by the constraints. All topologySpreadConstraints are ANDed.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.TopologySpreadConstraint"},"x-kubernetes-list-map-keys":["topologyKey","whenUnsatisfiable"],"x-kubernetes-list-type":"map","x-kubernetes-patch-merge-key":"topologyKey","x-kubernetes-patch-strategy":"merge"},"volumes":{"description":"List of volumes that can be mounted by containers belonging to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.Volume"},"x-kubernetes-patch-merge-key":"name","x-kubernetes-patch-strategy":"merge,retainKeys"}}},"io.k8s.api.core.v1.PodTemplateSpec":{"description":"PodTemplateSpec describes the data a pod should have when created from a template","type":"object","properties":{"metadata":{"description":"Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata","default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"},"spec":{"description":"Specification of the desired behavior of the pod. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status","default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.PodSpec"}}},"io.k8s.api.core.v1.PortworxVolumeSource":{"description":"PortworxVolumeSource represents a Portworx volume resource.","type":"object","required":["volumeID"],"properties":{"fsType":{"description":"fSType represents the filesystem type to mount Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\". Implicitly inferred to be \"ext4\" if unspecified.","type":"string"},"readOnly":{"description":"readOnly defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.","type":"boolean"},"volumeID":{"description":"volumeID uniquely identifies a Portworx volume","type":"string","default":""}}},"io.k8s.api.core.v1.PreferredSchedulingTerm":{"description":"An empty preferred scheduling term matches all objects with implicit weight 0 (i.e. it's a no-op). A null preferred scheduling term matches no objects (i.e. is also a no-op).","type":"object","required":["weight","preference"],"properties":{"preference":{"description":"A node selector term, associated with the corresponding weight.","default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.NodeSelectorTerm"},"weight":{"description":"Weight associated with matching the corresponding nodeSelectorTerm, in the range 1-100.","type":"integer","format":"int32","default":0}}},"io.k8s.api.core.v1.Probe":{"description":"Probe describes a health check to be performed against a container to determine whether it is alive or ready to receive traffic.","type":"object","properties":{"exec":{"description":"Exec specifies the action to take.","$ref":"#/components/schemas/io.k8s.api.core.v1.ExecAction"},"failureThreshold":{"description":"Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1.","type":"integer","format":"int32"},"grpc":{"description":"GRPC specifies an action involving a GRPC port.","$ref":"#/components/schemas/io.k8s.api.core.v1.GRPCAction"},"httpGet":{"description":"HTTPGet specifies the http request to perform.","$ref":"#/components/schemas/io.k8s.api.core.v1.HTTPGetAction"},"initialDelaySeconds":{"description":"Number of seconds after the container has started before liveness probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes","type":"integer","format":"int32"},"periodSeconds":{"description":"How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1.","type":"integer","format":"int32"},"successThreshold":{"description":"Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1.","type":"integer","format":"int32"},"tcpSocket":{"description":"TCPSocket specifies an action involving a TCP port.","$ref":"#/components/schemas/io.k8s.api.core.v1.TCPSocketAction"},"terminationGracePeriodSeconds":{"description":"Optional duration in seconds the pod needs to terminate gracefully upon probe failure. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this value overrides the value provided by the pod spec. Value must be non-negative integer. The value zero indicates stop immediately via the kill signal (no opportunity to shut down). This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate. Minimum value is 1. spec.terminationGracePeriodSeconds is used if unset.","type":"integer","format":"int64"},"timeoutSeconds":{"description":"Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes","type":"integer","format":"int32"}}},"io.k8s.api.core.v1.ProjectedVolumeSource":{"description":"Represents a projected volume source","type":"object","properties":{"defaultMode":{"description":"defaultMode are the mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.","type":"integer","format":"int32"},"sources":{"description":"sources is the list of volume projections","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.VolumeProjection"}}}},"io.k8s.api.core.v1.QuobyteVolumeSource":{"description":"Represents a Quobyte mount that lasts the lifetime of a pod. Quobyte volumes do not support ownership management or SELinux relabeling.","type":"object","required":["registry","volume"],"properties":{"group":{"description":"group to map volume access to Default is no group","type":"string"},"readOnly":{"description":"readOnly here will force the Quobyte volume to be mounted with read-only permissions. Defaults to false.","type":"boolean"},"registry":{"description":"registry represents a single or multiple Quobyte Registry services specified as a string as host:port pair (multiple entries are separated with commas) which acts as the central registry for volumes","type":"string","default":""},"tenant":{"description":"tenant owning the given Quobyte volume in the Backend Used with dynamically provisioned Quobyte volumes, value is set by the plugin","type":"string"},"user":{"description":"user to map volume access to Defaults to serivceaccount user","type":"string"},"volume":{"description":"volume is a string that references an already created Quobyte volume by name.","type":"string","default":""}}},"io.k8s.api.core.v1.RBDVolumeSource":{"description":"Represents a Rados Block Device mount that lasts the lifetime of a pod. RBD volumes support ownership management and SELinux relabeling.","type":"object","required":["monitors","image"],"properties":{"fsType":{"description":"fsType is the filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#rbd","type":"string"},"image":{"description":"image is the rados image name. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it","type":"string","default":""},"keyring":{"description":"keyring is the path to key ring for RBDUser. Default is /etc/ceph/keyring. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it","type":"string"},"monitors":{"description":"monitors is a collection of Ceph monitors. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it","type":"array","items":{"type":"string","default":""}},"pool":{"description":"pool is the rados pool name. Default is rbd. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it","type":"string"},"readOnly":{"description":"readOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it","type":"boolean"},"secretRef":{"description":"secretRef is name of the authentication secret for RBDUser. If provided overrides keyring. Default is nil. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it","$ref":"#/components/schemas/io.k8s.api.core.v1.LocalObjectReference"},"user":{"description":"user is the rados user name. Default is admin. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it","type":"string"}}},"io.k8s.api.core.v1.ResourceFieldSelector":{"description":"ResourceFieldSelector represents container resources (cpu, memory) and their output format","type":"object","required":["resource"],"properties":{"containerName":{"description":"Container name: required for volumes, optional for env vars","type":"string"},"divisor":{"description":"Specifies the output format of the exposed resources, defaults to \"1\"","default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.api.resource.Quantity"},"resource":{"description":"Required: resource to select","type":"string","default":""}},"x-kubernetes-map-type":"atomic"},"io.k8s.api.core.v1.ResourceRequirements":{"description":"ResourceRequirements describes the compute resource requirements.","type":"object","properties":{"limits":{"description":"Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/","type":"object","additionalProperties":{"default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.api.resource.Quantity"}},"requests":{"description":"Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/","type":"object","additionalProperties":{"default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.api.resource.Quantity"}}}},"io.k8s.api.core.v1.SELinuxOptions":{"description":"SELinuxOptions are the labels to be applied to the container","type":"object","properties":{"level":{"description":"Level is SELinux level label that applies to the container.","type":"string"},"role":{"description":"Role is a SELinux role label that applies to the container.","type":"string"},"type":{"description":"Type is a SELinux type label that applies to the container.","type":"string"},"user":{"description":"User is a SELinux user label that applies to the container.","type":"string"}}},"io.k8s.api.core.v1.ScaleIOVolumeSource":{"description":"ScaleIOVolumeSource represents a persistent ScaleIO volume","type":"object","required":["gateway","system","secretRef"],"properties":{"fsType":{"description":"fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Default is \"xfs\".","type":"string"},"gateway":{"description":"gateway is the host address of the ScaleIO API Gateway.","type":"string","default":""},"protectionDomain":{"description":"protectionDomain is the name of the ScaleIO Protection Domain for the configured storage.","type":"string"},"readOnly":{"description":"readOnly Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.","type":"boolean"},"secretRef":{"description":"secretRef references to the secret for ScaleIO user and other sensitive information. If this is not provided, Login operation will fail.","$ref":"#/components/schemas/io.k8s.api.core.v1.LocalObjectReference"},"sslEnabled":{"description":"sslEnabled Flag enable/disable SSL communication with Gateway, default false","type":"boolean"},"storageMode":{"description":"storageMode indicates whether the storage for a volume should be ThickProvisioned or ThinProvisioned. Default is ThinProvisioned.","type":"string"},"storagePool":{"description":"storagePool is the ScaleIO Storage Pool associated with the protection domain.","type":"string"},"system":{"description":"system is the name of the storage system as configured in ScaleIO.","type":"string","default":""},"volumeName":{"description":"volumeName is the name of a volume already created in the ScaleIO system that is associated with this volume source.","type":"string"}}},"io.k8s.api.core.v1.SeccompProfile":{"description":"SeccompProfile defines a pod/container's seccomp profile settings. Only one profile source may be set.","type":"object","required":["type"],"properties":{"localhostProfile":{"description":"localhostProfile indicates a profile defined in a file on the node should be used. The profile must be preconfigured on the node to work. Must be a descending path, relative to the kubelet's configured seccomp profile location. Must only be set if type is \"Localhost\".","type":"string"},"type":{"description":"type indicates which kind of seccomp profile will be applied. Valid options are:\n\nLocalhost - a profile defined in a file on the node should be used. RuntimeDefault - the container runtime default profile should be used. Unconfined - no profile should be applied.\n\n","type":"string","default":""}},"x-kubernetes-unions":[{"discriminator":"type","fields-to-discriminateBy":{"localhostProfile":"LocalhostProfile"}}]},"io.k8s.api.core.v1.SecretEnvSource":{"description":"SecretEnvSource selects a Secret to populate the environment variables with.\n\nThe contents of the target Secret's Data field will represent the key-value pairs as environment variables.","type":"object","properties":{"name":{"description":"Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names","type":"string"},"optional":{"description":"Specify whether the Secret must be defined","type":"boolean"}}},"io.k8s.api.core.v1.SecretKeySelector":{"description":"SecretKeySelector selects a key of a Secret.","type":"object","required":["key"],"properties":{"key":{"description":"The key of the secret to select from. Must be a valid secret key.","type":"string","default":""},"name":{"description":"Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names","type":"string"},"optional":{"description":"Specify whether the Secret or its key must be defined","type":"boolean"}},"x-kubernetes-map-type":"atomic"},"io.k8s.api.core.v1.SecretProjection":{"description":"Adapts a secret into a projected volume.\n\nThe contents of the target Secret's Data field will be presented in a projected volume as files using the keys in the Data field as the file names. Note that this is identical to a secret volume source without the default mode.","type":"object","properties":{"items":{"description":"items if unspecified, each key-value pair in the Data field of the referenced Secret will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the Secret, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.KeyToPath"}},"name":{"description":"Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names","type":"string"},"optional":{"description":"optional field specify whether the Secret or its key must be defined","type":"boolean"}}},"io.k8s.api.core.v1.SecretVolumeSource":{"description":"Adapts a Secret into a volume.\n\nThe contents of the target Secret's Data field will be presented in a volume as files using the keys in the Data field as the file names. Secret volumes support ownership management and SELinux relabeling.","type":"object","properties":{"defaultMode":{"description":"defaultMode is Optional: mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.","type":"integer","format":"int32"},"items":{"description":"items If unspecified, each key-value pair in the Data field of the referenced Secret will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the Secret, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.KeyToPath"}},"optional":{"description":"optional field specify whether the Secret or its keys must be defined","type":"boolean"},"secretName":{"description":"secretName is the name of the secret in the pod's namespace to use. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret","type":"string"}}},"io.k8s.api.core.v1.SecurityContext":{"description":"SecurityContext holds security configuration that will be applied to a container. Some fields are present in both SecurityContext and PodSecurityContext. When both are set, the values in SecurityContext take precedence.","type":"object","properties":{"allowPrivilegeEscalation":{"description":"AllowPrivilegeEscalation controls whether a process can gain more privileges than its parent process. This bool directly controls if the no_new_privs flag will be set on the container process. AllowPrivilegeEscalation is true always when the container is: 1) run as Privileged 2) has CAP_SYS_ADMIN Note that this field cannot be set when spec.os.name is windows.","type":"boolean"},"capabilities":{"description":"The capabilities to add/drop when running containers. Defaults to the default set of capabilities granted by the container runtime. Note that this field cannot be set when spec.os.name is windows.","$ref":"#/components/schemas/io.k8s.api.core.v1.Capabilities"},"privileged":{"description":"Run container in privileged mode. Processes in privileged containers are essentially equivalent to root on the host. Defaults to false. Note that this field cannot be set when spec.os.name is windows.","type":"boolean"},"procMount":{"description":"procMount denotes the type of proc mount to use for the containers. The default is DefaultProcMount which uses the container runtime defaults for readonly paths and masked paths. This requires the ProcMountType feature flag to be enabled. Note that this field cannot be set when spec.os.name is windows.","type":"string"},"readOnlyRootFilesystem":{"description":"Whether this container has a read-only root filesystem. Default is false. Note that this field cannot be set when spec.os.name is windows.","type":"boolean"},"runAsGroup":{"description":"The GID to run the entrypoint of the container process. Uses runtime default if unset. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. Note that this field cannot be set when spec.os.name is windows.","type":"integer","format":"int64"},"runAsNonRoot":{"description":"Indicates that the container must run as a non-root user. If true, the Kubelet will validate the image at runtime to ensure that it does not run as UID 0 (root) and fail to start the container if it does. If unset or false, no such validation will be performed. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.","type":"boolean"},"runAsUser":{"description":"The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. Note that this field cannot be set when spec.os.name is windows.","type":"integer","format":"int64"},"seLinuxOptions":{"description":"The SELinux context to be applied to the container. If unspecified, the container runtime will allocate a random SELinux context for each container. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. Note that this field cannot be set when spec.os.name is windows.","$ref":"#/components/schemas/io.k8s.api.core.v1.SELinuxOptions"},"seccompProfile":{"description":"The seccomp options to use by this container. If seccomp options are provided at both the pod \u0026 container level, the container options override the pod options. Note that this field cannot be set when spec.os.name is windows.","$ref":"#/components/schemas/io.k8s.api.core.v1.SeccompProfile"},"windowsOptions":{"description":"The Windows specific settings applied to all containers. If unspecified, the options from the PodSecurityContext will be used. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. Note that this field cannot be set when spec.os.name is linux.","$ref":"#/components/schemas/io.k8s.api.core.v1.WindowsSecurityContextOptions"}}},"io.k8s.api.core.v1.ServiceAccountTokenProjection":{"description":"ServiceAccountTokenProjection represents a projected service account token volume. This projection can be used to insert a service account token into the pods runtime filesystem for use against APIs (Kubernetes API Server or otherwise).","type":"object","required":["path"],"properties":{"audience":{"description":"audience is the intended audience of the token. A recipient of a token must identify itself with an identifier specified in the audience of the token, and otherwise should reject the token. The audience defaults to the identifier of the apiserver.","type":"string"},"expirationSeconds":{"description":"expirationSeconds is the requested duration of validity of the service account token. As the token approaches expiration, the kubelet volume plugin will proactively rotate the service account token. The kubelet will start trying to rotate the token if the token is older than 80 percent of its time to live or if the token is older than 24 hours.Defaults to 1 hour and must be at least 10 minutes.","type":"integer","format":"int64"},"path":{"description":"path is the path relative to the mount point of the file to project the token into.","type":"string","default":""}}},"io.k8s.api.core.v1.StorageOSVolumeSource":{"description":"Represents a StorageOS persistent volume resource.","type":"object","properties":{"fsType":{"description":"fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.","type":"string"},"readOnly":{"description":"readOnly defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.","type":"boolean"},"secretRef":{"description":"secretRef specifies the secret to use for obtaining the StorageOS API credentials. If not specified, default values will be attempted.","$ref":"#/components/schemas/io.k8s.api.core.v1.LocalObjectReference"},"volumeName":{"description":"volumeName is the human-readable name of the StorageOS volume. Volume names are only unique within a namespace.","type":"string"},"volumeNamespace":{"description":"volumeNamespace specifies the scope of the volume within StorageOS. If no namespace is specified then the Pod's namespace will be used. This allows the Kubernetes name scoping to be mirrored within StorageOS for tighter integration. Set VolumeName to any name to override the default behaviour. Set to \"default\" if you are not using namespaces within StorageOS. Namespaces that do not pre-exist within StorageOS will be created.","type":"string"}}},"io.k8s.api.core.v1.Sysctl":{"description":"Sysctl defines a kernel parameter to be set","type":"object","required":["name","value"],"properties":{"name":{"description":"Name of a property to set","type":"string","default":""},"value":{"description":"Value of a property to set","type":"string","default":""}}},"io.k8s.api.core.v1.TCPSocketAction":{"description":"TCPSocketAction describes an action based on opening a socket","type":"object","required":["port"],"properties":{"host":{"description":"Optional: Host name to connect to, defaults to the pod IP.","type":"string"},"port":{"description":"Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME.","default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.util.intstr.IntOrString"}}},"io.k8s.api.core.v1.Toleration":{"description":"The pod this Toleration is attached to tolerates any taint that matches the triple \u003ckey,value,effect\u003e using the matching operator \u003coperator\u003e.","type":"object","properties":{"effect":{"description":"Effect indicates the taint effect to match. Empty means match all taint effects. When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute.\n\n","type":"string"},"key":{"description":"Key is the taint key that the toleration applies to. Empty means match all taint keys. If the key is empty, operator must be Exists; this combination means to match all values and all keys.","type":"string"},"operator":{"description":"Operator represents a key's relationship to the value. Valid operators are Exists and Equal. Defaults to Equal. Exists is equivalent to wildcard for value, so that a pod can tolerate all taints of a particular category.\n\n","type":"string"},"tolerationSeconds":{"description":"TolerationSeconds represents the period of time the toleration (which must be of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default, it is not set, which means tolerate the taint forever (do not evict). Zero and negative values will be treated as 0 (evict immediately) by the system.","type":"integer","format":"int64"},"value":{"description":"Value is the taint value the toleration matches to. If the operator is Exists, the value should be empty, otherwise just a regular string.","type":"string"}}},"io.k8s.api.core.v1.TopologySpreadConstraint":{"description":"TopologySpreadConstraint specifies how to spread matching pods among the given topology.","type":"object","required":["maxSkew","topologyKey","whenUnsatisfiable"],"properties":{"labelSelector":{"description":"LabelSelector is used to find matching pods. Pods that match this label selector are counted to determine the number of pods in their corresponding topology domain.","$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector"},"maxSkew":{"description":"MaxSkew describes the degree to which pods may be unevenly distributed. When `whenUnsatisfiable=DoNotSchedule`, it is the maximum permitted difference between the number of matching pods in the target topology and the global minimum. For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same labelSelector spread as 1/1/0: | zone1 | zone2 | zone3 | | P | P | | - if MaxSkew is 1, incoming pod can only be scheduled to zone3 to become 1/1/1; scheduling it onto zone1(zone2) would make the ActualSkew(2-0) on zone1(zone2) violate MaxSkew(1). - if MaxSkew is 2, incoming pod can be scheduled onto any zone. When `whenUnsatisfiable=ScheduleAnyway`, it is used to give higher precedence to topologies that satisfy it. It's a required field. Default value is 1 and 0 is not allowed.","type":"integer","format":"int32","default":0},"topologyKey":{"description":"TopologyKey is the key of node labels. Nodes that have a label with this key and identical values are considered to be in the same topology. We consider each \u003ckey, value\u003e as a \"bucket\", and try to put balanced number of pods into each bucket. It's a required field.","type":"string","default":""},"whenUnsatisfiable":{"description":"WhenUnsatisfiable indicates how to deal with a pod if it doesn't satisfy the spread constraint. - DoNotSchedule (default) tells the scheduler not to schedule it. - ScheduleAnyway tells the scheduler to schedule the pod in any location,\n but giving higher precedence to topologies that would help reduce the\n skew.\nA constraint is considered \"Unsatisfiable\" for an incoming pod if and only if every possible node assignment for that pod would violate \"MaxSkew\" on some topology. For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same labelSelector spread as 3/1/1: | zone1 | zone2 | zone3 | | P P P | P | P | If WhenUnsatisfiable is set to DoNotSchedule, incoming pod can only be scheduled to zone2(zone3) to become 3/2/1(3/1/2) as ActualSkew(2-1) on zone2(zone3) satisfies MaxSkew(1). In other words, the cluster can still be imbalanced, but scheduler won't make it *more* imbalanced. It's a required field.\n\n","type":"string","default":""}}},"io.k8s.api.core.v1.TypedLocalObjectReference":{"description":"TypedLocalObjectReference contains enough information to let you locate the typed referenced object inside the same namespace.","type":"object","required":["kind","name"],"properties":{"apiGroup":{"description":"APIGroup is the group for the resource being referenced. If APIGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, APIGroup is required.","type":"string"},"kind":{"description":"Kind is the type of resource being referenced","type":"string","default":""},"name":{"description":"Name is the name of resource being referenced","type":"string","default":""}},"x-kubernetes-map-type":"atomic"},"io.k8s.api.core.v1.Volume":{"description":"Volume represents a named volume in a pod that may be accessed by any container in the pod.","type":"object","required":["name"],"properties":{"awsElasticBlockStore":{"description":"awsElasticBlockStore represents an AWS Disk resource that is attached to a kubelet's host machine and then exposed to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore","$ref":"#/components/schemas/io.k8s.api.core.v1.AWSElasticBlockStoreVolumeSource"},"azureDisk":{"description":"azureDisk represents an Azure Data Disk mount on the host and bind mount to the pod.","$ref":"#/components/schemas/io.k8s.api.core.v1.AzureDiskVolumeSource"},"azureFile":{"description":"azureFile represents an Azure File Service mount on the host and bind mount to the pod.","$ref":"#/components/schemas/io.k8s.api.core.v1.AzureFileVolumeSource"},"cephfs":{"description":"cephFS represents a Ceph FS mount on the host that shares a pod's lifetime","$ref":"#/components/schemas/io.k8s.api.core.v1.CephFSVolumeSource"},"cinder":{"description":"cinder represents a cinder volume attached and mounted on kubelets host machine. More info: https://examples.k8s.io/mysql-cinder-pd/README.md","$ref":"#/components/schemas/io.k8s.api.core.v1.CinderVolumeSource"},"configMap":{"description":"configMap represents a configMap that should populate this volume","$ref":"#/components/schemas/io.k8s.api.core.v1.ConfigMapVolumeSource"},"csi":{"description":"csi (Container Storage Interface) represents ephemeral storage that is handled by certain external CSI drivers (Beta feature).","$ref":"#/components/schemas/io.k8s.api.core.v1.CSIVolumeSource"},"downwardAPI":{"description":"downwardAPI represents downward API about the pod that should populate this volume","$ref":"#/components/schemas/io.k8s.api.core.v1.DownwardAPIVolumeSource"},"emptyDir":{"description":"emptyDir represents a temporary directory that shares a pod's lifetime. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir","$ref":"#/components/schemas/io.k8s.api.core.v1.EmptyDirVolumeSource"},"ephemeral":{"description":"ephemeral represents a volume that is handled by a cluster storage driver. The volume's lifecycle is tied to the pod that defines it - it will be created before the pod starts, and deleted when the pod is removed.\n\nUse this if: a) the volume is only needed while the pod runs, b) features of normal volumes like restoring from snapshot or capacity\n tracking are needed,\nc) the storage driver is specified through a storage class, and d) the storage driver supports dynamic volume provisioning through\n a PersistentVolumeClaim (see EphemeralVolumeSource for more\n information on the connection between this volume type\n and PersistentVolumeClaim).\n\nUse PersistentVolumeClaim or one of the vendor-specific APIs for volumes that persist for longer than the lifecycle of an individual pod.\n\nUse CSI for light-weight local ephemeral volumes if the CSI driver is meant to be used that way - see the documentation of the driver for more information.\n\nA pod can use both types of ephemeral volumes and persistent volumes at the same time.","$ref":"#/components/schemas/io.k8s.api.core.v1.EphemeralVolumeSource"},"fc":{"description":"fc represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod.","$ref":"#/components/schemas/io.k8s.api.core.v1.FCVolumeSource"},"flexVolume":{"description":"flexVolume represents a generic volume resource that is provisioned/attached using an exec based plugin.","$ref":"#/components/schemas/io.k8s.api.core.v1.FlexVolumeSource"},"flocker":{"description":"flocker represents a Flocker volume attached to a kubelet's host machine. This depends on the Flocker control service being running","$ref":"#/components/schemas/io.k8s.api.core.v1.FlockerVolumeSource"},"gcePersistentDisk":{"description":"gcePersistentDisk represents a GCE Disk resource that is attached to a kubelet's host machine and then exposed to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk","$ref":"#/components/schemas/io.k8s.api.core.v1.GCEPersistentDiskVolumeSource"},"gitRepo":{"description":"gitRepo represents a git repository at a particular revision. DEPRECATED: GitRepo is deprecated. To provision a container with a git repo, mount an EmptyDir into an InitContainer that clones the repo using git, then mount the EmptyDir into the Pod's container.","$ref":"#/components/schemas/io.k8s.api.core.v1.GitRepoVolumeSource"},"glusterfs":{"description":"glusterfs represents a Glusterfs mount on the host that shares a pod's lifetime. More info: https://examples.k8s.io/volumes/glusterfs/README.md","$ref":"#/components/schemas/io.k8s.api.core.v1.GlusterfsVolumeSource"},"hostPath":{"description":"hostPath represents a pre-existing file or directory on the host machine that is directly exposed to the container. This is generally used for system agents or other privileged things that are allowed to see the host machine. Most containers will NOT need this. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath","$ref":"#/components/schemas/io.k8s.api.core.v1.HostPathVolumeSource"},"iscsi":{"description":"iscsi represents an ISCSI Disk resource that is attached to a kubelet's host machine and then exposed to the pod. More info: https://examples.k8s.io/volumes/iscsi/README.md","$ref":"#/components/schemas/io.k8s.api.core.v1.ISCSIVolumeSource"},"name":{"description":"name of the volume. Must be a DNS_LABEL and unique within the pod. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names","type":"string","default":""},"nfs":{"description":"nfs represents an NFS mount on the host that shares a pod's lifetime More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs","$ref":"#/components/schemas/io.k8s.api.core.v1.NFSVolumeSource"},"persistentVolumeClaim":{"description":"persistentVolumeClaimVolumeSource represents a reference to a PersistentVolumeClaim in the same namespace. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims","$ref":"#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaimVolumeSource"},"photonPersistentDisk":{"description":"photonPersistentDisk represents a PhotonController persistent disk attached and mounted on kubelets host machine","$ref":"#/components/schemas/io.k8s.api.core.v1.PhotonPersistentDiskVolumeSource"},"portworxVolume":{"description":"portworxVolume represents a portworx volume attached and mounted on kubelets host machine","$ref":"#/components/schemas/io.k8s.api.core.v1.PortworxVolumeSource"},"projected":{"description":"projected items for all in one resources secrets, configmaps, and downward API","$ref":"#/components/schemas/io.k8s.api.core.v1.ProjectedVolumeSource"},"quobyte":{"description":"quobyte represents a Quobyte mount on the host that shares a pod's lifetime","$ref":"#/components/schemas/io.k8s.api.core.v1.QuobyteVolumeSource"},"rbd":{"description":"rbd represents a Rados Block Device mount on the host that shares a pod's lifetime. More info: https://examples.k8s.io/volumes/rbd/README.md","$ref":"#/components/schemas/io.k8s.api.core.v1.RBDVolumeSource"},"scaleIO":{"description":"scaleIO represents a ScaleIO persistent volume attached and mounted on Kubernetes nodes.","$ref":"#/components/schemas/io.k8s.api.core.v1.ScaleIOVolumeSource"},"secret":{"description":"secret represents a secret that should populate this volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret","$ref":"#/components/schemas/io.k8s.api.core.v1.SecretVolumeSource"},"storageos":{"description":"storageOS represents a StorageOS volume attached and mounted on Kubernetes nodes.","$ref":"#/components/schemas/io.k8s.api.core.v1.StorageOSVolumeSource"},"vsphereVolume":{"description":"vsphereVolume represents a vSphere volume attached and mounted on kubelets host machine","$ref":"#/components/schemas/io.k8s.api.core.v1.VsphereVirtualDiskVolumeSource"}}},"io.k8s.api.core.v1.VolumeDevice":{"description":"volumeDevice describes a mapping of a raw block device within a container.","type":"object","required":["name","devicePath"],"properties":{"devicePath":{"description":"devicePath is the path inside of the container that the device will be mapped to.","type":"string","default":""},"name":{"description":"name must match the name of a persistentVolumeClaim in the pod","type":"string","default":""}}},"io.k8s.api.core.v1.VolumeMount":{"description":"VolumeMount describes a mounting of a Volume within a container.","type":"object","required":["name","mountPath"],"properties":{"mountPath":{"description":"Path within the container at which the volume should be mounted. Must not contain ':'.","type":"string","default":""},"mountPropagation":{"description":"mountPropagation determines how mounts are propagated from the host to container and the other way around. When not set, MountPropagationNone is used. This field is beta in 1.10.","type":"string"},"name":{"description":"This must match the Name of a Volume.","type":"string","default":""},"readOnly":{"description":"Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false.","type":"boolean"},"subPath":{"description":"Path within the volume from which the container's volume should be mounted. Defaults to \"\" (volume's root).","type":"string"},"subPathExpr":{"description":"Expanded path within the volume from which the container's volume should be mounted. Behaves similarly to SubPath but environment variable references $(VAR_NAME) are expanded using the container's environment. Defaults to \"\" (volume's root). SubPathExpr and SubPath are mutually exclusive.","type":"string"}}},"io.k8s.api.core.v1.VolumeProjection":{"description":"Projection that may be projected along with other supported volume types","type":"object","properties":{"configMap":{"description":"configMap information about the configMap data to project","$ref":"#/components/schemas/io.k8s.api.core.v1.ConfigMapProjection"},"downwardAPI":{"description":"downwardAPI information about the downwardAPI data to project","$ref":"#/components/schemas/io.k8s.api.core.v1.DownwardAPIProjection"},"secret":{"description":"secret information about the secret data to project","$ref":"#/components/schemas/io.k8s.api.core.v1.SecretProjection"},"serviceAccountToken":{"description":"serviceAccountToken is information about the serviceAccountToken data to project","$ref":"#/components/schemas/io.k8s.api.core.v1.ServiceAccountTokenProjection"}}},"io.k8s.api.core.v1.VsphereVirtualDiskVolumeSource":{"description":"Represents a vSphere volume resource.","type":"object","required":["volumePath"],"properties":{"fsType":{"description":"fsType is filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.","type":"string"},"storagePolicyID":{"description":"storagePolicyID is the storage Policy Based Management (SPBM) profile ID associated with the StoragePolicyName.","type":"string"},"storagePolicyName":{"description":"storagePolicyName is the storage Policy Based Management (SPBM) profile name.","type":"string"},"volumePath":{"description":"volumePath is the path that identifies vSphere volume vmdk","type":"string","default":""}}},"io.k8s.api.core.v1.WeightedPodAffinityTerm":{"description":"The weights of all of the matched WeightedPodAffinityTerm fields are added per-node to find the most preferred node(s)","type":"object","required":["weight","podAffinityTerm"],"properties":{"podAffinityTerm":{"description":"Required. A pod affinity term, associated with the corresponding weight.","default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.PodAffinityTerm"},"weight":{"description":"weight associated with matching the corresponding podAffinityTerm, in the range 1-100.","type":"integer","format":"int32","default":0}}},"io.k8s.api.core.v1.WindowsSecurityContextOptions":{"description":"WindowsSecurityContextOptions contain Windows-specific options and credentials.","type":"object","properties":{"gmsaCredentialSpec":{"description":"GMSACredentialSpec is where the GMSA admission webhook (https://github.com/kubernetes-sigs/windows-gmsa) inlines the contents of the GMSA credential spec named by the GMSACredentialSpecName field.","type":"string"},"gmsaCredentialSpecName":{"description":"GMSACredentialSpecName is the name of the GMSA credential spec to use.","type":"string"},"hostProcess":{"description":"HostProcess determines if a container should be run as a 'Host Process' container. This field is alpha-level and will only be honored by components that enable the WindowsHostProcessContainers feature flag. Setting this field without the feature flag will result in errors when validating the Pod. All of a Pod's containers must have the same effective HostProcess value (it is not allowed to have a mix of HostProcess containers and non-HostProcess containers). In addition, if HostProcess is true then HostNetwork must also be set to true.","type":"boolean"},"runAsUserName":{"description":"The UserName in Windows to run the entrypoint of the container process. Defaults to the user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.","type":"string"}}},"io.k8s.apimachinery.pkg.api.resource.Quantity":{"description":"Quantity is a fixed-point representation of a number. It provides convenient marshaling/unmarshaling in JSON and YAML, in addition to String() and AsInt64() accessors.\n\nThe serialization format is:\n\n\u003cquantity\u003e ::= \u003csignedNumber\u003e\u003csuffix\u003e\n (Note that \u003csuffix\u003e may be empty, from the \"\" case in \u003cdecimalSI\u003e.)\n\u003cdigit\u003e ::= 0 | 1 | ... | 9 \u003cdigits\u003e ::= \u003cdigit\u003e | \u003cdigit\u003e\u003cdigits\u003e \u003cnumber\u003e ::= \u003cdigits\u003e | \u003cdigits\u003e.\u003cdigits\u003e | \u003cdigits\u003e. | .\u003cdigits\u003e \u003csign\u003e ::= \"+\" | \"-\" \u003csignedNumber\u003e ::= \u003cnumber\u003e | \u003csign\u003e\u003cnumber\u003e \u003csuffix\u003e ::= \u003cbinarySI\u003e | \u003cdecimalExponent\u003e | \u003cdecimalSI\u003e \u003cbinarySI\u003e ::= Ki | Mi | Gi | Ti | Pi | Ei\n (International System of units; See: http://physics.nist.gov/cuu/Units/binary.html)\n\u003cdecimalSI\u003e ::= m | \"\" | k | M | G | T | P | E\n (Note that 1024 = 1Ki but 1000 = 1k; I didn't choose the capitalization.)\n\u003cdecimalExponent\u003e ::= \"e\" \u003csignedNumber\u003e | \"E\" \u003csignedNumber\u003e\n\nNo matter which of the three exponent forms is used, no quantity may represent a number greater than 2^63-1 in magnitude, nor may it have more than 3 decimal places. Numbers larger or more precise will be capped or rounded up. (E.g.: 0.1m will rounded up to 1m.) This may be extended in the future if we require larger or smaller quantities.\n\nWhen a Quantity is parsed from a string, it will remember the type of suffix it had, and will use the same type again when it is serialized.\n\nBefore serializing, Quantity will be put in \"canonical form\". This means that Exponent/suffix will be adjusted up or down (with a corresponding increase or decrease in Mantissa) such that:\n a. No precision is lost\n b. No fractional digits will be emitted\n c. The exponent (or suffix) is as large as possible.\nThe sign will be omitted unless the number is negative.\n\nExamples:\n 1.5 will be serialized as \"1500m\"\n 1.5Gi will be serialized as \"1536Mi\"\n\nNote that the quantity will NEVER be internally represented by a floating point number. That is the whole point of this exercise.\n\nNon-canonical values will still parse as long as they are well formed, but will be re-emitted in their canonical form. (So always use canonical form, or don't diff.)\n\nThis format is intended to make it difficult to use these numbers without writing some sort of special handling code in the hopes that that will cause implementors to also use a fixed point implementation.","type":"string"},"io.k8s.apimachinery.pkg.apis.meta.v1.APIResource":{"description":"APIResource specifies the name of a resource and whether it is namespaced.","type":"object","required":["name","singularName","namespaced","kind","verbs"],"properties":{"categories":{"description":"categories is a list of the grouped resources this resource belongs to (e.g. 'all')","type":"array","items":{"type":"string","default":""}},"group":{"description":"group is the preferred group of the resource. Empty implies the group of the containing resource list. For subresources, this may have a different value, for example: Scale\".","type":"string"},"kind":{"description":"kind is the kind for the resource (e.g. 'Foo' is the kind for a resource 'foo')","type":"string","default":""},"name":{"description":"name is the plural name of the resource.","type":"string","default":""},"namespaced":{"description":"namespaced indicates if a resource is namespaced or not.","type":"boolean","default":false},"shortNames":{"description":"shortNames is a list of suggested short names of the resource.","type":"array","items":{"type":"string","default":""}},"singularName":{"description":"singularName is the singular name of the resource. This allows clients to handle plural and singular opaquely. The singularName is more correct for reporting status on a single item and both singular and plural are allowed from the kubectl CLI interface.","type":"string","default":""},"storageVersionHash":{"description":"The hash value of the storage version, the version this resource is converted to when written to the data store. Value must be treated as opaque by clients. Only equality comparison on the value is valid. This is an alpha feature and may change or be removed in the future. The field is populated by the apiserver only if the StorageVersionHash feature gate is enabled. This field will remain optional even if it graduates.","type":"string"},"verbs":{"description":"verbs is a list of supported kube verbs (this includes get, list, watch, create, update, patch, delete, deletecollection, and proxy)","type":"array","items":{"type":"string","default":""}},"version":{"description":"version is the preferred version of the resource. Empty implies the version of the containing resource list For subresources, this may have a different value, for example: v1 (while inside a v1beta1 version of the core resource's group)\".","type":"string"}}},"io.k8s.apimachinery.pkg.apis.meta.v1.APIResourceList":{"description":"APIResourceList is a list of APIResource, it is used to expose the name of the resources supported in a specific group and version, and if the resource is namespaced.","type":"object","required":["groupVersion","resources"],"properties":{"apiVersion":{"description":"APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources","type":"string"},"groupVersion":{"description":"groupVersion is the group and version this APIResourceList is for.","type":"string","default":""},"kind":{"description":"Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds","type":"string"},"resources":{"description":"resources contains the name of the resources and if they are namespaced.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.APIResource"}}},"x-kubernetes-group-version-kind":[{"group":"","kind":"APIResourceList","version":"v1"}]},"io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions":{"description":"DeleteOptions may be provided when deleting an API object.","type":"object","properties":{"apiVersion":{"description":"APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources","type":"string"},"dryRun":{"description":"When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed","type":"array","items":{"type":"string","default":""}},"gracePeriodSeconds":{"description":"The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.","type":"integer","format":"int64"},"kind":{"description":"Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds","type":"string"},"orphanDependents":{"description":"Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.","type":"boolean"},"preconditions":{"description":"Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned.","$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Preconditions"},"propagationPolicy":{"description":"Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.","type":"string"}},"x-kubernetes-group-version-kind":[{"group":"","kind":"DeleteOptions","version":"v1"},{"group":"admission.k8s.io","kind":"DeleteOptions","version":"v1"},{"group":"admission.k8s.io","kind":"DeleteOptions","version":"v1beta1"},{"group":"admissionregistration.k8s.io","kind":"DeleteOptions","version":"v1"},{"group":"admissionregistration.k8s.io","kind":"DeleteOptions","version":"v1beta1"},{"group":"apiextensions.k8s.io","kind":"DeleteOptions","version":"v1"},{"group":"apiextensions.k8s.io","kind":"DeleteOptions","version":"v1beta1"},{"group":"apiregistration.k8s.io","kind":"DeleteOptions","version":"v1"},{"group":"apiregistration.k8s.io","kind":"DeleteOptions","version":"v1beta1"},{"group":"apps","kind":"DeleteOptions","version":"v1"},{"group":"apps","kind":"DeleteOptions","version":"v1beta1"},{"group":"apps","kind":"DeleteOptions","version":"v1beta2"},{"group":"authentication.k8s.io","kind":"DeleteOptions","version":"v1"},{"group":"authentication.k8s.io","kind":"DeleteOptions","version":"v1beta1"},{"group":"authorization.k8s.io","kind":"DeleteOptions","version":"v1"},{"group":"authorization.k8s.io","kind":"DeleteOptions","version":"v1beta1"},{"group":"autoscaling","kind":"DeleteOptions","version":"v1"},{"group":"autoscaling","kind":"DeleteOptions","version":"v2"},{"group":"autoscaling","kind":"DeleteOptions","version":"v2beta1"},{"group":"autoscaling","kind":"DeleteOptions","version":"v2beta2"},{"group":"batch","kind":"DeleteOptions","version":"v1"},{"group":"batch","kind":"DeleteOptions","version":"v1beta1"},{"group":"certificates.k8s.io","kind":"DeleteOptions","version":"v1"},{"group":"certificates.k8s.io","kind":"DeleteOptions","version":"v1beta1"},{"group":"coordination.k8s.io","kind":"DeleteOptions","version":"v1"},{"group":"coordination.k8s.io","kind":"DeleteOptions","version":"v1beta1"},{"group":"discovery.k8s.io","kind":"DeleteOptions","version":"v1"},{"group":"discovery.k8s.io","kind":"DeleteOptions","version":"v1beta1"},{"group":"events.k8s.io","kind":"DeleteOptions","version":"v1"},{"group":"events.k8s.io","kind":"DeleteOptions","version":"v1beta1"},{"group":"extensions","kind":"DeleteOptions","version":"v1beta1"},{"group":"flowcontrol.apiserver.k8s.io","kind":"DeleteOptions","version":"v1alpha1"},{"group":"flowcontrol.apiserver.k8s.io","kind":"DeleteOptions","version":"v1beta1"},{"group":"flowcontrol.apiserver.k8s.io","kind":"DeleteOptions","version":"v1beta2"},{"group":"imagepolicy.k8s.io","kind":"DeleteOptions","version":"v1alpha1"},{"group":"internal.apiserver.k8s.io","kind":"DeleteOptions","version":"v1alpha1"},{"group":"networking.k8s.io","kind":"DeleteOptions","version":"v1"},{"group":"networking.k8s.io","kind":"DeleteOptions","version":"v1beta1"},{"group":"node.k8s.io","kind":"DeleteOptions","version":"v1"},{"group":"node.k8s.io","kind":"DeleteOptions","version":"v1alpha1"},{"group":"node.k8s.io","kind":"DeleteOptions","version":"v1beta1"},{"group":"policy","kind":"DeleteOptions","version":"v1"},{"group":"policy","kind":"DeleteOptions","version":"v1beta1"},{"group":"rbac.authorization.k8s.io","kind":"DeleteOptions","version":"v1"},{"group":"rbac.authorization.k8s.io","kind":"DeleteOptions","version":"v1alpha1"},{"group":"rbac.authorization.k8s.io","kind":"DeleteOptions","version":"v1beta1"},{"group":"scheduling.k8s.io","kind":"DeleteOptions","version":"v1"},{"group":"scheduling.k8s.io","kind":"DeleteOptions","version":"v1alpha1"},{"group":"scheduling.k8s.io","kind":"DeleteOptions","version":"v1beta1"},{"group":"storage.k8s.io","kind":"DeleteOptions","version":"v1"},{"group":"storage.k8s.io","kind":"DeleteOptions","version":"v1alpha1"},{"group":"storage.k8s.io","kind":"DeleteOptions","version":"v1beta1"}]},"io.k8s.apimachinery.pkg.apis.meta.v1.FieldsV1":{"description":"FieldsV1 stores a set of fields in a data structure like a Trie, in JSON format.\n\nEach key is either a '.' representing the field itself, and will always map to an empty set, or a string representing a sub-field or item. The string will follow one of these four formats: 'f:\u003cname\u003e', where \u003cname\u003e is the name of a field in a struct, or key in a map 'v:\u003cvalue\u003e', where \u003cvalue\u003e is the exact json formatted value of a list item 'i:\u003cindex\u003e', where \u003cindex\u003e is position of a item in a list 'k:\u003ckeys\u003e', where \u003ckeys\u003e is a map of a list item's key fields to their unique values If a key maps to an empty Fields value, the field that key represents is part of the set.\n\nThe exact format is defined in sigs.k8s.io/structured-merge-diff","type":"object"},"io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector":{"description":"A label selector is a label query over a set of resources. The result of matchLabels and matchExpressions are ANDed. An empty label selector matches all objects. A null label selector matches no objects.","type":"object","properties":{"matchExpressions":{"description":"matchExpressions is a list of label selector requirements. The requirements are ANDed.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelectorRequirement"}},"matchLabels":{"description":"matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is \"key\", the operator is \"In\", and the values array contains only \"value\". The requirements are ANDed.","type":"object","additionalProperties":{"type":"string","default":""}}},"x-kubernetes-map-type":"atomic"},"io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelectorRequirement":{"description":"A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.","type":"object","required":["key","operator"],"properties":{"key":{"description":"key is the label key that the selector applies to.","type":"string","default":"","x-kubernetes-patch-merge-key":"key","x-kubernetes-patch-strategy":"merge"},"operator":{"description":"operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.","type":"string","default":""},"values":{"description":"values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.","type":"array","items":{"type":"string","default":""}}}},"io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta":{"description":"ListMeta describes metadata that synthetic resources must have, including lists and various status objects. A resource may have only one of {ObjectMeta, ListMeta}.","type":"object","properties":{"continue":{"description":"continue may be set if the user set a limit on the number of items returned, and indicates that the server has more data available. The value is opaque and may be used to issue another request to the endpoint that served this list to retrieve the next set of available objects. Continuing a consistent list may not be possible if the server configuration has changed or more than a few minutes have passed. The resourceVersion field returned when using this continue value will be identical to the value in the first response, unless you have received this token from an error message.","type":"string"},"remainingItemCount":{"description":"remainingItemCount is the number of subsequent items in the list which are not included in this list response. If the list request contained label or field selectors, then the number of remaining items is unknown and the field will be left unset and omitted during serialization. If the list is complete (either because it is not chunking or because this is the last chunk), then there are no more remaining items and this field will be left unset and omitted during serialization. Servers older than v1.15 do not set this field. The intended use of the remainingItemCount is *estimating* the size of a collection. Clients should not rely on the remainingItemCount to be set or to be exact.","type":"integer","format":"int64"},"resourceVersion":{"description":"String that identifies the server's internal version of this object that can be used by clients to determine when objects have changed. Value must be treated as opaque by clients and passed unmodified back to the server. Populated by the system. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency","type":"string"},"selfLink":{"description":"selfLink is DEPRECATED read-only field that is no longer populated by the system.","type":"string"}}},"io.k8s.apimachinery.pkg.apis.meta.v1.ManagedFieldsEntry":{"description":"ManagedFieldsEntry is a workflow-id, a FieldSet and the group version of the resource that the fieldset applies to.","type":"object","properties":{"apiVersion":{"description":"APIVersion defines the version of this resource that this field set applies to. The format is \"group/version\" just like the top-level APIVersion field. It is necessary to track the version of a field set because it cannot be automatically converted.","type":"string"},"fieldsType":{"description":"FieldsType is the discriminator for the different fields format and version. There is currently only one possible value: \"FieldsV1\"","type":"string"},"fieldsV1":{"description":"FieldsV1 holds the first JSON version format as described in the \"FieldsV1\" type.","$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.FieldsV1"},"manager":{"description":"Manager is an identifier of the workflow managing these fields.","type":"string"},"operation":{"description":"Operation is the type of operation which lead to this ManagedFieldsEntry being created. The only valid values for this field are 'Apply' and 'Update'.","type":"string"},"subresource":{"description":"Subresource is the name of the subresource used to update that object, or empty string if the object was updated through the main resource. The value of this field is used to distinguish between managers, even if they share the same name. For example, a status update will be distinct from a regular update using the same manager name. Note that the APIVersion field is not related to the Subresource field and it always corresponds to the version of the main resource.","type":"string"},"time":{"description":"Time is the timestamp of when the ManagedFields entry was added. The timestamp will also be updated if a field is added, the manager changes any of the owned fields value or removes a field. The timestamp does not update when a field is removed from the entry because another manager took it over.","$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time"}}},"io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta":{"description":"ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create.","type":"object","properties":{"annotations":{"description":"Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations","type":"object","additionalProperties":{"type":"string","default":""}},"clusterName":{"description":"The name of the cluster which the object belongs to. This is used to distinguish resources with same name and namespace in different clusters. This field is not set anywhere right now and apiserver is going to ignore it if set in create or update request.","type":"string"},"creationTimestamp":{"description":"CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC.\n\nPopulated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata","default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time"},"deletionGracePeriodSeconds":{"description":"Number of seconds allowed for this object to gracefully terminate before it will be removed from the system. Only set when deletionTimestamp is also set. May only be shortened. Read-only.","type":"integer","format":"int64"},"deletionTimestamp":{"description":"DeletionTimestamp is RFC 3339 date and time at which this resource will be deleted. This field is set by the server when a graceful deletion is requested by the user, and is not directly settable by a client. The resource is expected to be deleted (no longer visible from resource lists, and not reachable by name) after the time in this field, once the finalizers list is empty. As long as the finalizers list contains items, deletion is blocked. Once the deletionTimestamp is set, this value may not be unset or be set further into the future, although it may be shortened or the resource may be deleted prior to this time. For example, a user may request that a pod is deleted in 30 seconds. The Kubelet will react by sending a graceful termination signal to the containers in the pod. After that 30 seconds, the Kubelet will send a hard termination signal (SIGKILL) to the container and after cleanup, remove the pod from the API. In the presence of network partitions, this object may still exist after this timestamp, until an administrator or automated process can determine the resource is fully terminated. If not set, graceful deletion of the object has not been requested.\n\nPopulated by the system when a graceful deletion is requested. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata","$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time"},"finalizers":{"description":"Must be empty before the object is deleted from the registry. Each entry is an identifier for the responsible component that will remove the entry from the list. If the deletionTimestamp of the object is non-nil, entries in this list can only be removed. Finalizers may be processed and removed in any order. Order is NOT enforced because it introduces significant risk of stuck finalizers. finalizers is a shared field, any actor with permission can reorder it. If the finalizer list is processed in order, then this can lead to a situation in which the component responsible for the first finalizer in the list is waiting for a signal (field value, external system, or other) produced by a component responsible for a finalizer later in the list, resulting in a deadlock. Without enforced ordering finalizers are free to order amongst themselves and are not vulnerable to ordering changes in the list.","type":"array","items":{"type":"string","default":""},"x-kubernetes-patch-strategy":"merge"},"generateName":{"description":"GenerateName is an optional prefix, used by the server, to generate a unique name ONLY IF the Name field has not been provided. If this field is used, the name returned to the client will be different than the name passed. This value will also be combined with a unique suffix. The provided value has the same validation rules as the Name field, and may be truncated by the length of the suffix required to make the value unique on the server.\n\nIf this field is specified and the generated name exists, the server will NOT return a 409 - instead, it will either return 201 Created or 500 with Reason ServerTimeout indicating a unique name could not be found in the time allotted, and the client should retry (optionally after the time indicated in the Retry-After header).\n\nApplied only if Name is not specified. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#idempotency","type":"string"},"generation":{"description":"A sequence number representing a specific generation of the desired state. Populated by the system. Read-only.","type":"integer","format":"int64"},"labels":{"description":"Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels","type":"object","additionalProperties":{"type":"string","default":""}},"managedFields":{"description":"ManagedFields maps workflow-id and version to the set of fields that are managed by that workflow. This is mostly for internal housekeeping, and users typically shouldn't need to set or understand this field. A workflow can be the user's name, a controller's name, or the name of a specific apply path like \"ci-cd\". The set of fields is always in the version that the workflow used when modifying the object.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ManagedFieldsEntry"}},"name":{"description":"Name must be unique within a namespace. Is required when creating resources, although some resources may allow a client to request the generation of an appropriate name automatically. Name is primarily intended for creation idempotence and configuration definition. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#names","type":"string"},"namespace":{"description":"Namespace defines the space within which each name must be unique. An empty namespace is equivalent to the \"default\" namespace, but \"default\" is the canonical representation. Not all objects are required to be scoped to a namespace - the value of this field for those objects will be empty.\n\nMust be a DNS_LABEL. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces","type":"string"},"ownerReferences":{"description":"List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, then an entry in this list will point to this controller, with the controller field set to true. There cannot be more than one managing controller.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.OwnerReference"},"x-kubernetes-patch-merge-key":"uid","x-kubernetes-patch-strategy":"merge"},"resourceVersion":{"description":"An opaque value that represents the internal version of this object that can be used by clients to determine when objects have changed. May be used for optimistic concurrency, change detection, and the watch operation on a resource or set of resources. Clients must treat these values as opaque and passed unmodified back to the server. They may only be valid for a particular resource or set of resources.\n\nPopulated by the system. Read-only. Value must be treated as opaque by clients and . More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency","type":"string"},"selfLink":{"description":"selfLink is DEPRECATED read-only field that is no longer populated by the system.","type":"string"},"uid":{"description":"UID is the unique in time and space value for this object. It is typically generated by the server on successful creation of a resource and is not allowed to change on PUT operations.\n\nPopulated by the system. Read-only. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#uids","type":"string"}}},"io.k8s.apimachinery.pkg.apis.meta.v1.OwnerReference":{"description":"OwnerReference contains enough information to let you identify an owning object. An owning object must be in the same namespace as the dependent, or be cluster-scoped, so there is no namespace field.","type":"object","required":["apiVersion","kind","name","uid"],"properties":{"apiVersion":{"description":"API version of the referent.","type":"string","default":""},"blockOwnerDeletion":{"description":"If true, AND if the owner has the \"foregroundDeletion\" finalizer, then the owner cannot be deleted from the key-value store until this reference is removed. See https://kubernetes.io/docs/concepts/architecture/garbage-collection/#foreground-deletion for how the garbage collector interacts with this field and enforces the foreground deletion. Defaults to false. To set this field, a user needs \"delete\" permission of the owner, otherwise 422 (Unprocessable Entity) will be returned.","type":"boolean"},"controller":{"description":"If true, this reference points to the managing controller.","type":"boolean"},"kind":{"description":"Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds","type":"string","default":""},"name":{"description":"Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#names","type":"string","default":""},"uid":{"description":"UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#uids","type":"string","default":""}},"x-kubernetes-map-type":"atomic"},"io.k8s.apimachinery.pkg.apis.meta.v1.Patch":{"description":"Patch is provided to give a concrete name and type to the Kubernetes PATCH request body.","type":"object"},"io.k8s.apimachinery.pkg.apis.meta.v1.Preconditions":{"description":"Preconditions must be fulfilled before an operation (update, delete, etc.) is carried out.","type":"object","properties":{"resourceVersion":{"description":"Specifies the target ResourceVersion","type":"string"},"uid":{"description":"Specifies the target UID.","type":"string"}}},"io.k8s.apimachinery.pkg.apis.meta.v1.Status":{"description":"Status is a return value for calls that don't return other objects.","type":"object","properties":{"apiVersion":{"description":"APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources","type":"string"},"code":{"description":"Suggested HTTP return code for this status, 0 if not set.","type":"integer","format":"int32"},"details":{"description":"Extended data associated with the reason. Each reason may define its own extended details. This field is optional and the data returned is not guaranteed to conform to any schema except that defined by the reason type.","$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.StatusDetails"},"kind":{"description":"Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds","type":"string"},"message":{"description":"A human-readable description of the status of this operation.","type":"string"},"metadata":{"description":"Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds","default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta"},"reason":{"description":"A machine-readable description of why this operation is in the \"Failure\" status. If this value is empty there is no information available. A Reason clarifies an HTTP status code but does not override it.","type":"string"},"status":{"description":"Status of the operation. One of: \"Success\" or \"Failure\". More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status","type":"string"}},"x-kubernetes-group-version-kind":[{"group":"","kind":"Status","version":"v1"}]},"io.k8s.apimachinery.pkg.apis.meta.v1.StatusCause":{"description":"StatusCause provides more information about an api.Status failure, including cases when multiple errors are encountered.","type":"object","properties":{"field":{"description":"The field of the resource that has caused this error, as named by its JSON serialization. May include dot and postfix notation for nested attributes. Arrays are zero-indexed. Fields may appear more than once in an array of causes due to fields having multiple errors. Optional.\n\nExamples:\n \"name\" - the field \"name\" on the current resource\n \"items[0].name\" - the field \"name\" on the first array entry in \"items\"","type":"string"},"message":{"description":"A human-readable description of the cause of the error. This field may be presented as-is to a reader.","type":"string"},"reason":{"description":"A machine-readable description of the cause of the error. If this value is empty there is no information available.","type":"string"}}},"io.k8s.apimachinery.pkg.apis.meta.v1.StatusDetails":{"description":"StatusDetails is a set of additional properties that MAY be set by the server to provide additional information about a response. The Reason field of a Status object defines what attributes will be set. Clients must ignore fields that do not match the defined type of each attribute, and should assume that any attribute may be empty, invalid, or under defined.","type":"object","properties":{"causes":{"description":"The Causes array includes more details associated with the StatusReason failure. Not all StatusReasons may provide detailed causes.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.StatusCause"}},"group":{"description":"The group attribute of the resource associated with the status StatusReason.","type":"string"},"kind":{"description":"The kind attribute of the resource associated with the status StatusReason. On some operations may differ from the requested resource Kind. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds","type":"string"},"name":{"description":"The name attribute of the resource associated with the status StatusReason (when there is a single name which can be described).","type":"string"},"retryAfterSeconds":{"description":"If specified, the time in seconds before the operation should be retried. Some errors may indicate the client must take an alternate action - for those errors this field may indicate how long to wait before taking the alternate action.","type":"integer","format":"int32"},"uid":{"description":"UID of the resource. (when there is a single resource which can be described). More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#uids","type":"string"}}},"io.k8s.apimachinery.pkg.apis.meta.v1.Time":{"description":"Time is a wrapper around time.Time which supports correct marshaling to YAML and JSON. Wrappers are provided for many of the factory methods that the time package offers.","type":"string","format":"date-time"},"io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent":{"description":"Event represents a single event to a watched resource.","type":"object","required":["type","object"],"properties":{"object":{"description":"Object is:\n * If Type is Added or Modified: the new state of the object.\n * If Type is Deleted: the state of the object immediately before deletion.\n * If Type is Error: *Status is recommended; other types may make sense\n depending on context.","default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.runtime.RawExtension"},"type":{"type":"string","default":""}},"x-kubernetes-group-version-kind":[{"group":"","kind":"WatchEvent","version":"v1"},{"group":"admission.k8s.io","kind":"WatchEvent","version":"v1"},{"group":"admission.k8s.io","kind":"WatchEvent","version":"v1beta1"},{"group":"admissionregistration.k8s.io","kind":"WatchEvent","version":"v1"},{"group":"admissionregistration.k8s.io","kind":"WatchEvent","version":"v1beta1"},{"group":"apiextensions.k8s.io","kind":"WatchEvent","version":"v1"},{"group":"apiextensions.k8s.io","kind":"WatchEvent","version":"v1beta1"},{"group":"apiregistration.k8s.io","kind":"WatchEvent","version":"v1"},{"group":"apiregistration.k8s.io","kind":"WatchEvent","version":"v1beta1"},{"group":"apps","kind":"WatchEvent","version":"v1"},{"group":"apps","kind":"WatchEvent","version":"v1beta1"},{"group":"apps","kind":"WatchEvent","version":"v1beta2"},{"group":"authentication.k8s.io","kind":"WatchEvent","version":"v1"},{"group":"authentication.k8s.io","kind":"WatchEvent","version":"v1beta1"},{"group":"authorization.k8s.io","kind":"WatchEvent","version":"v1"},{"group":"authorization.k8s.io","kind":"WatchEvent","version":"v1beta1"},{"group":"autoscaling","kind":"WatchEvent","version":"v1"},{"group":"autoscaling","kind":"WatchEvent","version":"v2"},{"group":"autoscaling","kind":"WatchEvent","version":"v2beta1"},{"group":"autoscaling","kind":"WatchEvent","version":"v2beta2"},{"group":"batch","kind":"WatchEvent","version":"v1"},{"group":"batch","kind":"WatchEvent","version":"v1beta1"},{"group":"certificates.k8s.io","kind":"WatchEvent","version":"v1"},{"group":"certificates.k8s.io","kind":"WatchEvent","version":"v1beta1"},{"group":"coordination.k8s.io","kind":"WatchEvent","version":"v1"},{"group":"coordination.k8s.io","kind":"WatchEvent","version":"v1beta1"},{"group":"discovery.k8s.io","kind":"WatchEvent","version":"v1"},{"group":"discovery.k8s.io","kind":"WatchEvent","version":"v1beta1"},{"group":"events.k8s.io","kind":"WatchEvent","version":"v1"},{"group":"events.k8s.io","kind":"WatchEvent","version":"v1beta1"},{"group":"extensions","kind":"WatchEvent","version":"v1beta1"},{"group":"flowcontrol.apiserver.k8s.io","kind":"WatchEvent","version":"v1alpha1"},{"group":"flowcontrol.apiserver.k8s.io","kind":"WatchEvent","version":"v1beta1"},{"group":"flowcontrol.apiserver.k8s.io","kind":"WatchEvent","version":"v1beta2"},{"group":"imagepolicy.k8s.io","kind":"WatchEvent","version":"v1alpha1"},{"group":"internal.apiserver.k8s.io","kind":"WatchEvent","version":"v1alpha1"},{"group":"networking.k8s.io","kind":"WatchEvent","version":"v1"},{"group":"networking.k8s.io","kind":"WatchEvent","version":"v1beta1"},{"group":"node.k8s.io","kind":"WatchEvent","version":"v1"},{"group":"node.k8s.io","kind":"WatchEvent","version":"v1alpha1"},{"group":"node.k8s.io","kind":"WatchEvent","version":"v1beta1"},{"group":"policy","kind":"WatchEvent","version":"v1"},{"group":"policy","kind":"WatchEvent","version":"v1beta1"},{"group":"rbac.authorization.k8s.io","kind":"WatchEvent","version":"v1"},{"group":"rbac.authorization.k8s.io","kind":"WatchEvent","version":"v1alpha1"},{"group":"rbac.authorization.k8s.io","kind":"WatchEvent","version":"v1beta1"},{"group":"scheduling.k8s.io","kind":"WatchEvent","version":"v1"},{"group":"scheduling.k8s.io","kind":"WatchEvent","version":"v1alpha1"},{"group":"scheduling.k8s.io","kind":"WatchEvent","version":"v1beta1"},{"group":"storage.k8s.io","kind":"WatchEvent","version":"v1"},{"group":"storage.k8s.io","kind":"WatchEvent","version":"v1alpha1"},{"group":"storage.k8s.io","kind":"WatchEvent","version":"v1beta1"}]},"io.k8s.apimachinery.pkg.runtime.RawExtension":{"description":"RawExtension is used to hold extensions in external versions.\n\nTo use this, make a field which has RawExtension as its type in your external, versioned struct, and Object in your internal struct. You also need to register your various plugin types.\n\n// Internal package: type MyAPIObject struct {\n\truntime.TypeMeta `json:\",inline\"`\n\tMyPlugin runtime.Object `json:\"myPlugin\"`\n} type PluginA struct {\n\tAOption string `json:\"aOption\"`\n}\n\n// External package: type MyAPIObject struct {\n\truntime.TypeMeta `json:\",inline\"`\n\tMyPlugin runtime.RawExtension `json:\"myPlugin\"`\n} type PluginA struct {\n\tAOption string `json:\"aOption\"`\n}\n\n// On the wire, the JSON will look something like this: {\n\t\"kind\":\"MyAPIObject\",\n\t\"apiVersion\":\"v1\",\n\t\"myPlugin\": {\n\t\t\"kind\":\"PluginA\",\n\t\t\"aOption\":\"foo\",\n\t},\n}\n\nSo what happens? Decode first uses json or yaml to unmarshal the serialized data into your external MyAPIObject. That causes the raw JSON to be stored, but not unpacked. The next step is to copy (using pkg/conversion) into the internal struct. The runtime package's DefaultScheme has conversion functions installed which will unpack the JSON stored in RawExtension, turning it into the correct object type, and storing it in the Object. (TODO: In the case where the object is of an unknown type, a runtime.Unknown object will be created and stored.)","type":"object"},"io.k8s.apimachinery.pkg.util.intstr.IntOrString":{"description":"IntOrString is a type that can hold an int32 or a string. When used in JSON or YAML marshalling and unmarshalling, it produces or consumes the inner type. This allows you to have, for example, a JSON field that can accept a name or number.","type":"string","format":"int-or-string"}}}} diff --git a/discovery/testdata/apis/batch/v1beta1.json b/discovery/testdata/apis/batch/v1beta1.json index cc4e8a0b8..fcc5dcfa3 100644 --- a/discovery/testdata/apis/batch/v1beta1.json +++ b/discovery/testdata/apis/batch/v1beta1.json @@ -1 +1 @@ -{"openapi":"3.0.0","info":{"title":"Kubernetes","version":"v1.24.0"},"paths":{"/apis/batch/v1beta1/":{"get":{"tags":["batch_v1beta1"],"description":"get available resources","operationId":"getBatchV1beta1APIResources","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.APIResourceList"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.APIResourceList"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.APIResourceList"}}}}}}},"/apis/batch/v1beta1/cronjobs":{"get":{"tags":["batch_v1beta1"],"description":"list or watch objects of kind CronJob","operationId":"listBatchV1beta1CronJobForAllNamespaces","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJobList"}},"application/json;stream=watch":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJobList"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJobList"}},"application/vnd.kubernetes.protobuf;stream=watch":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJobList"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJobList"}}}}}},"parameters":[{"name":"allowWatchBookmarks","in":"query","description":"allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.","schema":{"type":"boolean","uniqueItems":true}},{"name":"continue","in":"query","description":"The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.","schema":{"type":"string","uniqueItems":true}},{"name":"fieldSelector","in":"query","description":"A selector to restrict the list of returned objects by their fields. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"labelSelector","in":"query","description":"A selector to restrict the list of returned objects by their labels. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"limit","in":"query","description":"limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.","schema":{"type":"integer","uniqueItems":true}},{"name":"pretty","in":"query","description":"If 'true', then the output is pretty printed.","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersion","in":"query","description":"resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersionMatch","in":"query","description":"resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"timeoutSeconds","in":"query","description":"Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.","schema":{"type":"integer","uniqueItems":true}},{"name":"watch","in":"query","description":"Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.","schema":{"type":"boolean","uniqueItems":true}}]},"/apis/batch/v1beta1/namespaces/{namespace}/cronjobs":{"get":{"tags":["batch_v1beta1"],"description":"list or watch objects of kind CronJob","operationId":"listBatchV1beta1NamespacedCronJob","parameters":[{"name":"labelSelector","in":"query","description":"A selector to restrict the list of returned objects by their labels. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"fieldSelector","in":"query","description":"A selector to restrict the list of returned objects by their fields. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"watch","in":"query","description":"Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.","schema":{"type":"boolean","uniqueItems":true}},{"name":"allowWatchBookmarks","in":"query","description":"allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.","schema":{"type":"boolean","uniqueItems":true}},{"name":"resourceVersion","in":"query","description":"resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersionMatch","in":"query","description":"resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"timeoutSeconds","in":"query","description":"Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.","schema":{"type":"integer","uniqueItems":true}},{"name":"limit","in":"query","description":"limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.","schema":{"type":"integer","uniqueItems":true}},{"name":"continue","in":"query","description":"The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.","schema":{"type":"string","uniqueItems":true}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJobList"}},"application/json;stream=watch":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJobList"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJobList"}},"application/vnd.kubernetes.protobuf;stream=watch":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJobList"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJobList"}}}}}},"post":{"tags":["batch_v1beta1"],"description":"create a CronJob","operationId":"createBatchV1beta1NamespacedCronJob","parameters":[{"name":"dryRun","in":"query","description":"When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed","schema":{"type":"string","uniqueItems":true}},{"name":"fieldManager","in":"query","description":"fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.","schema":{"type":"string","uniqueItems":true}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}}}},"202":{"description":"Accepted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}}}}}},"delete":{"tags":["batch_v1beta1"],"description":"delete collection of CronJob","operationId":"deleteBatchV1beta1CollectionNamespacedCronJob","parameters":[{"name":"gracePeriodSeconds","in":"query","description":"The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.","schema":{"type":"integer","uniqueItems":true}},{"name":"orphanDependents","in":"query","description":"Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.","schema":{"type":"boolean","uniqueItems":true}},{"name":"propagationPolicy","in":"query","description":"Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.","schema":{"type":"string","uniqueItems":true}},{"name":"dryRun","in":"query","description":"When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed","schema":{"type":"string","uniqueItems":true}},{"name":"labelSelector","in":"query","description":"A selector to restrict the list of returned objects by their labels. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"fieldSelector","in":"query","description":"A selector to restrict the list of returned objects by their fields. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersion","in":"query","description":"resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersionMatch","in":"query","description":"resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"timeoutSeconds","in":"query","description":"Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.","schema":{"type":"integer","uniqueItems":true}},{"name":"limit","in":"query","description":"limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.","schema":{"type":"integer","uniqueItems":true}},{"name":"continue","in":"query","description":"The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.","schema":{"type":"string","uniqueItems":true}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status"}}}}}},"parameters":[{"name":"namespace","in":"path","description":"object name and auth scope, such as for teams and projects","required":true,"schema":{"type":"string","uniqueItems":true}},{"name":"pretty","in":"query","description":"If 'true', then the output is pretty printed.","schema":{"type":"string","uniqueItems":true}}]},"/apis/batch/v1beta1/namespaces/{namespace}/cronjobs/{name}":{"get":{"tags":["batch_v1beta1"],"description":"read the specified CronJob","operationId":"readBatchV1beta1NamespacedCronJob","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}}}}}},"put":{"tags":["batch_v1beta1"],"description":"replace the specified CronJob","operationId":"replaceBatchV1beta1NamespacedCronJob","parameters":[{"name":"dryRun","in":"query","description":"When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed","schema":{"type":"string","uniqueItems":true}},{"name":"fieldManager","in":"query","description":"fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.","schema":{"type":"string","uniqueItems":true}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}}}}}},"delete":{"tags":["batch_v1beta1"],"description":"delete a CronJob","operationId":"deleteBatchV1beta1NamespacedCronJob","parameters":[{"name":"gracePeriodSeconds","in":"query","description":"The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.","schema":{"type":"integer","uniqueItems":true}},{"name":"orphanDependents","in":"query","description":"Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.","schema":{"type":"boolean","uniqueItems":true}},{"name":"propagationPolicy","in":"query","description":"Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.","schema":{"type":"string","uniqueItems":true}},{"name":"dryRun","in":"query","description":"When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed","schema":{"type":"string","uniqueItems":true}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status"}}}},"202":{"description":"Accepted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status"}}}}}},"patch":{"tags":["batch_v1beta1"],"description":"partially update the specified CronJob","operationId":"patchBatchV1beta1NamespacedCronJob","parameters":[{"name":"dryRun","in":"query","description":"When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed","schema":{"type":"string","uniqueItems":true}},{"name":"force","in":"query","description":"Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.","schema":{"type":"boolean","uniqueItems":true}},{"name":"fieldManager","in":"query","description":"fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).","schema":{"type":"string","uniqueItems":true}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}}}}}},"parameters":[{"name":"name","in":"path","description":"name of the CronJob","required":true,"schema":{"type":"string","uniqueItems":true}},{"name":"namespace","in":"path","description":"object name and auth scope, such as for teams and projects","required":true,"schema":{"type":"string","uniqueItems":true}},{"name":"pretty","in":"query","description":"If 'true', then the output is pretty printed.","schema":{"type":"string","uniqueItems":true}}]},"/apis/batch/v1beta1/namespaces/{namespace}/cronjobs/{name}/status":{"get":{"tags":["batch_v1beta1"],"description":"read status of the specified CronJob","operationId":"readBatchV1beta1NamespacedCronJobStatus","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}}}}}},"put":{"tags":["batch_v1beta1"],"description":"replace status of the specified CronJob","operationId":"replaceBatchV1beta1NamespacedCronJobStatus","parameters":[{"name":"dryRun","in":"query","description":"When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed","schema":{"type":"string","uniqueItems":true}},{"name":"fieldManager","in":"query","description":"fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.","schema":{"type":"string","uniqueItems":true}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}}}}}},"patch":{"tags":["batch_v1beta1"],"description":"partially update status of the specified CronJob","operationId":"patchBatchV1beta1NamespacedCronJobStatus","parameters":[{"name":"dryRun","in":"query","description":"When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed","schema":{"type":"string","uniqueItems":true}},{"name":"force","in":"query","description":"Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.","schema":{"type":"boolean","uniqueItems":true}},{"name":"fieldManager","in":"query","description":"fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).","schema":{"type":"string","uniqueItems":true}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}}}}}},"parameters":[{"name":"name","in":"path","description":"name of the CronJob","required":true,"schema":{"type":"string","uniqueItems":true}},{"name":"namespace","in":"path","description":"object name and auth scope, such as for teams and projects","required":true,"schema":{"type":"string","uniqueItems":true}},{"name":"pretty","in":"query","description":"If 'true', then the output is pretty printed.","schema":{"type":"string","uniqueItems":true}}]},"/apis/batch/v1beta1/watch/cronjobs":{"get":{"tags":["batch_v1beta1"],"description":"watch individual changes to a list of CronJob. deprecated: use the 'watch' parameter with a list operation instead.","operationId":"watchBatchV1beta1CronJobListForAllNamespaces","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/json;stream=watch":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/vnd.kubernetes.protobuf;stream=watch":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}}}}}},"parameters":[{"name":"allowWatchBookmarks","in":"query","description":"allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.","schema":{"type":"boolean","uniqueItems":true}},{"name":"continue","in":"query","description":"The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.","schema":{"type":"string","uniqueItems":true}},{"name":"fieldSelector","in":"query","description":"A selector to restrict the list of returned objects by their fields. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"labelSelector","in":"query","description":"A selector to restrict the list of returned objects by their labels. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"limit","in":"query","description":"limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.","schema":{"type":"integer","uniqueItems":true}},{"name":"pretty","in":"query","description":"If 'true', then the output is pretty printed.","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersion","in":"query","description":"resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersionMatch","in":"query","description":"resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"timeoutSeconds","in":"query","description":"Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.","schema":{"type":"integer","uniqueItems":true}},{"name":"watch","in":"query","description":"Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.","schema":{"type":"boolean","uniqueItems":true}}]},"/apis/batch/v1beta1/watch/namespaces/{namespace}/cronjobs":{"get":{"tags":["batch_v1beta1"],"description":"watch individual changes to a list of CronJob. deprecated: use the 'watch' parameter with a list operation instead.","operationId":"watchBatchV1beta1NamespacedCronJobList","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/json;stream=watch":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/vnd.kubernetes.protobuf;stream=watch":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}}}}}},"parameters":[{"name":"allowWatchBookmarks","in":"query","description":"allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.","schema":{"type":"boolean","uniqueItems":true}},{"name":"continue","in":"query","description":"The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.","schema":{"type":"string","uniqueItems":true}},{"name":"fieldSelector","in":"query","description":"A selector to restrict the list of returned objects by their fields. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"labelSelector","in":"query","description":"A selector to restrict the list of returned objects by their labels. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"limit","in":"query","description":"limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.","schema":{"type":"integer","uniqueItems":true}},{"name":"namespace","in":"path","description":"object name and auth scope, such as for teams and projects","required":true,"schema":{"type":"string","uniqueItems":true}},{"name":"pretty","in":"query","description":"If 'true', then the output is pretty printed.","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersion","in":"query","description":"resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersionMatch","in":"query","description":"resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"timeoutSeconds","in":"query","description":"Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.","schema":{"type":"integer","uniqueItems":true}},{"name":"watch","in":"query","description":"Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.","schema":{"type":"boolean","uniqueItems":true}}]},"/apis/batch/v1beta1/watch/namespaces/{namespace}/cronjobs/{name}":{"get":{"tags":["batch_v1beta1"],"description":"watch changes to an object of kind CronJob. deprecated: use the 'watch' parameter with a list operation instead, filtered to a single item with the 'fieldSelector' parameter.","operationId":"watchBatchV1beta1NamespacedCronJob","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/json;stream=watch":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/vnd.kubernetes.protobuf;stream=watch":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}}}}}},"parameters":[{"name":"allowWatchBookmarks","in":"query","description":"allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.","schema":{"type":"boolean","uniqueItems":true}},{"name":"continue","in":"query","description":"The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.","schema":{"type":"string","uniqueItems":true}},{"name":"fieldSelector","in":"query","description":"A selector to restrict the list of returned objects by their fields. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"labelSelector","in":"query","description":"A selector to restrict the list of returned objects by their labels. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"limit","in":"query","description":"limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.","schema":{"type":"integer","uniqueItems":true}},{"name":"name","in":"path","description":"name of the CronJob","required":true,"schema":{"type":"string","uniqueItems":true}},{"name":"namespace","in":"path","description":"object name and auth scope, such as for teams and projects","required":true,"schema":{"type":"string","uniqueItems":true}},{"name":"pretty","in":"query","description":"If 'true', then the output is pretty printed.","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersion","in":"query","description":"resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersionMatch","in":"query","description":"resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"timeoutSeconds","in":"query","description":"Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.","schema":{"type":"integer","uniqueItems":true}},{"name":"watch","in":"query","description":"Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.","schema":{"type":"boolean","uniqueItems":true}}]}},"components":{"schemas":{"io.k8s.api.batch.v1.JobSpec":{"description":"JobSpec describes how the job execution will look like.","type":"object","required":["template"],"properties":{"activeDeadlineSeconds":{"description":"Specifies the duration in seconds relative to the startTime that the job may be continuously active before the system tries to terminate it; value must be positive integer. If a Job is suspended (at creation or through an update), this timer will effectively be stopped and reset when the Job is resumed again.","type":"integer","format":"int64"},"backoffLimit":{"description":"Specifies the number of retries before marking this job failed. Defaults to 6","type":"integer","format":"int32"},"completionMode":{"description":"CompletionMode specifies how Pod completions are tracked. It can be `NonIndexed` (default) or `Indexed`.\n\n`NonIndexed` means that the Job is considered complete when there have been .spec.completions successfully completed Pods. Each Pod completion is homologous to each other.\n\n`Indexed` means that the Pods of a Job get an associated completion index from 0 to (.spec.completions - 1), available in the annotation batch.kubernetes.io/job-completion-index. The Job is considered complete when there is one successfully completed Pod for each index. When value is `Indexed`, .spec.completions must be specified and `.spec.parallelism` must be less than or equal to 10^5. In addition, The Pod name takes the form `$(job-name)-$(index)-$(random-string)`, the Pod hostname takes the form `$(job-name)-$(index)`.\n\nThis field is beta-level. More completion modes can be added in the future. If the Job controller observes a mode that it doesn't recognize, the controller skips updates for the Job.","type":"string"},"completions":{"description":"Specifies the desired number of successfully finished pods the job should be run with. Setting to nil means that the success of any pod signals the success of all pods, and allows parallelism to have any positive value. Setting to 1 means that parallelism is limited to 1 and the success of that pod signals the success of the job. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/","type":"integer","format":"int32"},"manualSelector":{"description":"manualSelector controls generation of pod labels and pod selectors. Leave `manualSelector` unset unless you are certain what you are doing. When false or unset, the system pick labels unique to this job and appends those labels to the pod template. When true, the user is responsible for picking unique labels and specifying the selector. Failure to pick a unique label may cause this and other jobs to not function correctly. However, You may see `manualSelector=true` in jobs that were created with the old `extensions/v1beta1` API. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/#specifying-your-own-pod-selector","type":"boolean"},"parallelism":{"description":"Specifies the maximum desired number of pods the job should run at any given time. The actual number of pods running in steady state will be less than this number when ((.spec.completions - .status.successful) \u003c .spec.parallelism), i.e. when the work left to do is less than max parallelism. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/","type":"integer","format":"int32"},"selector":{"description":"A label query over pods that should match the pod count. Normally, the system sets this field for you. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors","$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector"},"suspend":{"description":"Suspend specifies whether the Job controller should create Pods or not. If a Job is created with suspend set to true, no Pods are created by the Job controller. If a Job is suspended after creation (i.e. the flag goes from false to true), the Job controller will delete all active Pods associated with this Job. Users must design their workload to gracefully handle this. Suspending a Job will reset the StartTime field of the Job, effectively resetting the ActiveDeadlineSeconds timer too. Defaults to false.\n\nThis field is beta-level, gated by SuspendJob feature flag (enabled by default).","type":"boolean"},"template":{"description":"Describes the pod that will be created when executing a job. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/","default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.PodTemplateSpec"},"ttlSecondsAfterFinished":{"description":"ttlSecondsAfterFinished limits the lifetime of a Job that has finished execution (either Complete or Failed). If this field is set, ttlSecondsAfterFinished after the Job finishes, it is eligible to be automatically deleted. When the Job is being deleted, its lifecycle guarantees (e.g. finalizers) will be honored. If this field is unset, the Job won't be automatically deleted. If this field is set to zero, the Job becomes eligible to be deleted immediately after it finishes.","type":"integer","format":"int32"}}},"io.k8s.api.batch.v1beta1.CronJob":{"description":"CronJob represents the configuration of a single cron job.","type":"object","properties":{"apiVersion":{"description":"APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources","type":"string"},"kind":{"description":"Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds","type":"string"},"metadata":{"description":"Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata","default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"},"spec":{"description":"Specification of the desired behavior of a cron job, including the schedule. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status","default":{},"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJobSpec"},"status":{"description":"Current status of a cron job. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status","default":{},"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJobStatus"}},"x-kubernetes-group-version-kind":[{"group":"batch","kind":"CronJob","version":"v1beta1"}]},"io.k8s.api.batch.v1beta1.CronJobList":{"description":"CronJobList is a collection of cron jobs.","type":"object","required":["items"],"properties":{"apiVersion":{"description":"APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources","type":"string"},"items":{"description":"items is the list of CronJobs.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}},"kind":{"description":"Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds","type":"string"},"metadata":{"description":"Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata","default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta"}},"x-kubernetes-group-version-kind":[{"group":"batch","kind":"CronJobList","version":"v1beta1"}]},"io.k8s.api.batch.v1beta1.CronJobSpec":{"description":"CronJobSpec describes how the job execution will look like and when it will actually run.","type":"object","required":["schedule","jobTemplate"],"properties":{"concurrencyPolicy":{"description":"Specifies how to treat concurrent executions of a Job. Valid values are: - \"Allow\" (default): allows CronJobs to run concurrently; - \"Forbid\": forbids concurrent runs, skipping next run if previous run hasn't finished yet; - \"Replace\": cancels currently running job and replaces it with a new one","type":"string"},"failedJobsHistoryLimit":{"description":"The number of failed finished jobs to retain. This is a pointer to distinguish between explicit zero and not specified. Defaults to 1.","type":"integer","format":"int32"},"jobTemplate":{"description":"Specifies the job that will be created when executing a CronJob.","default":{},"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.JobTemplateSpec"},"schedule":{"description":"The schedule in Cron format, see https://en.wikipedia.org/wiki/Cron.","type":"string","default":""},"startingDeadlineSeconds":{"description":"Optional deadline in seconds for starting the job if it misses scheduled time for any reason. Missed jobs executions will be counted as failed ones.","type":"integer","format":"int64"},"successfulJobsHistoryLimit":{"description":"The number of successful finished jobs to retain. This is a pointer to distinguish between explicit zero and not specified. Defaults to 3.","type":"integer","format":"int32"},"suspend":{"description":"This flag tells the controller to suspend subsequent executions, it does not apply to already started executions. Defaults to false.","type":"boolean"}}},"io.k8s.api.batch.v1beta1.CronJobStatus":{"description":"CronJobStatus represents the current state of a cron job.","type":"object","properties":{"active":{"description":"A list of pointers to currently running jobs.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.ObjectReference"},"x-kubernetes-list-type":"atomic"},"lastScheduleTime":{"description":"Information when was the last time the job was successfully scheduled.","$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time"},"lastSuccessfulTime":{"description":"Information when was the last time the job successfully completed.","$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time"}}},"io.k8s.api.batch.v1beta1.JobTemplateSpec":{"description":"JobTemplateSpec describes the data a Job should have when created from a template","type":"object","properties":{"metadata":{"description":"Standard object's metadata of the jobs created from this template. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata","default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"},"spec":{"description":"Specification of the desired behavior of the job. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status","default":{},"$ref":"#/components/schemas/io.k8s.api.batch.v1.JobSpec"}}},"io.k8s.api.core.v1.AWSElasticBlockStoreVolumeSource":{"description":"Represents a Persistent Disk resource in AWS.\n\nAn AWS EBS disk must exist before mounting to a container. The disk must also be in the same AWS zone as the kubelet. An AWS EBS disk can only be mounted as read/write once. AWS EBS volumes support ownership management and SELinux relabeling.","type":"object","required":["volumeID"],"properties":{"fsType":{"description":"fsType is the filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore","type":"string"},"partition":{"description":"partition is the partition in the volume that you want to mount. If omitted, the default is to mount by volume name. Examples: For volume /dev/sda1, you specify the partition as \"1\". Similarly, the volume partition for /dev/sda is \"0\" (or you can leave the property empty).","type":"integer","format":"int32"},"readOnly":{"description":"readOnly value true will force the readOnly setting in VolumeMounts. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore","type":"boolean"},"volumeID":{"description":"volumeID is unique ID of the persistent disk resource in AWS (Amazon EBS volume). More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore","type":"string","default":""}}},"io.k8s.api.core.v1.Affinity":{"description":"Affinity is a group of affinity scheduling rules.","type":"object","properties":{"nodeAffinity":{"description":"Describes node affinity scheduling rules for the pod.","$ref":"#/components/schemas/io.k8s.api.core.v1.NodeAffinity"},"podAffinity":{"description":"Describes pod affinity scheduling rules (e.g. co-locate this pod in the same node, zone, etc. as some other pod(s)).","$ref":"#/components/schemas/io.k8s.api.core.v1.PodAffinity"},"podAntiAffinity":{"description":"Describes pod anti-affinity scheduling rules (e.g. avoid putting this pod in the same node, zone, etc. as some other pod(s)).","$ref":"#/components/schemas/io.k8s.api.core.v1.PodAntiAffinity"}}},"io.k8s.api.core.v1.AzureDiskVolumeSource":{"description":"AzureDisk represents an Azure Data Disk mount on the host and bind mount to the pod.","type":"object","required":["diskName","diskURI"],"properties":{"cachingMode":{"description":"cachingMode is the Host Caching mode: None, Read Only, Read Write.","type":"string"},"diskName":{"description":"diskName is the Name of the data disk in the blob storage","type":"string","default":""},"diskURI":{"description":"diskURI is the URI of data disk in the blob storage","type":"string","default":""},"fsType":{"description":"fsType is Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.","type":"string"},"kind":{"description":"kind expected values are Shared: multiple blob disks per storage account Dedicated: single blob disk per storage account Managed: azure managed data disk (only in managed availability set). defaults to shared","type":"string"},"readOnly":{"description":"readOnly Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.","type":"boolean"}}},"io.k8s.api.core.v1.AzureFileVolumeSource":{"description":"AzureFile represents an Azure File Service mount on the host and bind mount to the pod.","type":"object","required":["secretName","shareName"],"properties":{"readOnly":{"description":"readOnly defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.","type":"boolean"},"secretName":{"description":"secretName is the name of secret that contains Azure Storage Account Name and Key","type":"string","default":""},"shareName":{"description":"shareName is the azure share Name","type":"string","default":""}}},"io.k8s.api.core.v1.CSIVolumeSource":{"description":"Represents a source location of a volume to mount, managed by an external CSI driver","type":"object","required":["driver"],"properties":{"driver":{"description":"driver is the name of the CSI driver that handles this volume. Consult with your admin for the correct name as registered in the cluster.","type":"string","default":""},"fsType":{"description":"fsType to mount. Ex. \"ext4\", \"xfs\", \"ntfs\". If not provided, the empty value is passed to the associated CSI driver which will determine the default filesystem to apply.","type":"string"},"nodePublishSecretRef":{"description":"nodePublishSecretRef is a reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI NodePublishVolume and NodeUnpublishVolume calls. This field is optional, and may be empty if no secret is required. If the secret object contains more than one secret, all secret references are passed.","$ref":"#/components/schemas/io.k8s.api.core.v1.LocalObjectReference"},"readOnly":{"description":"readOnly specifies a read-only configuration for the volume. Defaults to false (read/write).","type":"boolean"},"volumeAttributes":{"description":"volumeAttributes stores driver-specific properties that are passed to the CSI driver. Consult your driver's documentation for supported values.","type":"object","additionalProperties":{"type":"string","default":""}}}},"io.k8s.api.core.v1.Capabilities":{"description":"Adds and removes POSIX capabilities from running containers.","type":"object","properties":{"add":{"description":"Added capabilities","type":"array","items":{"type":"string","default":""}},"drop":{"description":"Removed capabilities","type":"array","items":{"type":"string","default":""}}}},"io.k8s.api.core.v1.CephFSVolumeSource":{"description":"Represents a Ceph Filesystem mount that lasts the lifetime of a pod Cephfs volumes do not support ownership management or SELinux relabeling.","type":"object","required":["monitors"],"properties":{"monitors":{"description":"monitors is Required: Monitors is a collection of Ceph monitors More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it","type":"array","items":{"type":"string","default":""}},"path":{"description":"path is Optional: Used as the mounted root, rather than the full Ceph tree, default is /","type":"string"},"readOnly":{"description":"readOnly is Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it","type":"boolean"},"secretFile":{"description":"secretFile is Optional: SecretFile is the path to key ring for User, default is /etc/ceph/user.secret More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it","type":"string"},"secretRef":{"description":"secretRef is Optional: SecretRef is reference to the authentication secret for User, default is empty. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it","$ref":"#/components/schemas/io.k8s.api.core.v1.LocalObjectReference"},"user":{"description":"user is optional: User is the rados user name, default is admin More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it","type":"string"}}},"io.k8s.api.core.v1.CinderVolumeSource":{"description":"Represents a cinder volume resource in Openstack. A Cinder volume must exist before mounting to a container. The volume must also be in the same region as the kubelet. Cinder volumes support ownership management and SELinux relabeling.","type":"object","required":["volumeID"],"properties":{"fsType":{"description":"fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://examples.k8s.io/mysql-cinder-pd/README.md","type":"string"},"readOnly":{"description":"readOnly defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. More info: https://examples.k8s.io/mysql-cinder-pd/README.md","type":"boolean"},"secretRef":{"description":"secretRef is optional: points to a secret object containing parameters used to connect to OpenStack.","$ref":"#/components/schemas/io.k8s.api.core.v1.LocalObjectReference"},"volumeID":{"description":"volumeID used to identify the volume in cinder. More info: https://examples.k8s.io/mysql-cinder-pd/README.md","type":"string","default":""}}},"io.k8s.api.core.v1.ConfigMapEnvSource":{"description":"ConfigMapEnvSource selects a ConfigMap to populate the environment variables with.\n\nThe contents of the target ConfigMap's Data field will represent the key-value pairs as environment variables.","type":"object","properties":{"name":{"description":"Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names","type":"string"},"optional":{"description":"Specify whether the ConfigMap must be defined","type":"boolean"}}},"io.k8s.api.core.v1.ConfigMapKeySelector":{"description":"Selects a key from a ConfigMap.","type":"object","required":["key"],"properties":{"key":{"description":"The key to select.","type":"string","default":""},"name":{"description":"Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names","type":"string"},"optional":{"description":"Specify whether the ConfigMap or its key must be defined","type":"boolean"}},"x-kubernetes-map-type":"atomic"},"io.k8s.api.core.v1.ConfigMapProjection":{"description":"Adapts a ConfigMap into a projected volume.\n\nThe contents of the target ConfigMap's Data field will be presented in a projected volume as files using the keys in the Data field as the file names, unless the items element is populated with specific mappings of keys to paths. Note that this is identical to a configmap volume source without the default mode.","type":"object","properties":{"items":{"description":"items if unspecified, each key-value pair in the Data field of the referenced ConfigMap will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the ConfigMap, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.KeyToPath"}},"name":{"description":"Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names","type":"string"},"optional":{"description":"optional specify whether the ConfigMap or its keys must be defined","type":"boolean"}}},"io.k8s.api.core.v1.ConfigMapVolumeSource":{"description":"Adapts a ConfigMap into a volume.\n\nThe contents of the target ConfigMap's Data field will be presented in a volume as files using the keys in the Data field as the file names, unless the items element is populated with specific mappings of keys to paths. ConfigMap volumes support ownership management and SELinux relabeling.","type":"object","properties":{"defaultMode":{"description":"defaultMode is optional: mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.","type":"integer","format":"int32"},"items":{"description":"items if unspecified, each key-value pair in the Data field of the referenced ConfigMap will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the ConfigMap, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.KeyToPath"}},"name":{"description":"Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names","type":"string"},"optional":{"description":"optional specify whether the ConfigMap or its keys must be defined","type":"boolean"}}},"io.k8s.api.core.v1.Container":{"description":"A single application container that you want to run within a pod.","type":"object","required":["name"],"properties":{"args":{"description":"Arguments to the entrypoint. The container image's CMD is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \"$$(VAR_NAME)\" will produce the string literal \"$(VAR_NAME)\". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell","type":"array","items":{"type":"string","default":""}},"command":{"description":"Entrypoint array. Not executed within a shell. The container image's ENTRYPOINT is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \"$$(VAR_NAME)\" will produce the string literal \"$(VAR_NAME)\". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell","type":"array","items":{"type":"string","default":""}},"env":{"description":"List of environment variables to set in the container. Cannot be updated.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.EnvVar"},"x-kubernetes-patch-merge-key":"name","x-kubernetes-patch-strategy":"merge"},"envFrom":{"description":"List of sources to populate environment variables in the container. The keys defined within a source must be a C_IDENTIFIER. All invalid keys will be reported as an event when the container is starting. When a key exists in multiple sources, the value associated with the last source will take precedence. Values defined by an Env with a duplicate key will take precedence. Cannot be updated.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.EnvFromSource"}},"image":{"description":"Container image name. More info: https://kubernetes.io/docs/concepts/containers/images This field is optional to allow higher level config management to default or override container images in workload controllers like Deployments and StatefulSets.","type":"string"},"imagePullPolicy":{"description":"Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. Cannot be updated. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images\n\n","type":"string"},"lifecycle":{"description":"Actions that the management system should take in response to container lifecycle events. Cannot be updated.","$ref":"#/components/schemas/io.k8s.api.core.v1.Lifecycle"},"livenessProbe":{"description":"Periodic probe of container liveness. Container will be restarted if the probe fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes","$ref":"#/components/schemas/io.k8s.api.core.v1.Probe"},"name":{"description":"Name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated.","type":"string","default":""},"ports":{"description":"List of ports to expose from the container. Exposing a port here gives the system additional information about the network connections a container uses, but is primarily informational. Not specifying a port here DOES NOT prevent that port from being exposed. Any port which is listening on the default \"0.0.0.0\" address inside a container will be accessible from the network. Cannot be updated.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.ContainerPort"},"x-kubernetes-list-map-keys":["containerPort","protocol"],"x-kubernetes-list-type":"map","x-kubernetes-patch-merge-key":"containerPort","x-kubernetes-patch-strategy":"merge"},"readinessProbe":{"description":"Periodic probe of container service readiness. Container will be removed from service endpoints if the probe fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes","$ref":"#/components/schemas/io.k8s.api.core.v1.Probe"},"resources":{"description":"Compute Resources required by this container. Cannot be updated. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/","default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.ResourceRequirements"},"securityContext":{"description":"SecurityContext defines the security options the container should be run with. If set, the fields of SecurityContext override the equivalent fields of PodSecurityContext. More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/","$ref":"#/components/schemas/io.k8s.api.core.v1.SecurityContext"},"startupProbe":{"description":"StartupProbe indicates that the Pod has successfully initialized. If specified, no other probes are executed until this completes successfully. If this probe fails, the Pod will be restarted, just as if the livenessProbe failed. This can be used to provide different probe parameters at the beginning of a Pod's lifecycle, when it might take a long time to load data or warm a cache, than during steady-state operation. This cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes","$ref":"#/components/schemas/io.k8s.api.core.v1.Probe"},"stdin":{"description":"Whether this container should allocate a buffer for stdin in the container runtime. If this is not set, reads from stdin in the container will always result in EOF. Default is false.","type":"boolean"},"stdinOnce":{"description":"Whether the container runtime should close the stdin channel after it has been opened by a single attach. When stdin is true the stdin stream will remain open across multiple attach sessions. If stdinOnce is set to true, stdin is opened on container start, is empty until the first client attaches to stdin, and then remains open and accepts data until the client disconnects, at which time stdin is closed and remains closed until the container is restarted. If this flag is false, a container processes that reads from stdin will never receive an EOF. Default is false","type":"boolean"},"terminationMessagePath":{"description":"Optional: Path at which the file to which the container's termination message will be written is mounted into the container's filesystem. Message written is intended to be brief final status, such as an assertion failure message. Will be truncated by the node if greater than 4096 bytes. The total message length across all containers will be limited to 12kb. Defaults to /dev/termination-log. Cannot be updated.","type":"string"},"terminationMessagePolicy":{"description":"Indicate how the termination message should be populated. File will use the contents of terminationMessagePath to populate the container status message on both success and failure. FallbackToLogsOnError will use the last chunk of container log output if the termination message file is empty and the container exited with an error. The log output is limited to 2048 bytes or 80 lines, whichever is smaller. Defaults to File. Cannot be updated.\n\n","type":"string"},"tty":{"description":"Whether this container should allocate a TTY for itself, also requires 'stdin' to be true. Default is false.","type":"boolean"},"volumeDevices":{"description":"volumeDevices is the list of block devices to be used by the container.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.VolumeDevice"},"x-kubernetes-patch-merge-key":"devicePath","x-kubernetes-patch-strategy":"merge"},"volumeMounts":{"description":"Pod volumes to mount into the container's filesystem. Cannot be updated.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.VolumeMount"},"x-kubernetes-patch-merge-key":"mountPath","x-kubernetes-patch-strategy":"merge"},"workingDir":{"description":"Container's working directory. If not specified, the container runtime's default will be used, which might be configured in the container image. Cannot be updated.","type":"string"}}},"io.k8s.api.core.v1.ContainerPort":{"description":"ContainerPort represents a network port in a single container.","type":"object","required":["containerPort"],"properties":{"containerPort":{"description":"Number of port to expose on the pod's IP address. This must be a valid port number, 0 \u003c x \u003c 65536.","type":"integer","format":"int32","default":0},"hostIP":{"description":"What host IP to bind the external port to.","type":"string"},"hostPort":{"description":"Number of port to expose on the host. If specified, this must be a valid port number, 0 \u003c x \u003c 65536. If HostNetwork is specified, this must match ContainerPort. Most containers do not need this.","type":"integer","format":"int32"},"name":{"description":"If specified, this must be an IANA_SVC_NAME and unique within the pod. Each named port in a pod must have a unique name. Name for the port that can be referred to by services.","type":"string"},"protocol":{"description":"Protocol for port. Must be UDP, TCP, or SCTP. Defaults to \"TCP\".\n\n","type":"string","default":"TCP"}}},"io.k8s.api.core.v1.DownwardAPIProjection":{"description":"Represents downward API info for projecting into a projected volume. Note that this is identical to a downwardAPI volume source without the default mode.","type":"object","properties":{"items":{"description":"Items is a list of DownwardAPIVolume file","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.DownwardAPIVolumeFile"}}}},"io.k8s.api.core.v1.DownwardAPIVolumeFile":{"description":"DownwardAPIVolumeFile represents information to create the file containing the pod field","type":"object","required":["path"],"properties":{"fieldRef":{"description":"Required: Selects a field of the pod: only annotations, labels, name and namespace are supported.","$ref":"#/components/schemas/io.k8s.api.core.v1.ObjectFieldSelector"},"mode":{"description":"Optional: mode bits used to set permissions on this file, must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.","type":"integer","format":"int32"},"path":{"description":"Required: Path is the relative path name of the file to be created. Must not be absolute or contain the '..' path. Must be utf-8 encoded. The first item of the relative path must not start with '..'","type":"string","default":""},"resourceFieldRef":{"description":"Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported.","$ref":"#/components/schemas/io.k8s.api.core.v1.ResourceFieldSelector"}}},"io.k8s.api.core.v1.DownwardAPIVolumeSource":{"description":"DownwardAPIVolumeSource represents a volume containing downward API info. Downward API volumes support ownership management and SELinux relabeling.","type":"object","properties":{"defaultMode":{"description":"Optional: mode bits to use on created files by default. Must be a Optional: mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.","type":"integer","format":"int32"},"items":{"description":"Items is a list of downward API volume file","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.DownwardAPIVolumeFile"}}}},"io.k8s.api.core.v1.EmptyDirVolumeSource":{"description":"Represents an empty directory for a pod. Empty directory volumes support ownership management and SELinux relabeling.","type":"object","properties":{"medium":{"description":"medium represents what type of storage medium should back this directory. The default is \"\" which means to use the node's default medium. Must be an empty string (default) or Memory. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir","type":"string"},"sizeLimit":{"description":"sizeLimit is the total amount of local storage required for this EmptyDir volume. The size limit is also applicable for memory medium. The maximum usage on memory medium EmptyDir would be the minimum value between the SizeLimit specified here and the sum of memory limits of all containers in a pod. The default is nil which means that the limit is undefined. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir","$ref":"#/components/schemas/io.k8s.apimachinery.pkg.api.resource.Quantity"}}},"io.k8s.api.core.v1.EnvFromSource":{"description":"EnvFromSource represents the source of a set of ConfigMaps","type":"object","properties":{"configMapRef":{"description":"The ConfigMap to select from","$ref":"#/components/schemas/io.k8s.api.core.v1.ConfigMapEnvSource"},"prefix":{"description":"An optional identifier to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER.","type":"string"},"secretRef":{"description":"The Secret to select from","$ref":"#/components/schemas/io.k8s.api.core.v1.SecretEnvSource"}}},"io.k8s.api.core.v1.EnvVar":{"description":"EnvVar represents an environment variable present in a Container.","type":"object","required":["name"],"properties":{"name":{"description":"Name of the environment variable. Must be a C_IDENTIFIER.","type":"string","default":""},"value":{"description":"Variable references $(VAR_NAME) are expanded using the previously defined environment variables in the container and any service environment variables. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \"$$(VAR_NAME)\" will produce the string literal \"$(VAR_NAME)\". Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to \"\".","type":"string"},"valueFrom":{"description":"Source for the environment variable's value. Cannot be used if value is not empty.","$ref":"#/components/schemas/io.k8s.api.core.v1.EnvVarSource"}}},"io.k8s.api.core.v1.EnvVarSource":{"description":"EnvVarSource represents a source for the value of an EnvVar.","type":"object","properties":{"configMapKeyRef":{"description":"Selects a key of a ConfigMap.","$ref":"#/components/schemas/io.k8s.api.core.v1.ConfigMapKeySelector"},"fieldRef":{"description":"Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['\u003cKEY\u003e']`, `metadata.annotations['\u003cKEY\u003e']`, spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.","$ref":"#/components/schemas/io.k8s.api.core.v1.ObjectFieldSelector"},"resourceFieldRef":{"description":"Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.","$ref":"#/components/schemas/io.k8s.api.core.v1.ResourceFieldSelector"},"secretKeyRef":{"description":"Selects a key of a secret in the pod's namespace","$ref":"#/components/schemas/io.k8s.api.core.v1.SecretKeySelector"}}},"io.k8s.api.core.v1.EphemeralContainer":{"description":"An EphemeralContainer is a temporary container that you may add to an existing Pod for user-initiated activities such as debugging. Ephemeral containers have no resource or scheduling guarantees, and they will not be restarted when they exit or when a Pod is removed or restarted. The kubelet may evict a Pod if an ephemeral container causes the Pod to exceed its resource allocation.\n\nTo add an ephemeral container, use the ephemeralcontainers subresource of an existing Pod. Ephemeral containers may not be removed or restarted.","type":"object","required":["name"],"properties":{"args":{"description":"Arguments to the entrypoint. The image's CMD is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \"$$(VAR_NAME)\" will produce the string literal \"$(VAR_NAME)\". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell","type":"array","items":{"type":"string","default":""}},"command":{"description":"Entrypoint array. Not executed within a shell. The image's ENTRYPOINT is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \"$$(VAR_NAME)\" will produce the string literal \"$(VAR_NAME)\". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell","type":"array","items":{"type":"string","default":""}},"env":{"description":"List of environment variables to set in the container. Cannot be updated.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.EnvVar"},"x-kubernetes-patch-merge-key":"name","x-kubernetes-patch-strategy":"merge"},"envFrom":{"description":"List of sources to populate environment variables in the container. The keys defined within a source must be a C_IDENTIFIER. All invalid keys will be reported as an event when the container is starting. When a key exists in multiple sources, the value associated with the last source will take precedence. Values defined by an Env with a duplicate key will take precedence. Cannot be updated.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.EnvFromSource"}},"image":{"description":"Container image name. More info: https://kubernetes.io/docs/concepts/containers/images","type":"string"},"imagePullPolicy":{"description":"Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. Cannot be updated. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images\n\n","type":"string"},"lifecycle":{"description":"Lifecycle is not allowed for ephemeral containers.","$ref":"#/components/schemas/io.k8s.api.core.v1.Lifecycle"},"livenessProbe":{"description":"Probes are not allowed for ephemeral containers.","$ref":"#/components/schemas/io.k8s.api.core.v1.Probe"},"name":{"description":"Name of the ephemeral container specified as a DNS_LABEL. This name must be unique among all containers, init containers and ephemeral containers.","type":"string","default":""},"ports":{"description":"Ports are not allowed for ephemeral containers.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.ContainerPort"},"x-kubernetes-list-map-keys":["containerPort","protocol"],"x-kubernetes-list-type":"map","x-kubernetes-patch-merge-key":"containerPort","x-kubernetes-patch-strategy":"merge"},"readinessProbe":{"description":"Probes are not allowed for ephemeral containers.","$ref":"#/components/schemas/io.k8s.api.core.v1.Probe"},"resources":{"description":"Resources are not allowed for ephemeral containers. Ephemeral containers use spare resources already allocated to the pod.","default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.ResourceRequirements"},"securityContext":{"description":"Optional: SecurityContext defines the security options the ephemeral container should be run with. If set, the fields of SecurityContext override the equivalent fields of PodSecurityContext.","$ref":"#/components/schemas/io.k8s.api.core.v1.SecurityContext"},"startupProbe":{"description":"Probes are not allowed for ephemeral containers.","$ref":"#/components/schemas/io.k8s.api.core.v1.Probe"},"stdin":{"description":"Whether this container should allocate a buffer for stdin in the container runtime. If this is not set, reads from stdin in the container will always result in EOF. Default is false.","type":"boolean"},"stdinOnce":{"description":"Whether the container runtime should close the stdin channel after it has been opened by a single attach. When stdin is true the stdin stream will remain open across multiple attach sessions. If stdinOnce is set to true, stdin is opened on container start, is empty until the first client attaches to stdin, and then remains open and accepts data until the client disconnects, at which time stdin is closed and remains closed until the container is restarted. If this flag is false, a container processes that reads from stdin will never receive an EOF. Default is false","type":"boolean"},"targetContainerName":{"description":"If set, the name of the container from PodSpec that this ephemeral container targets. The ephemeral container will be run in the namespaces (IPC, PID, etc) of this container. If not set then the ephemeral container uses the namespaces configured in the Pod spec.\n\nThe container runtime must implement support for this feature. If the runtime does not support namespace targeting then the result of setting this field is undefined.","type":"string"},"terminationMessagePath":{"description":"Optional: Path at which the file to which the container's termination message will be written is mounted into the container's filesystem. Message written is intended to be brief final status, such as an assertion failure message. Will be truncated by the node if greater than 4096 bytes. The total message length across all containers will be limited to 12kb. Defaults to /dev/termination-log. Cannot be updated.","type":"string"},"terminationMessagePolicy":{"description":"Indicate how the termination message should be populated. File will use the contents of terminationMessagePath to populate the container status message on both success and failure. FallbackToLogsOnError will use the last chunk of container log output if the termination message file is empty and the container exited with an error. The log output is limited to 2048 bytes or 80 lines, whichever is smaller. Defaults to File. Cannot be updated.\n\n","type":"string"},"tty":{"description":"Whether this container should allocate a TTY for itself, also requires 'stdin' to be true. Default is false.","type":"boolean"},"volumeDevices":{"description":"volumeDevices is the list of block devices to be used by the container.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.VolumeDevice"},"x-kubernetes-patch-merge-key":"devicePath","x-kubernetes-patch-strategy":"merge"},"volumeMounts":{"description":"Pod volumes to mount into the container's filesystem. Subpath mounts are not allowed for ephemeral containers. Cannot be updated.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.VolumeMount"},"x-kubernetes-patch-merge-key":"mountPath","x-kubernetes-patch-strategy":"merge"},"workingDir":{"description":"Container's working directory. If not specified, the container runtime's default will be used, which might be configured in the container image. Cannot be updated.","type":"string"}}},"io.k8s.api.core.v1.EphemeralVolumeSource":{"description":"Represents an ephemeral volume that is handled by a normal storage driver.","type":"object","properties":{"volumeClaimTemplate":{"description":"Will be used to create a stand-alone PVC to provision the volume. The pod in which this EphemeralVolumeSource is embedded will be the owner of the PVC, i.e. the PVC will be deleted together with the pod. The name of the PVC will be `\u003cpod name\u003e-\u003cvolume name\u003e` where `\u003cvolume name\u003e` is the name from the `PodSpec.Volumes` array entry. Pod validation will reject the pod if the concatenated name is not valid for a PVC (for example, too long).\n\nAn existing PVC with that name that is not owned by the pod will *not* be used for the pod to avoid using an unrelated volume by mistake. Starting the pod is then blocked until the unrelated PVC is removed. If such a pre-created PVC is meant to be used by the pod, the PVC has to updated with an owner reference to the pod once the pod exists. Normally this should not be necessary, but it may be useful when manually reconstructing a broken cluster.\n\nThis field is read-only and no changes will be made by Kubernetes to the PVC after it has been created.\n\nRequired, must not be nil.","$ref":"#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaimTemplate"}}},"io.k8s.api.core.v1.ExecAction":{"description":"ExecAction describes a \"run in container\" action.","type":"object","properties":{"command":{"description":"Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is simply exec'd, it is not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy.","type":"array","items":{"type":"string","default":""}}}},"io.k8s.api.core.v1.FCVolumeSource":{"description":"Represents a Fibre Channel volume. Fibre Channel volumes can only be mounted as read/write once. Fibre Channel volumes support ownership management and SELinux relabeling.","type":"object","properties":{"fsType":{"description":"fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.","type":"string"},"lun":{"description":"lun is Optional: FC target lun number","type":"integer","format":"int32"},"readOnly":{"description":"readOnly is Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.","type":"boolean"},"targetWWNs":{"description":"targetWWNs is Optional: FC target worldwide names (WWNs)","type":"array","items":{"type":"string","default":""}},"wwids":{"description":"wwids Optional: FC volume world wide identifiers (wwids) Either wwids or combination of targetWWNs and lun must be set, but not both simultaneously.","type":"array","items":{"type":"string","default":""}}}},"io.k8s.api.core.v1.FlexVolumeSource":{"description":"FlexVolume represents a generic volume resource that is provisioned/attached using an exec based plugin.","type":"object","required":["driver"],"properties":{"driver":{"description":"driver is the name of the driver to use for this volume.","type":"string","default":""},"fsType":{"description":"fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". The default filesystem depends on FlexVolume script.","type":"string"},"options":{"description":"options is Optional: this field holds extra command options if any.","type":"object","additionalProperties":{"type":"string","default":""}},"readOnly":{"description":"readOnly is Optional: defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.","type":"boolean"},"secretRef":{"description":"secretRef is Optional: secretRef is reference to the secret object containing sensitive information to pass to the plugin scripts. This may be empty if no secret object is specified. If the secret object contains more than one secret, all secrets are passed to the plugin scripts.","$ref":"#/components/schemas/io.k8s.api.core.v1.LocalObjectReference"}}},"io.k8s.api.core.v1.FlockerVolumeSource":{"description":"Represents a Flocker volume mounted by the Flocker agent. One and only one of datasetName and datasetUUID should be set. Flocker volumes do not support ownership management or SELinux relabeling.","type":"object","properties":{"datasetName":{"description":"datasetName is Name of the dataset stored as metadata -\u003e name on the dataset for Flocker should be considered as deprecated","type":"string"},"datasetUUID":{"description":"datasetUUID is the UUID of the dataset. This is unique identifier of a Flocker dataset","type":"string"}}},"io.k8s.api.core.v1.GCEPersistentDiskVolumeSource":{"description":"Represents a Persistent Disk resource in Google Compute Engine.\n\nA GCE PD must exist before mounting to a container. The disk must also be in the same GCE project and zone as the kubelet. A GCE PD can only be mounted as read/write once or read-only many times. GCE PDs support ownership management and SELinux relabeling.","type":"object","required":["pdName"],"properties":{"fsType":{"description":"fsType is filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk","type":"string"},"partition":{"description":"partition is the partition in the volume that you want to mount. If omitted, the default is to mount by volume name. Examples: For volume /dev/sda1, you specify the partition as \"1\". Similarly, the volume partition for /dev/sda is \"0\" (or you can leave the property empty). More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk","type":"integer","format":"int32"},"pdName":{"description":"pdName is unique name of the PD resource in GCE. Used to identify the disk in GCE. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk","type":"string","default":""},"readOnly":{"description":"readOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk","type":"boolean"}}},"io.k8s.api.core.v1.GRPCAction":{"type":"object","required":["port"],"properties":{"port":{"description":"Port number of the gRPC service. Number must be in the range 1 to 65535.","type":"integer","format":"int32","default":0},"service":{"description":"Service is the name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md).\n\nIf this is not specified, the default behavior is defined by gRPC.","type":"string","default":""}}},"io.k8s.api.core.v1.GitRepoVolumeSource":{"description":"Represents a volume that is populated with the contents of a git repository. Git repo volumes do not support ownership management. Git repo volumes support SELinux relabeling.\n\nDEPRECATED: GitRepo is deprecated. To provision a container with a git repo, mount an EmptyDir into an InitContainer that clones the repo using git, then mount the EmptyDir into the Pod's container.","type":"object","required":["repository"],"properties":{"directory":{"description":"directory is the target directory name. Must not contain or start with '..'. If '.' is supplied, the volume directory will be the git repository. Otherwise, if specified, the volume will contain the git repository in the subdirectory with the given name.","type":"string"},"repository":{"description":"repository is the URL","type":"string","default":""},"revision":{"description":"revision is the commit hash for the specified revision.","type":"string"}}},"io.k8s.api.core.v1.GlusterfsVolumeSource":{"description":"Represents a Glusterfs mount that lasts the lifetime of a pod. Glusterfs volumes do not support ownership management or SELinux relabeling.","type":"object","required":["endpoints","path"],"properties":{"endpoints":{"description":"endpoints is the endpoint name that details Glusterfs topology. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod","type":"string","default":""},"path":{"description":"path is the Glusterfs volume path. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod","type":"string","default":""},"readOnly":{"description":"readOnly here will force the Glusterfs volume to be mounted with read-only permissions. Defaults to false. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod","type":"boolean"}}},"io.k8s.api.core.v1.HTTPGetAction":{"description":"HTTPGetAction describes an action based on HTTP Get requests.","type":"object","required":["port"],"properties":{"host":{"description":"Host name to connect to, defaults to the pod IP. You probably want to set \"Host\" in httpHeaders instead.","type":"string"},"httpHeaders":{"description":"Custom headers to set in the request. HTTP allows repeated headers.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.HTTPHeader"}},"path":{"description":"Path to access on the HTTP server.","type":"string"},"port":{"description":"Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME.","default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.util.intstr.IntOrString"},"scheme":{"description":"Scheme to use for connecting to the host. Defaults to HTTP.\n\n","type":"string"}}},"io.k8s.api.core.v1.HTTPHeader":{"description":"HTTPHeader describes a custom header to be used in HTTP probes","type":"object","required":["name","value"],"properties":{"name":{"description":"The header field name","type":"string","default":""},"value":{"description":"The header field value","type":"string","default":""}}},"io.k8s.api.core.v1.HostAlias":{"description":"HostAlias holds the mapping between IP and hostnames that will be injected as an entry in the pod's hosts file.","type":"object","properties":{"hostnames":{"description":"Hostnames for the above IP address.","type":"array","items":{"type":"string","default":""}},"ip":{"description":"IP address of the host file entry.","type":"string"}}},"io.k8s.api.core.v1.HostPathVolumeSource":{"description":"Represents a host path mapped into a pod. Host path volumes do not support ownership management or SELinux relabeling.","type":"object","required":["path"],"properties":{"path":{"description":"path of the directory on the host. If the path is a symlink, it will follow the link to the real path. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath","type":"string","default":""},"type":{"description":"type for HostPath Volume Defaults to \"\" More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath","type":"string"}}},"io.k8s.api.core.v1.ISCSIVolumeSource":{"description":"Represents an ISCSI disk. ISCSI volumes can only be mounted as read/write once. ISCSI volumes support ownership management and SELinux relabeling.","type":"object","required":["targetPortal","iqn","lun"],"properties":{"chapAuthDiscovery":{"description":"chapAuthDiscovery defines whether support iSCSI Discovery CHAP authentication","type":"boolean"},"chapAuthSession":{"description":"chapAuthSession defines whether support iSCSI Session CHAP authentication","type":"boolean"},"fsType":{"description":"fsType is the filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#iscsi","type":"string"},"initiatorName":{"description":"initiatorName is the custom iSCSI Initiator Name. If initiatorName is specified with iscsiInterface simultaneously, new iSCSI interface \u003ctarget portal\u003e:\u003cvolume name\u003e will be created for the connection.","type":"string"},"iqn":{"description":"iqn is the target iSCSI Qualified Name.","type":"string","default":""},"iscsiInterface":{"description":"iscsiInterface is the interface Name that uses an iSCSI transport. Defaults to 'default' (tcp).","type":"string"},"lun":{"description":"lun represents iSCSI Target Lun number.","type":"integer","format":"int32","default":0},"portals":{"description":"portals is the iSCSI Target Portal List. The portal is either an IP or ip_addr:port if the port is other than default (typically TCP ports 860 and 3260).","type":"array","items":{"type":"string","default":""}},"readOnly":{"description":"readOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false.","type":"boolean"},"secretRef":{"description":"secretRef is the CHAP Secret for iSCSI target and initiator authentication","$ref":"#/components/schemas/io.k8s.api.core.v1.LocalObjectReference"},"targetPortal":{"description":"targetPortal is iSCSI Target Portal. The Portal is either an IP or ip_addr:port if the port is other than default (typically TCP ports 860 and 3260).","type":"string","default":""}}},"io.k8s.api.core.v1.KeyToPath":{"description":"Maps a string key to a path within a volume.","type":"object","required":["key","path"],"properties":{"key":{"description":"key is the key to project.","type":"string","default":""},"mode":{"description":"mode is Optional: mode bits used to set permissions on this file. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.","type":"integer","format":"int32"},"path":{"description":"path is the relative path of the file to map the key to. May not be an absolute path. May not contain the path element '..'. May not start with the string '..'.","type":"string","default":""}}},"io.k8s.api.core.v1.Lifecycle":{"description":"Lifecycle describes actions that the management system should take in response to container lifecycle events. For the PostStart and PreStop lifecycle handlers, management of the container blocks until the action is complete, unless the container process fails, in which case the handler is aborted.","type":"object","properties":{"postStart":{"description":"PostStart is called immediately after a container is created. If the handler fails, the container is terminated and restarted according to its restart policy. Other management of the container blocks until the hook completes. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks","$ref":"#/components/schemas/io.k8s.api.core.v1.LifecycleHandler"},"preStop":{"description":"PreStop is called immediately before a container is terminated due to an API request or management event such as liveness/startup probe failure, preemption, resource contention, etc. The handler is not called if the container crashes or exits. The Pod's termination grace period countdown begins before the PreStop hook is executed. Regardless of the outcome of the handler, the container will eventually terminate within the Pod's termination grace period (unless delayed by finalizers). Other management of the container blocks until the hook completes or until the termination grace period is reached. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks","$ref":"#/components/schemas/io.k8s.api.core.v1.LifecycleHandler"}}},"io.k8s.api.core.v1.LifecycleHandler":{"description":"LifecycleHandler defines a specific action that should be taken in a lifecycle hook. One and only one of the fields, except TCPSocket must be specified.","type":"object","properties":{"exec":{"description":"Exec specifies the action to take.","$ref":"#/components/schemas/io.k8s.api.core.v1.ExecAction"},"httpGet":{"description":"HTTPGet specifies the http request to perform.","$ref":"#/components/schemas/io.k8s.api.core.v1.HTTPGetAction"},"tcpSocket":{"description":"Deprecated. TCPSocket is NOT supported as a LifecycleHandler and kept for the backward compatibility. There are no validation of this field and lifecycle hooks will fail in runtime when tcp handler is specified.","$ref":"#/components/schemas/io.k8s.api.core.v1.TCPSocketAction"}}},"io.k8s.api.core.v1.LocalObjectReference":{"description":"LocalObjectReference contains enough information to let you locate the referenced object inside the same namespace.","type":"object","properties":{"name":{"description":"Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names","type":"string"}},"x-kubernetes-map-type":"atomic"},"io.k8s.api.core.v1.NFSVolumeSource":{"description":"Represents an NFS mount that lasts the lifetime of a pod. NFS volumes do not support ownership management or SELinux relabeling.","type":"object","required":["server","path"],"properties":{"path":{"description":"path that is exported by the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs","type":"string","default":""},"readOnly":{"description":"readOnly here will force the NFS export to be mounted with read-only permissions. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs","type":"boolean"},"server":{"description":"server is the hostname or IP address of the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs","type":"string","default":""}}},"io.k8s.api.core.v1.NodeAffinity":{"description":"Node affinity is a group of node affinity scheduling rules.","type":"object","properties":{"preferredDuringSchedulingIgnoredDuringExecution":{"description":"The scheduler will prefer to schedule pods to nodes that satisfy the affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding \"weight\" to the sum if the node matches the corresponding matchExpressions; the node(s) with the highest sum are the most preferred.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.PreferredSchedulingTerm"}},"requiredDuringSchedulingIgnoredDuringExecution":{"description":"If the affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to an update), the system may or may not try to eventually evict the pod from its node.","$ref":"#/components/schemas/io.k8s.api.core.v1.NodeSelector"}}},"io.k8s.api.core.v1.NodeSelector":{"description":"A node selector represents the union of the results of one or more label queries over a set of nodes; that is, it represents the OR of the selectors represented by the node selector terms.","type":"object","required":["nodeSelectorTerms"],"properties":{"nodeSelectorTerms":{"description":"Required. A list of node selector terms. The terms are ORed.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.NodeSelectorTerm"}}},"x-kubernetes-map-type":"atomic"},"io.k8s.api.core.v1.NodeSelectorRequirement":{"description":"A node selector requirement is a selector that contains values, a key, and an operator that relates the key and values.","type":"object","required":["key","operator"],"properties":{"key":{"description":"The label key that the selector applies to.","type":"string","default":""},"operator":{"description":"Represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.\n\n","type":"string","default":""},"values":{"description":"An array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. If the operator is Gt or Lt, the values array must have a single element, which will be interpreted as an integer. This array is replaced during a strategic merge patch.","type":"array","items":{"type":"string","default":""}}}},"io.k8s.api.core.v1.NodeSelectorTerm":{"description":"A null or empty node selector term matches no objects. The requirements of them are ANDed. The TopologySelectorTerm type implements a subset of the NodeSelectorTerm.","type":"object","properties":{"matchExpressions":{"description":"A list of node selector requirements by node's labels.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.NodeSelectorRequirement"}},"matchFields":{"description":"A list of node selector requirements by node's fields.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.NodeSelectorRequirement"}}},"x-kubernetes-map-type":"atomic"},"io.k8s.api.core.v1.ObjectFieldSelector":{"description":"ObjectFieldSelector selects an APIVersioned field of an object.","type":"object","required":["fieldPath"],"properties":{"apiVersion":{"description":"Version of the schema the FieldPath is written in terms of, defaults to \"v1\".","type":"string"},"fieldPath":{"description":"Path of the field to select in the specified API version.","type":"string","default":""}},"x-kubernetes-map-type":"atomic"},"io.k8s.api.core.v1.ObjectReference":{"description":"ObjectReference contains enough information to let you inspect or modify the referred object.","type":"object","properties":{"apiVersion":{"description":"API version of the referent.","type":"string"},"fieldPath":{"description":"If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: \"spec.containers{name}\" (where \"name\" refers to the name of the container that triggered the event) or if no container name is specified \"spec.containers[2]\" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object.","type":"string"},"kind":{"description":"Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds","type":"string"},"name":{"description":"Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names","type":"string"},"namespace":{"description":"Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/","type":"string"},"resourceVersion":{"description":"Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency","type":"string"},"uid":{"description":"UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids","type":"string"}},"x-kubernetes-map-type":"atomic"},"io.k8s.api.core.v1.PersistentVolumeClaimSpec":{"description":"PersistentVolumeClaimSpec describes the common attributes of storage devices and allows a Source for provider-specific attributes","type":"object","properties":{"accessModes":{"description":"accessModes contains the desired access modes the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1","type":"array","items":{"type":"string","default":""}},"dataSource":{"description":"dataSource field can be used to specify either: * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot) * An existing PVC (PersistentVolumeClaim) If the provisioner or an external controller can support the specified data source, it will create a new volume based on the contents of the specified data source. If the AnyVolumeDataSource feature gate is enabled, this field will always have the same contents as the DataSourceRef field.","$ref":"#/components/schemas/io.k8s.api.core.v1.TypedLocalObjectReference"},"dataSourceRef":{"description":"dataSourceRef specifies the object from which to populate the volume with data, if a non-empty volume is desired. This may be any local object from a non-empty API group (non core object) or a PersistentVolumeClaim object. When this field is specified, volume binding will only succeed if the type of the specified object matches some installed volume populator or dynamic provisioner. This field will replace the functionality of the DataSource field and as such if both fields are non-empty, they must have the same value. For backwards compatibility, both fields (DataSource and DataSourceRef) will be set to the same value automatically if one of them is empty and the other is non-empty. There are two important differences between DataSource and DataSourceRef: * While DataSource only allows two specific types of objects, DataSourceRef\n allows any non-core object, as well as PersistentVolumeClaim objects.\n* While DataSource ignores disallowed values (dropping them), DataSourceRef\n preserves all values, and generates an error if a disallowed value is\n specified.\n(Alpha) Using this field requires the AnyVolumeDataSource feature gate to be enabled.","$ref":"#/components/schemas/io.k8s.api.core.v1.TypedLocalObjectReference"},"resources":{"description":"resources represents the minimum resources the volume should have. If RecoverVolumeExpansionFailure feature is enabled users are allowed to specify resource requirements that are lower than previous value but must still be higher than capacity recorded in the status field of the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources","default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.ResourceRequirements"},"selector":{"description":"selector is a label query over volumes to consider for binding.","$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector"},"storageClassName":{"description":"storageClassName is the name of the StorageClass required by the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1","type":"string"},"volumeMode":{"description":"volumeMode defines what type of volume is required by the claim. Value of Filesystem is implied when not included in claim spec.","type":"string"},"volumeName":{"description":"volumeName is the binding reference to the PersistentVolume backing this claim.","type":"string"}}},"io.k8s.api.core.v1.PersistentVolumeClaimTemplate":{"description":"PersistentVolumeClaimTemplate is used to produce PersistentVolumeClaim objects as part of an EphemeralVolumeSource.","type":"object","required":["spec"],"properties":{"metadata":{"description":"May contain labels and annotations that will be copied into the PVC when creating it. No other fields are allowed and will be rejected during validation.","default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"},"spec":{"description":"The specification for the PersistentVolumeClaim. The entire content is copied unchanged into the PVC that gets created from this template. The same fields as in a PersistentVolumeClaim are also valid here.","default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaimSpec"}}},"io.k8s.api.core.v1.PersistentVolumeClaimVolumeSource":{"description":"PersistentVolumeClaimVolumeSource references the user's PVC in the same namespace. This volume finds the bound PV and mounts that volume for the pod. A PersistentVolumeClaimVolumeSource is, essentially, a wrapper around another type of volume that is owned by someone else (the system).","type":"object","required":["claimName"],"properties":{"claimName":{"description":"claimName is the name of a PersistentVolumeClaim in the same namespace as the pod using this volume. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims","type":"string","default":""},"readOnly":{"description":"readOnly Will force the ReadOnly setting in VolumeMounts. Default false.","type":"boolean"}}},"io.k8s.api.core.v1.PhotonPersistentDiskVolumeSource":{"description":"Represents a Photon Controller persistent disk resource.","type":"object","required":["pdID"],"properties":{"fsType":{"description":"fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.","type":"string"},"pdID":{"description":"pdID is the ID that identifies Photon Controller persistent disk","type":"string","default":""}}},"io.k8s.api.core.v1.PodAffinity":{"description":"Pod affinity is a group of inter pod affinity scheduling rules.","type":"object","properties":{"preferredDuringSchedulingIgnoredDuringExecution":{"description":"The scheduler will prefer to schedule pods to nodes that satisfy the affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding \"weight\" to the sum if the node has pods which matches the corresponding podAffinityTerm; the node(s) with the highest sum are the most preferred.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.WeightedPodAffinityTerm"}},"requiredDuringSchedulingIgnoredDuringExecution":{"description":"If the affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to a pod label update), the system may or may not try to eventually evict the pod from its node. When there are multiple elements, the lists of nodes corresponding to each podAffinityTerm are intersected, i.e. all terms must be satisfied.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.PodAffinityTerm"}}}},"io.k8s.api.core.v1.PodAffinityTerm":{"description":"Defines a set of pods (namely those matching the labelSelector relative to the given namespace(s)) that this pod should be co-located (affinity) or not co-located (anti-affinity) with, where co-located is defined as running on a node whose value of the label with key \u003ctopologyKey\u003e matches that of any node on which a pod of the set of pods is running","type":"object","required":["topologyKey"],"properties":{"labelSelector":{"description":"A label query over a set of resources, in this case pods.","$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector"},"namespaceSelector":{"description":"A label query over the set of namespaces that the term applies to. The term is applied to the union of the namespaces selected by this field and the ones listed in the namespaces field. null selector and null or empty namespaces list means \"this pod's namespace\". An empty selector ({}) matches all namespaces. This field is beta-level and is only honored when PodAffinityNamespaceSelector feature is enabled.","$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector"},"namespaces":{"description":"namespaces specifies a static list of namespace names that the term applies to. The term is applied to the union of the namespaces listed in this field and the ones selected by namespaceSelector. null or empty namespaces list and null namespaceSelector means \"this pod's namespace\"","type":"array","items":{"type":"string","default":""}},"topologyKey":{"description":"This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching the labelSelector in the specified namespaces, where co-located is defined as running on a node whose value of the label with key topologyKey matches that of any node on which any of the selected pods is running. Empty topologyKey is not allowed.","type":"string","default":""}}},"io.k8s.api.core.v1.PodAntiAffinity":{"description":"Pod anti affinity is a group of inter pod anti affinity scheduling rules.","type":"object","properties":{"preferredDuringSchedulingIgnoredDuringExecution":{"description":"The scheduler will prefer to schedule pods to nodes that satisfy the anti-affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling anti-affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding \"weight\" to the sum if the node has pods which matches the corresponding podAffinityTerm; the node(s) with the highest sum are the most preferred.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.WeightedPodAffinityTerm"}},"requiredDuringSchedulingIgnoredDuringExecution":{"description":"If the anti-affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the anti-affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to a pod label update), the system may or may not try to eventually evict the pod from its node. When there are multiple elements, the lists of nodes corresponding to each podAffinityTerm are intersected, i.e. all terms must be satisfied.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.PodAffinityTerm"}}}},"io.k8s.api.core.v1.PodDNSConfig":{"description":"PodDNSConfig defines the DNS parameters of a pod in addition to those generated from DNSPolicy.","type":"object","properties":{"nameservers":{"description":"A list of DNS name server IP addresses. This will be appended to the base nameservers generated from DNSPolicy. Duplicated nameservers will be removed.","type":"array","items":{"type":"string","default":""}},"options":{"description":"A list of DNS resolver options. This will be merged with the base options generated from DNSPolicy. Duplicated entries will be removed. Resolution options given in Options will override those that appear in the base DNSPolicy.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.PodDNSConfigOption"}},"searches":{"description":"A list of DNS search domains for host-name lookup. This will be appended to the base search paths generated from DNSPolicy. Duplicated search paths will be removed.","type":"array","items":{"type":"string","default":""}}}},"io.k8s.api.core.v1.PodDNSConfigOption":{"description":"PodDNSConfigOption defines DNS resolver options of a pod.","type":"object","properties":{"name":{"description":"Required.","type":"string"},"value":{"type":"string"}}},"io.k8s.api.core.v1.PodOS":{"description":"PodOS defines the OS parameters of a pod.","type":"object","required":["name"],"properties":{"name":{"description":"Name is the name of the operating system. The currently supported values are linux and windows. Additional value may be defined in future and can be one of: https://github.com/opencontainers/runtime-spec/blob/master/config.md#platform-specific-configuration Clients should expect to handle additional values and treat unrecognized values in this field as os: null","type":"string","default":""}}},"io.k8s.api.core.v1.PodReadinessGate":{"description":"PodReadinessGate contains the reference to a pod condition","type":"object","required":["conditionType"],"properties":{"conditionType":{"description":"ConditionType refers to a condition in the pod's condition list with matching type.\n\n","type":"string","default":""}}},"io.k8s.api.core.v1.PodSecurityContext":{"description":"PodSecurityContext holds pod-level security attributes and common container settings. Some fields are also present in container.securityContext. Field values of container.securityContext take precedence over field values of PodSecurityContext.","type":"object","properties":{"fsGroup":{"description":"A special supplemental group that applies to all containers in a pod. Some volume types allow the Kubelet to change the ownership of that volume to be owned by the pod:\n\n1. The owning GID will be the FSGroup 2. The setgid bit is set (new files created in the volume will be owned by FSGroup) 3. The permission bits are OR'd with rw-rw----\n\nIf unset, the Kubelet will not modify the ownership and permissions of any volume. Note that this field cannot be set when spec.os.name is windows.","type":"integer","format":"int64"},"fsGroupChangePolicy":{"description":"fsGroupChangePolicy defines behavior of changing ownership and permission of the volume before being exposed inside Pod. This field will only apply to volume types which support fsGroup based ownership(and permissions). It will have no effect on ephemeral volume types such as: secret, configmaps and emptydir. Valid values are \"OnRootMismatch\" and \"Always\". If not specified, \"Always\" is used. Note that this field cannot be set when spec.os.name is windows.","type":"string"},"runAsGroup":{"description":"The GID to run the entrypoint of the container process. Uses runtime default if unset. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container. Note that this field cannot be set when spec.os.name is windows.","type":"integer","format":"int64"},"runAsNonRoot":{"description":"Indicates that the container must run as a non-root user. If true, the Kubelet will validate the image at runtime to ensure that it does not run as UID 0 (root) and fail to start the container if it does. If unset or false, no such validation will be performed. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.","type":"boolean"},"runAsUser":{"description":"The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container. Note that this field cannot be set when spec.os.name is windows.","type":"integer","format":"int64"},"seLinuxOptions":{"description":"The SELinux context to be applied to all containers. If unspecified, the container runtime will allocate a random SELinux context for each container. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container. Note that this field cannot be set when spec.os.name is windows.","$ref":"#/components/schemas/io.k8s.api.core.v1.SELinuxOptions"},"seccompProfile":{"description":"The seccomp options to use by the containers in this pod. Note that this field cannot be set when spec.os.name is windows.","$ref":"#/components/schemas/io.k8s.api.core.v1.SeccompProfile"},"supplementalGroups":{"description":"A list of groups applied to the first process run in each container, in addition to the container's primary GID. If unspecified, no groups will be added to any container. Note that this field cannot be set when spec.os.name is windows.","type":"array","items":{"type":"integer","format":"int64","default":0}},"sysctls":{"description":"Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported sysctls (by the container runtime) might fail to launch. Note that this field cannot be set when spec.os.name is windows.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.Sysctl"}},"windowsOptions":{"description":"The Windows specific settings applied to all containers. If unspecified, the options within a container's SecurityContext will be used. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. Note that this field cannot be set when spec.os.name is linux.","$ref":"#/components/schemas/io.k8s.api.core.v1.WindowsSecurityContextOptions"}}},"io.k8s.api.core.v1.PodSpec":{"description":"PodSpec is a description of a pod.","type":"object","required":["containers"],"properties":{"activeDeadlineSeconds":{"description":"Optional duration in seconds the pod may be active on the node relative to StartTime before the system will actively try to mark it failed and kill associated containers. Value must be a positive integer.","type":"integer","format":"int64"},"affinity":{"description":"If specified, the pod's scheduling constraints","$ref":"#/components/schemas/io.k8s.api.core.v1.Affinity"},"automountServiceAccountToken":{"description":"AutomountServiceAccountToken indicates whether a service account token should be automatically mounted.","type":"boolean"},"containers":{"description":"List of containers belonging to the pod. Containers cannot currently be added or removed. There must be at least one container in a Pod. Cannot be updated.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.Container"},"x-kubernetes-patch-merge-key":"name","x-kubernetes-patch-strategy":"merge"},"dnsConfig":{"description":"Specifies the DNS parameters of a pod. Parameters specified here will be merged to the generated DNS configuration based on DNSPolicy.","$ref":"#/components/schemas/io.k8s.api.core.v1.PodDNSConfig"},"dnsPolicy":{"description":"Set DNS policy for the pod. Defaults to \"ClusterFirst\". Valid values are 'ClusterFirstWithHostNet', 'ClusterFirst', 'Default' or 'None'. DNS parameters given in DNSConfig will be merged with the policy selected with DNSPolicy. To have DNS options set along with hostNetwork, you have to specify DNS policy explicitly to 'ClusterFirstWithHostNet'.\n\n","type":"string"},"enableServiceLinks":{"description":"EnableServiceLinks indicates whether information about services should be injected into pod's environment variables, matching the syntax of Docker links. Optional: Defaults to true.","type":"boolean"},"ephemeralContainers":{"description":"List of ephemeral containers run in this pod. Ephemeral containers may be run in an existing pod to perform user-initiated actions such as debugging. This list cannot be specified when creating a pod, and it cannot be modified by updating the pod spec. In order to add an ephemeral container to an existing pod, use the pod's ephemeralcontainers subresource.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.EphemeralContainer"},"x-kubernetes-patch-merge-key":"name","x-kubernetes-patch-strategy":"merge"},"hostAliases":{"description":"HostAliases is an optional list of hosts and IPs that will be injected into the pod's hosts file if specified. This is only valid for non-hostNetwork pods.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.HostAlias"},"x-kubernetes-patch-merge-key":"ip","x-kubernetes-patch-strategy":"merge"},"hostIPC":{"description":"Use the host's ipc namespace. Optional: Default to false.","type":"boolean"},"hostNetwork":{"description":"Host networking requested for this pod. Use the host's network namespace. If this option is set, the ports that will be used must be specified. Default to false.","type":"boolean"},"hostPID":{"description":"Use the host's pid namespace. Optional: Default to false.","type":"boolean"},"hostname":{"description":"Specifies the hostname of the Pod If not specified, the pod's hostname will be set to a system-defined value.","type":"string"},"imagePullSecrets":{"description":"ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this PodSpec. If specified, these secrets will be passed to individual puller implementations for them to use. For example, in the case of docker, only DockerConfig type secrets are honored. More info: https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.LocalObjectReference"},"x-kubernetes-patch-merge-key":"name","x-kubernetes-patch-strategy":"merge"},"initContainers":{"description":"List of initialization containers belonging to the pod. Init containers are executed in order prior to containers being started. If any init container fails, the pod is considered to have failed and is handled according to its restartPolicy. The name for an init container or normal container must be unique among all containers. Init containers may not have Lifecycle actions, Readiness probes, Liveness probes, or Startup probes. The resourceRequirements of an init container are taken into account during scheduling by finding the highest request/limit for each resource type, and then using the max of of that value or the sum of the normal containers. Limits are applied to init containers in a similar fashion. Init containers cannot currently be added or removed. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.Container"},"x-kubernetes-patch-merge-key":"name","x-kubernetes-patch-strategy":"merge"},"nodeName":{"description":"NodeName is a request to schedule this pod onto a specific node. If it is non-empty, the scheduler simply schedules this pod onto that node, assuming that it fits resource requirements.","type":"string"},"nodeSelector":{"description":"NodeSelector is a selector which must be true for the pod to fit on a node. Selector which must match a node's labels for the pod to be scheduled on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/","type":"object","additionalProperties":{"type":"string","default":""},"x-kubernetes-map-type":"atomic"},"os":{"description":"Specifies the OS of the containers in the pod. Some pod and container fields are restricted if this is set.\n\nIf the OS field is set to linux, the following fields must be unset: -securityContext.windowsOptions\n\nIf the OS field is set to windows, following fields must be unset: - spec.hostPID - spec.hostIPC - spec.securityContext.seLinuxOptions - spec.securityContext.seccompProfile - spec.securityContext.fsGroup - spec.securityContext.fsGroupChangePolicy - spec.securityContext.sysctls - spec.shareProcessNamespace - spec.securityContext.runAsUser - spec.securityContext.runAsGroup - spec.securityContext.supplementalGroups - spec.containers[*].securityContext.seLinuxOptions - spec.containers[*].securityContext.seccompProfile - spec.containers[*].securityContext.capabilities - spec.containers[*].securityContext.readOnlyRootFilesystem - spec.containers[*].securityContext.privileged - spec.containers[*].securityContext.allowPrivilegeEscalation - spec.containers[*].securityContext.procMount - spec.containers[*].securityContext.runAsUser - spec.containers[*].securityContext.runAsGroup This is an alpha field and requires the IdentifyPodOS feature","$ref":"#/components/schemas/io.k8s.api.core.v1.PodOS"},"overhead":{"description":"Overhead represents the resource overhead associated with running a pod for a given RuntimeClass. This field will be autopopulated at admission time by the RuntimeClass admission controller. If the RuntimeClass admission controller is enabled, overhead must not be set in Pod create requests. The RuntimeClass admission controller will reject Pod create requests which have the overhead already set. If RuntimeClass is configured and selected in the PodSpec, Overhead will be set to the value defined in the corresponding RuntimeClass, otherwise it will remain unset and treated as zero. More info: https://git.k8s.io/enhancements/keps/sig-node/688-pod-overhead/README.md This field is beta-level as of Kubernetes v1.18, and is only honored by servers that enable the PodOverhead feature.","type":"object","additionalProperties":{"default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.api.resource.Quantity"}},"preemptionPolicy":{"description":"PreemptionPolicy is the Policy for preempting pods with lower priority. One of Never, PreemptLowerPriority. Defaults to PreemptLowerPriority if unset.","type":"string"},"priority":{"description":"The priority value. Various system components use this field to find the priority of the pod. When Priority Admission Controller is enabled, it prevents users from setting this field. The admission controller populates this field from PriorityClassName. The higher the value, the higher the priority.","type":"integer","format":"int32"},"priorityClassName":{"description":"If specified, indicates the pod's priority. \"system-node-critical\" and \"system-cluster-critical\" are two special keywords which indicate the highest priorities with the former being the highest priority. Any other name must be defined by creating a PriorityClass object with that name. If not specified, the pod priority will be default or zero if there is no default.","type":"string"},"readinessGates":{"description":"If specified, all readiness gates will be evaluated for pod readiness. A pod is ready when all its containers are ready AND all conditions specified in the readiness gates have status equal to \"True\" More info: https://git.k8s.io/enhancements/keps/sig-network/580-pod-readiness-gates","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.PodReadinessGate"}},"restartPolicy":{"description":"Restart policy for all containers within the pod. One of Always, OnFailure, Never. Default to Always. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy\n\n","type":"string"},"runtimeClassName":{"description":"RuntimeClassName refers to a RuntimeClass object in the node.k8s.io group, which should be used to run this pod. If no RuntimeClass resource matches the named class, the pod will not be run. If unset or empty, the \"legacy\" RuntimeClass will be used, which is an implicit class with an empty definition that uses the default runtime handler. More info: https://git.k8s.io/enhancements/keps/sig-node/585-runtime-class This is a beta feature as of Kubernetes v1.14.","type":"string"},"schedulerName":{"description":"If specified, the pod will be dispatched by specified scheduler. If not specified, the pod will be dispatched by default scheduler.","type":"string"},"securityContext":{"description":"SecurityContext holds pod-level security attributes and common container settings. Optional: Defaults to empty. See type description for default values of each field.","$ref":"#/components/schemas/io.k8s.api.core.v1.PodSecurityContext"},"serviceAccount":{"description":"DeprecatedServiceAccount is a depreciated alias for ServiceAccountName. Deprecated: Use serviceAccountName instead.","type":"string"},"serviceAccountName":{"description":"ServiceAccountName is the name of the ServiceAccount to use to run this pod. More info: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/","type":"string"},"setHostnameAsFQDN":{"description":"If true the pod's hostname will be configured as the pod's FQDN, rather than the leaf name (the default). In Linux containers, this means setting the FQDN in the hostname field of the kernel (the nodename field of struct utsname). In Windows containers, this means setting the registry value of hostname for the registry key HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters to FQDN. If a pod does not have FQDN, this has no effect. Default to false.","type":"boolean"},"shareProcessNamespace":{"description":"Share a single process namespace between all of the containers in a pod. When this is set containers will be able to view and signal processes from other containers in the same pod, and the first process in each container will not be assigned PID 1. HostPID and ShareProcessNamespace cannot both be set. Optional: Default to false.","type":"boolean"},"subdomain":{"description":"If specified, the fully qualified Pod hostname will be \"\u003chostname\u003e.\u003csubdomain\u003e.\u003cpod namespace\u003e.svc.\u003ccluster domain\u003e\". If not specified, the pod will not have a domainname at all.","type":"string"},"terminationGracePeriodSeconds":{"description":"Optional duration in seconds the pod needs to terminate gracefully. May be decreased in delete request. Value must be non-negative integer. The value zero indicates stop immediately via the kill signal (no opportunity to shut down). If this value is nil, the default grace period will be used instead. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. Defaults to 30 seconds.","type":"integer","format":"int64"},"tolerations":{"description":"If specified, the pod's tolerations.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.Toleration"}},"topologySpreadConstraints":{"description":"TopologySpreadConstraints describes how a group of pods ought to spread across topology domains. Scheduler will schedule pods in a way which abides by the constraints. All topologySpreadConstraints are ANDed.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.TopologySpreadConstraint"},"x-kubernetes-list-map-keys":["topologyKey","whenUnsatisfiable"],"x-kubernetes-list-type":"map","x-kubernetes-patch-merge-key":"topologyKey","x-kubernetes-patch-strategy":"merge"},"volumes":{"description":"List of volumes that can be mounted by containers belonging to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.Volume"},"x-kubernetes-patch-merge-key":"name","x-kubernetes-patch-strategy":"merge,retainKeys"}}},"io.k8s.api.core.v1.PodTemplateSpec":{"description":"PodTemplateSpec describes the data a pod should have when created from a template","type":"object","properties":{"metadata":{"description":"Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata","default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"},"spec":{"description":"Specification of the desired behavior of the pod. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status","default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.PodSpec"}}},"io.k8s.api.core.v1.PortworxVolumeSource":{"description":"PortworxVolumeSource represents a Portworx volume resource.","type":"object","required":["volumeID"],"properties":{"fsType":{"description":"fSType represents the filesystem type to mount Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\". Implicitly inferred to be \"ext4\" if unspecified.","type":"string"},"readOnly":{"description":"readOnly defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.","type":"boolean"},"volumeID":{"description":"volumeID uniquely identifies a Portworx volume","type":"string","default":""}}},"io.k8s.api.core.v1.PreferredSchedulingTerm":{"description":"An empty preferred scheduling term matches all objects with implicit weight 0 (i.e. it's a no-op). A null preferred scheduling term matches no objects (i.e. is also a no-op).","type":"object","required":["weight","preference"],"properties":{"preference":{"description":"A node selector term, associated with the corresponding weight.","default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.NodeSelectorTerm"},"weight":{"description":"Weight associated with matching the corresponding nodeSelectorTerm, in the range 1-100.","type":"integer","format":"int32","default":0}}},"io.k8s.api.core.v1.Probe":{"description":"Probe describes a health check to be performed against a container to determine whether it is alive or ready to receive traffic.","type":"object","properties":{"exec":{"description":"Exec specifies the action to take.","$ref":"#/components/schemas/io.k8s.api.core.v1.ExecAction"},"failureThreshold":{"description":"Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1.","type":"integer","format":"int32"},"grpc":{"description":"GRPC specifies an action involving a GRPC port.","$ref":"#/components/schemas/io.k8s.api.core.v1.GRPCAction"},"httpGet":{"description":"HTTPGet specifies the http request to perform.","$ref":"#/components/schemas/io.k8s.api.core.v1.HTTPGetAction"},"initialDelaySeconds":{"description":"Number of seconds after the container has started before liveness probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes","type":"integer","format":"int32"},"periodSeconds":{"description":"How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1.","type":"integer","format":"int32"},"successThreshold":{"description":"Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1.","type":"integer","format":"int32"},"tcpSocket":{"description":"TCPSocket specifies an action involving a TCP port.","$ref":"#/components/schemas/io.k8s.api.core.v1.TCPSocketAction"},"terminationGracePeriodSeconds":{"description":"Optional duration in seconds the pod needs to terminate gracefully upon probe failure. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this value overrides the value provided by the pod spec. Value must be non-negative integer. The value zero indicates stop immediately via the kill signal (no opportunity to shut down). This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate. Minimum value is 1. spec.terminationGracePeriodSeconds is used if unset.","type":"integer","format":"int64"},"timeoutSeconds":{"description":"Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes","type":"integer","format":"int32"}}},"io.k8s.api.core.v1.ProjectedVolumeSource":{"description":"Represents a projected volume source","type":"object","properties":{"defaultMode":{"description":"defaultMode are the mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.","type":"integer","format":"int32"},"sources":{"description":"sources is the list of volume projections","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.VolumeProjection"}}}},"io.k8s.api.core.v1.QuobyteVolumeSource":{"description":"Represents a Quobyte mount that lasts the lifetime of a pod. Quobyte volumes do not support ownership management or SELinux relabeling.","type":"object","required":["registry","volume"],"properties":{"group":{"description":"group to map volume access to Default is no group","type":"string"},"readOnly":{"description":"readOnly here will force the Quobyte volume to be mounted with read-only permissions. Defaults to false.","type":"boolean"},"registry":{"description":"registry represents a single or multiple Quobyte Registry services specified as a string as host:port pair (multiple entries are separated with commas) which acts as the central registry for volumes","type":"string","default":""},"tenant":{"description":"tenant owning the given Quobyte volume in the Backend Used with dynamically provisioned Quobyte volumes, value is set by the plugin","type":"string"},"user":{"description":"user to map volume access to Defaults to serivceaccount user","type":"string"},"volume":{"description":"volume is a string that references an already created Quobyte volume by name.","type":"string","default":""}}},"io.k8s.api.core.v1.RBDVolumeSource":{"description":"Represents a Rados Block Device mount that lasts the lifetime of a pod. RBD volumes support ownership management and SELinux relabeling.","type":"object","required":["monitors","image"],"properties":{"fsType":{"description":"fsType is the filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#rbd","type":"string"},"image":{"description":"image is the rados image name. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it","type":"string","default":""},"keyring":{"description":"keyring is the path to key ring for RBDUser. Default is /etc/ceph/keyring. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it","type":"string"},"monitors":{"description":"monitors is a collection of Ceph monitors. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it","type":"array","items":{"type":"string","default":""}},"pool":{"description":"pool is the rados pool name. Default is rbd. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it","type":"string"},"readOnly":{"description":"readOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it","type":"boolean"},"secretRef":{"description":"secretRef is name of the authentication secret for RBDUser. If provided overrides keyring. Default is nil. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it","$ref":"#/components/schemas/io.k8s.api.core.v1.LocalObjectReference"},"user":{"description":"user is the rados user name. Default is admin. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it","type":"string"}}},"io.k8s.api.core.v1.ResourceFieldSelector":{"description":"ResourceFieldSelector represents container resources (cpu, memory) and their output format","type":"object","required":["resource"],"properties":{"containerName":{"description":"Container name: required for volumes, optional for env vars","type":"string"},"divisor":{"description":"Specifies the output format of the exposed resources, defaults to \"1\"","default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.api.resource.Quantity"},"resource":{"description":"Required: resource to select","type":"string","default":""}},"x-kubernetes-map-type":"atomic"},"io.k8s.api.core.v1.ResourceRequirements":{"description":"ResourceRequirements describes the compute resource requirements.","type":"object","properties":{"limits":{"description":"Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/","type":"object","additionalProperties":{"default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.api.resource.Quantity"}},"requests":{"description":"Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/","type":"object","additionalProperties":{"default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.api.resource.Quantity"}}}},"io.k8s.api.core.v1.SELinuxOptions":{"description":"SELinuxOptions are the labels to be applied to the container","type":"object","properties":{"level":{"description":"Level is SELinux level label that applies to the container.","type":"string"},"role":{"description":"Role is a SELinux role label that applies to the container.","type":"string"},"type":{"description":"Type is a SELinux type label that applies to the container.","type":"string"},"user":{"description":"User is a SELinux user label that applies to the container.","type":"string"}}},"io.k8s.api.core.v1.ScaleIOVolumeSource":{"description":"ScaleIOVolumeSource represents a persistent ScaleIO volume","type":"object","required":["gateway","system","secretRef"],"properties":{"fsType":{"description":"fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Default is \"xfs\".","type":"string"},"gateway":{"description":"gateway is the host address of the ScaleIO API Gateway.","type":"string","default":""},"protectionDomain":{"description":"protectionDomain is the name of the ScaleIO Protection Domain for the configured storage.","type":"string"},"readOnly":{"description":"readOnly Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.","type":"boolean"},"secretRef":{"description":"secretRef references to the secret for ScaleIO user and other sensitive information. If this is not provided, Login operation will fail.","$ref":"#/components/schemas/io.k8s.api.core.v1.LocalObjectReference"},"sslEnabled":{"description":"sslEnabled Flag enable/disable SSL communication with Gateway, default false","type":"boolean"},"storageMode":{"description":"storageMode indicates whether the storage for a volume should be ThickProvisioned or ThinProvisioned. Default is ThinProvisioned.","type":"string"},"storagePool":{"description":"storagePool is the ScaleIO Storage Pool associated with the protection domain.","type":"string"},"system":{"description":"system is the name of the storage system as configured in ScaleIO.","type":"string","default":""},"volumeName":{"description":"volumeName is the name of a volume already created in the ScaleIO system that is associated with this volume source.","type":"string"}}},"io.k8s.api.core.v1.SeccompProfile":{"description":"SeccompProfile defines a pod/container's seccomp profile settings. Only one profile source may be set.","type":"object","required":["type"],"properties":{"localhostProfile":{"description":"localhostProfile indicates a profile defined in a file on the node should be used. The profile must be preconfigured on the node to work. Must be a descending path, relative to the kubelet's configured seccomp profile location. Must only be set if type is \"Localhost\".","type":"string"},"type":{"description":"type indicates which kind of seccomp profile will be applied. Valid options are:\n\nLocalhost - a profile defined in a file on the node should be used. RuntimeDefault - the container runtime default profile should be used. Unconfined - no profile should be applied.\n\n","type":"string","default":""}},"x-kubernetes-unions":[{"discriminator":"type","fields-to-discriminateBy":{"localhostProfile":"LocalhostProfile"}}]},"io.k8s.api.core.v1.SecretEnvSource":{"description":"SecretEnvSource selects a Secret to populate the environment variables with.\n\nThe contents of the target Secret's Data field will represent the key-value pairs as environment variables.","type":"object","properties":{"name":{"description":"Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names","type":"string"},"optional":{"description":"Specify whether the Secret must be defined","type":"boolean"}}},"io.k8s.api.core.v1.SecretKeySelector":{"description":"SecretKeySelector selects a key of a Secret.","type":"object","required":["key"],"properties":{"key":{"description":"The key of the secret to select from. Must be a valid secret key.","type":"string","default":""},"name":{"description":"Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names","type":"string"},"optional":{"description":"Specify whether the Secret or its key must be defined","type":"boolean"}},"x-kubernetes-map-type":"atomic"},"io.k8s.api.core.v1.SecretProjection":{"description":"Adapts a secret into a projected volume.\n\nThe contents of the target Secret's Data field will be presented in a projected volume as files using the keys in the Data field as the file names. Note that this is identical to a secret volume source without the default mode.","type":"object","properties":{"items":{"description":"items if unspecified, each key-value pair in the Data field of the referenced Secret will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the Secret, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.KeyToPath"}},"name":{"description":"Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names","type":"string"},"optional":{"description":"optional field specify whether the Secret or its key must be defined","type":"boolean"}}},"io.k8s.api.core.v1.SecretVolumeSource":{"description":"Adapts a Secret into a volume.\n\nThe contents of the target Secret's Data field will be presented in a volume as files using the keys in the Data field as the file names. Secret volumes support ownership management and SELinux relabeling.","type":"object","properties":{"defaultMode":{"description":"defaultMode is Optional: mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.","type":"integer","format":"int32"},"items":{"description":"items If unspecified, each key-value pair in the Data field of the referenced Secret will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the Secret, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.KeyToPath"}},"optional":{"description":"optional field specify whether the Secret or its keys must be defined","type":"boolean"},"secretName":{"description":"secretName is the name of the secret in the pod's namespace to use. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret","type":"string"}}},"io.k8s.api.core.v1.SecurityContext":{"description":"SecurityContext holds security configuration that will be applied to a container. Some fields are present in both SecurityContext and PodSecurityContext. When both are set, the values in SecurityContext take precedence.","type":"object","properties":{"allowPrivilegeEscalation":{"description":"AllowPrivilegeEscalation controls whether a process can gain more privileges than its parent process. This bool directly controls if the no_new_privs flag will be set on the container process. AllowPrivilegeEscalation is true always when the container is: 1) run as Privileged 2) has CAP_SYS_ADMIN Note that this field cannot be set when spec.os.name is windows.","type":"boolean"},"capabilities":{"description":"The capabilities to add/drop when running containers. Defaults to the default set of capabilities granted by the container runtime. Note that this field cannot be set when spec.os.name is windows.","$ref":"#/components/schemas/io.k8s.api.core.v1.Capabilities"},"privileged":{"description":"Run container in privileged mode. Processes in privileged containers are essentially equivalent to root on the host. Defaults to false. Note that this field cannot be set when spec.os.name is windows.","type":"boolean"},"procMount":{"description":"procMount denotes the type of proc mount to use for the containers. The default is DefaultProcMount which uses the container runtime defaults for readonly paths and masked paths. This requires the ProcMountType feature flag to be enabled. Note that this field cannot be set when spec.os.name is windows.","type":"string"},"readOnlyRootFilesystem":{"description":"Whether this container has a read-only root filesystem. Default is false. Note that this field cannot be set when spec.os.name is windows.","type":"boolean"},"runAsGroup":{"description":"The GID to run the entrypoint of the container process. Uses runtime default if unset. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. Note that this field cannot be set when spec.os.name is windows.","type":"integer","format":"int64"},"runAsNonRoot":{"description":"Indicates that the container must run as a non-root user. If true, the Kubelet will validate the image at runtime to ensure that it does not run as UID 0 (root) and fail to start the container if it does. If unset or false, no such validation will be performed. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.","type":"boolean"},"runAsUser":{"description":"The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. Note that this field cannot be set when spec.os.name is windows.","type":"integer","format":"int64"},"seLinuxOptions":{"description":"The SELinux context to be applied to the container. If unspecified, the container runtime will allocate a random SELinux context for each container. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. Note that this field cannot be set when spec.os.name is windows.","$ref":"#/components/schemas/io.k8s.api.core.v1.SELinuxOptions"},"seccompProfile":{"description":"The seccomp options to use by this container. If seccomp options are provided at both the pod \u0026 container level, the container options override the pod options. Note that this field cannot be set when spec.os.name is windows.","$ref":"#/components/schemas/io.k8s.api.core.v1.SeccompProfile"},"windowsOptions":{"description":"The Windows specific settings applied to all containers. If unspecified, the options from the PodSecurityContext will be used. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. Note that this field cannot be set when spec.os.name is linux.","$ref":"#/components/schemas/io.k8s.api.core.v1.WindowsSecurityContextOptions"}}},"io.k8s.api.core.v1.ServiceAccountTokenProjection":{"description":"ServiceAccountTokenProjection represents a projected service account token volume. This projection can be used to insert a service account token into the pods runtime filesystem for use against APIs (Kubernetes API Server or otherwise).","type":"object","required":["path"],"properties":{"audience":{"description":"audience is the intended audience of the token. A recipient of a token must identify itself with an identifier specified in the audience of the token, and otherwise should reject the token. The audience defaults to the identifier of the apiserver.","type":"string"},"expirationSeconds":{"description":"expirationSeconds is the requested duration of validity of the service account token. As the token approaches expiration, the kubelet volume plugin will proactively rotate the service account token. The kubelet will start trying to rotate the token if the token is older than 80 percent of its time to live or if the token is older than 24 hours.Defaults to 1 hour and must be at least 10 minutes.","type":"integer","format":"int64"},"path":{"description":"path is the path relative to the mount point of the file to project the token into.","type":"string","default":""}}},"io.k8s.api.core.v1.StorageOSVolumeSource":{"description":"Represents a StorageOS persistent volume resource.","type":"object","properties":{"fsType":{"description":"fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.","type":"string"},"readOnly":{"description":"readOnly defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.","type":"boolean"},"secretRef":{"description":"secretRef specifies the secret to use for obtaining the StorageOS API credentials. If not specified, default values will be attempted.","$ref":"#/components/schemas/io.k8s.api.core.v1.LocalObjectReference"},"volumeName":{"description":"volumeName is the human-readable name of the StorageOS volume. Volume names are only unique within a namespace.","type":"string"},"volumeNamespace":{"description":"volumeNamespace specifies the scope of the volume within StorageOS. If no namespace is specified then the Pod's namespace will be used. This allows the Kubernetes name scoping to be mirrored within StorageOS for tighter integration. Set VolumeName to any name to override the default behaviour. Set to \"default\" if you are not using namespaces within StorageOS. Namespaces that do not pre-exist within StorageOS will be created.","type":"string"}}},"io.k8s.api.core.v1.Sysctl":{"description":"Sysctl defines a kernel parameter to be set","type":"object","required":["name","value"],"properties":{"name":{"description":"Name of a property to set","type":"string","default":""},"value":{"description":"Value of a property to set","type":"string","default":""}}},"io.k8s.api.core.v1.TCPSocketAction":{"description":"TCPSocketAction describes an action based on opening a socket","type":"object","required":["port"],"properties":{"host":{"description":"Optional: Host name to connect to, defaults to the pod IP.","type":"string"},"port":{"description":"Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME.","default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.util.intstr.IntOrString"}}},"io.k8s.api.core.v1.Toleration":{"description":"The pod this Toleration is attached to tolerates any taint that matches the triple \u003ckey,value,effect\u003e using the matching operator \u003coperator\u003e.","type":"object","properties":{"effect":{"description":"Effect indicates the taint effect to match. Empty means match all taint effects. When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute.\n\n","type":"string"},"key":{"description":"Key is the taint key that the toleration applies to. Empty means match all taint keys. If the key is empty, operator must be Exists; this combination means to match all values and all keys.","type":"string"},"operator":{"description":"Operator represents a key's relationship to the value. Valid operators are Exists and Equal. Defaults to Equal. Exists is equivalent to wildcard for value, so that a pod can tolerate all taints of a particular category.\n\n","type":"string"},"tolerationSeconds":{"description":"TolerationSeconds represents the period of time the toleration (which must be of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default, it is not set, which means tolerate the taint forever (do not evict). Zero and negative values will be treated as 0 (evict immediately) by the system.","type":"integer","format":"int64"},"value":{"description":"Value is the taint value the toleration matches to. If the operator is Exists, the value should be empty, otherwise just a regular string.","type":"string"}}},"io.k8s.api.core.v1.TopologySpreadConstraint":{"description":"TopologySpreadConstraint specifies how to spread matching pods among the given topology.","type":"object","required":["maxSkew","topologyKey","whenUnsatisfiable"],"properties":{"labelSelector":{"description":"LabelSelector is used to find matching pods. Pods that match this label selector are counted to determine the number of pods in their corresponding topology domain.","$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector"},"maxSkew":{"description":"MaxSkew describes the degree to which pods may be unevenly distributed. When `whenUnsatisfiable=DoNotSchedule`, it is the maximum permitted difference between the number of matching pods in the target topology and the global minimum. For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same labelSelector spread as 1/1/0: | zone1 | zone2 | zone3 | | P | P | | - if MaxSkew is 1, incoming pod can only be scheduled to zone3 to become 1/1/1; scheduling it onto zone1(zone2) would make the ActualSkew(2-0) on zone1(zone2) violate MaxSkew(1). - if MaxSkew is 2, incoming pod can be scheduled onto any zone. When `whenUnsatisfiable=ScheduleAnyway`, it is used to give higher precedence to topologies that satisfy it. It's a required field. Default value is 1 and 0 is not allowed.","type":"integer","format":"int32","default":0},"topologyKey":{"description":"TopologyKey is the key of node labels. Nodes that have a label with this key and identical values are considered to be in the same topology. We consider each \u003ckey, value\u003e as a \"bucket\", and try to put balanced number of pods into each bucket. It's a required field.","type":"string","default":""},"whenUnsatisfiable":{"description":"WhenUnsatisfiable indicates how to deal with a pod if it doesn't satisfy the spread constraint. - DoNotSchedule (default) tells the scheduler not to schedule it. - ScheduleAnyway tells the scheduler to schedule the pod in any location,\n but giving higher precedence to topologies that would help reduce the\n skew.\nA constraint is considered \"Unsatisfiable\" for an incoming pod if and only if every possible node assignment for that pod would violate \"MaxSkew\" on some topology. For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same labelSelector spread as 3/1/1: | zone1 | zone2 | zone3 | | P P P | P | P | If WhenUnsatisfiable is set to DoNotSchedule, incoming pod can only be scheduled to zone2(zone3) to become 3/2/1(3/1/2) as ActualSkew(2-1) on zone2(zone3) satisfies MaxSkew(1). In other words, the cluster can still be imbalanced, but scheduler won't make it *more* imbalanced. It's a required field.\n\n","type":"string","default":""}}},"io.k8s.api.core.v1.TypedLocalObjectReference":{"description":"TypedLocalObjectReference contains enough information to let you locate the typed referenced object inside the same namespace.","type":"object","required":["kind","name"],"properties":{"apiGroup":{"description":"APIGroup is the group for the resource being referenced. If APIGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, APIGroup is required.","type":"string"},"kind":{"description":"Kind is the type of resource being referenced","type":"string","default":""},"name":{"description":"Name is the name of resource being referenced","type":"string","default":""}},"x-kubernetes-map-type":"atomic"},"io.k8s.api.core.v1.Volume":{"description":"Volume represents a named volume in a pod that may be accessed by any container in the pod.","type":"object","required":["name"],"properties":{"awsElasticBlockStore":{"description":"awsElasticBlockStore represents an AWS Disk resource that is attached to a kubelet's host machine and then exposed to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore","$ref":"#/components/schemas/io.k8s.api.core.v1.AWSElasticBlockStoreVolumeSource"},"azureDisk":{"description":"azureDisk represents an Azure Data Disk mount on the host and bind mount to the pod.","$ref":"#/components/schemas/io.k8s.api.core.v1.AzureDiskVolumeSource"},"azureFile":{"description":"azureFile represents an Azure File Service mount on the host and bind mount to the pod.","$ref":"#/components/schemas/io.k8s.api.core.v1.AzureFileVolumeSource"},"cephfs":{"description":"cephFS represents a Ceph FS mount on the host that shares a pod's lifetime","$ref":"#/components/schemas/io.k8s.api.core.v1.CephFSVolumeSource"},"cinder":{"description":"cinder represents a cinder volume attached and mounted on kubelets host machine. More info: https://examples.k8s.io/mysql-cinder-pd/README.md","$ref":"#/components/schemas/io.k8s.api.core.v1.CinderVolumeSource"},"configMap":{"description":"configMap represents a configMap that should populate this volume","$ref":"#/components/schemas/io.k8s.api.core.v1.ConfigMapVolumeSource"},"csi":{"description":"csi (Container Storage Interface) represents ephemeral storage that is handled by certain external CSI drivers (Beta feature).","$ref":"#/components/schemas/io.k8s.api.core.v1.CSIVolumeSource"},"downwardAPI":{"description":"downwardAPI represents downward API about the pod that should populate this volume","$ref":"#/components/schemas/io.k8s.api.core.v1.DownwardAPIVolumeSource"},"emptyDir":{"description":"emptyDir represents a temporary directory that shares a pod's lifetime. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir","$ref":"#/components/schemas/io.k8s.api.core.v1.EmptyDirVolumeSource"},"ephemeral":{"description":"ephemeral represents a volume that is handled by a cluster storage driver. The volume's lifecycle is tied to the pod that defines it - it will be created before the pod starts, and deleted when the pod is removed.\n\nUse this if: a) the volume is only needed while the pod runs, b) features of normal volumes like restoring from snapshot or capacity\n tracking are needed,\nc) the storage driver is specified through a storage class, and d) the storage driver supports dynamic volume provisioning through\n a PersistentVolumeClaim (see EphemeralVolumeSource for more\n information on the connection between this volume type\n and PersistentVolumeClaim).\n\nUse PersistentVolumeClaim or one of the vendor-specific APIs for volumes that persist for longer than the lifecycle of an individual pod.\n\nUse CSI for light-weight local ephemeral volumes if the CSI driver is meant to be used that way - see the documentation of the driver for more information.\n\nA pod can use both types of ephemeral volumes and persistent volumes at the same time.","$ref":"#/components/schemas/io.k8s.api.core.v1.EphemeralVolumeSource"},"fc":{"description":"fc represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod.","$ref":"#/components/schemas/io.k8s.api.core.v1.FCVolumeSource"},"flexVolume":{"description":"flexVolume represents a generic volume resource that is provisioned/attached using an exec based plugin.","$ref":"#/components/schemas/io.k8s.api.core.v1.FlexVolumeSource"},"flocker":{"description":"flocker represents a Flocker volume attached to a kubelet's host machine. This depends on the Flocker control service being running","$ref":"#/components/schemas/io.k8s.api.core.v1.FlockerVolumeSource"},"gcePersistentDisk":{"description":"gcePersistentDisk represents a GCE Disk resource that is attached to a kubelet's host machine and then exposed to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk","$ref":"#/components/schemas/io.k8s.api.core.v1.GCEPersistentDiskVolumeSource"},"gitRepo":{"description":"gitRepo represents a git repository at a particular revision. DEPRECATED: GitRepo is deprecated. To provision a container with a git repo, mount an EmptyDir into an InitContainer that clones the repo using git, then mount the EmptyDir into the Pod's container.","$ref":"#/components/schemas/io.k8s.api.core.v1.GitRepoVolumeSource"},"glusterfs":{"description":"glusterfs represents a Glusterfs mount on the host that shares a pod's lifetime. More info: https://examples.k8s.io/volumes/glusterfs/README.md","$ref":"#/components/schemas/io.k8s.api.core.v1.GlusterfsVolumeSource"},"hostPath":{"description":"hostPath represents a pre-existing file or directory on the host machine that is directly exposed to the container. This is generally used for system agents or other privileged things that are allowed to see the host machine. Most containers will NOT need this. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath","$ref":"#/components/schemas/io.k8s.api.core.v1.HostPathVolumeSource"},"iscsi":{"description":"iscsi represents an ISCSI Disk resource that is attached to a kubelet's host machine and then exposed to the pod. More info: https://examples.k8s.io/volumes/iscsi/README.md","$ref":"#/components/schemas/io.k8s.api.core.v1.ISCSIVolumeSource"},"name":{"description":"name of the volume. Must be a DNS_LABEL and unique within the pod. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names","type":"string","default":""},"nfs":{"description":"nfs represents an NFS mount on the host that shares a pod's lifetime More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs","$ref":"#/components/schemas/io.k8s.api.core.v1.NFSVolumeSource"},"persistentVolumeClaim":{"description":"persistentVolumeClaimVolumeSource represents a reference to a PersistentVolumeClaim in the same namespace. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims","$ref":"#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaimVolumeSource"},"photonPersistentDisk":{"description":"photonPersistentDisk represents a PhotonController persistent disk attached and mounted on kubelets host machine","$ref":"#/components/schemas/io.k8s.api.core.v1.PhotonPersistentDiskVolumeSource"},"portworxVolume":{"description":"portworxVolume represents a portworx volume attached and mounted on kubelets host machine","$ref":"#/components/schemas/io.k8s.api.core.v1.PortworxVolumeSource"},"projected":{"description":"projected items for all in one resources secrets, configmaps, and downward API","$ref":"#/components/schemas/io.k8s.api.core.v1.ProjectedVolumeSource"},"quobyte":{"description":"quobyte represents a Quobyte mount on the host that shares a pod's lifetime","$ref":"#/components/schemas/io.k8s.api.core.v1.QuobyteVolumeSource"},"rbd":{"description":"rbd represents a Rados Block Device mount on the host that shares a pod's lifetime. More info: https://examples.k8s.io/volumes/rbd/README.md","$ref":"#/components/schemas/io.k8s.api.core.v1.RBDVolumeSource"},"scaleIO":{"description":"scaleIO represents a ScaleIO persistent volume attached and mounted on Kubernetes nodes.","$ref":"#/components/schemas/io.k8s.api.core.v1.ScaleIOVolumeSource"},"secret":{"description":"secret represents a secret that should populate this volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret","$ref":"#/components/schemas/io.k8s.api.core.v1.SecretVolumeSource"},"storageos":{"description":"storageOS represents a StorageOS volume attached and mounted on Kubernetes nodes.","$ref":"#/components/schemas/io.k8s.api.core.v1.StorageOSVolumeSource"},"vsphereVolume":{"description":"vsphereVolume represents a vSphere volume attached and mounted on kubelets host machine","$ref":"#/components/schemas/io.k8s.api.core.v1.VsphereVirtualDiskVolumeSource"}}},"io.k8s.api.core.v1.VolumeDevice":{"description":"volumeDevice describes a mapping of a raw block device within a container.","type":"object","required":["name","devicePath"],"properties":{"devicePath":{"description":"devicePath is the path inside of the container that the device will be mapped to.","type":"string","default":""},"name":{"description":"name must match the name of a persistentVolumeClaim in the pod","type":"string","default":""}}},"io.k8s.api.core.v1.VolumeMount":{"description":"VolumeMount describes a mounting of a Volume within a container.","type":"object","required":["name","mountPath"],"properties":{"mountPath":{"description":"Path within the container at which the volume should be mounted. Must not contain ':'.","type":"string","default":""},"mountPropagation":{"description":"mountPropagation determines how mounts are propagated from the host to container and the other way around. When not set, MountPropagationNone is used. This field is beta in 1.10.","type":"string"},"name":{"description":"This must match the Name of a Volume.","type":"string","default":""},"readOnly":{"description":"Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false.","type":"boolean"},"subPath":{"description":"Path within the volume from which the container's volume should be mounted. Defaults to \"\" (volume's root).","type":"string"},"subPathExpr":{"description":"Expanded path within the volume from which the container's volume should be mounted. Behaves similarly to SubPath but environment variable references $(VAR_NAME) are expanded using the container's environment. Defaults to \"\" (volume's root). SubPathExpr and SubPath are mutually exclusive.","type":"string"}}},"io.k8s.api.core.v1.VolumeProjection":{"description":"Projection that may be projected along with other supported volume types","type":"object","properties":{"configMap":{"description":"configMap information about the configMap data to project","$ref":"#/components/schemas/io.k8s.api.core.v1.ConfigMapProjection"},"downwardAPI":{"description":"downwardAPI information about the downwardAPI data to project","$ref":"#/components/schemas/io.k8s.api.core.v1.DownwardAPIProjection"},"secret":{"description":"secret information about the secret data to project","$ref":"#/components/schemas/io.k8s.api.core.v1.SecretProjection"},"serviceAccountToken":{"description":"serviceAccountToken is information about the serviceAccountToken data to project","$ref":"#/components/schemas/io.k8s.api.core.v1.ServiceAccountTokenProjection"}}},"io.k8s.api.core.v1.VsphereVirtualDiskVolumeSource":{"description":"Represents a vSphere volume resource.","type":"object","required":["volumePath"],"properties":{"fsType":{"description":"fsType is filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.","type":"string"},"storagePolicyID":{"description":"storagePolicyID is the storage Policy Based Management (SPBM) profile ID associated with the StoragePolicyName.","type":"string"},"storagePolicyName":{"description":"storagePolicyName is the storage Policy Based Management (SPBM) profile name.","type":"string"},"volumePath":{"description":"volumePath is the path that identifies vSphere volume vmdk","type":"string","default":""}}},"io.k8s.api.core.v1.WeightedPodAffinityTerm":{"description":"The weights of all of the matched WeightedPodAffinityTerm fields are added per-node to find the most preferred node(s)","type":"object","required":["weight","podAffinityTerm"],"properties":{"podAffinityTerm":{"description":"Required. A pod affinity term, associated with the corresponding weight.","default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.PodAffinityTerm"},"weight":{"description":"weight associated with matching the corresponding podAffinityTerm, in the range 1-100.","type":"integer","format":"int32","default":0}}},"io.k8s.api.core.v1.WindowsSecurityContextOptions":{"description":"WindowsSecurityContextOptions contain Windows-specific options and credentials.","type":"object","properties":{"gmsaCredentialSpec":{"description":"GMSACredentialSpec is where the GMSA admission webhook (https://github.com/kubernetes-sigs/windows-gmsa) inlines the contents of the GMSA credential spec named by the GMSACredentialSpecName field.","type":"string"},"gmsaCredentialSpecName":{"description":"GMSACredentialSpecName is the name of the GMSA credential spec to use.","type":"string"},"hostProcess":{"description":"HostProcess determines if a container should be run as a 'Host Process' container. This field is alpha-level and will only be honored by components that enable the WindowsHostProcessContainers feature flag. Setting this field without the feature flag will result in errors when validating the Pod. All of a Pod's containers must have the same effective HostProcess value (it is not allowed to have a mix of HostProcess containers and non-HostProcess containers). In addition, if HostProcess is true then HostNetwork must also be set to true.","type":"boolean"},"runAsUserName":{"description":"The UserName in Windows to run the entrypoint of the container process. Defaults to the user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.","type":"string"}}},"io.k8s.apimachinery.pkg.api.resource.Quantity":{"description":"Quantity is a fixed-point representation of a number. It provides convenient marshaling/unmarshaling in JSON and YAML, in addition to String() and AsInt64() accessors.\n\nThe serialization format is:\n\n\u003cquantity\u003e ::= \u003csignedNumber\u003e\u003csuffix\u003e\n (Note that \u003csuffix\u003e may be empty, from the \"\" case in \u003cdecimalSI\u003e.)\n\u003cdigit\u003e ::= 0 | 1 | ... | 9 \u003cdigits\u003e ::= \u003cdigit\u003e | \u003cdigit\u003e\u003cdigits\u003e \u003cnumber\u003e ::= \u003cdigits\u003e | \u003cdigits\u003e.\u003cdigits\u003e | \u003cdigits\u003e. | .\u003cdigits\u003e \u003csign\u003e ::= \"+\" | \"-\" \u003csignedNumber\u003e ::= \u003cnumber\u003e | \u003csign\u003e\u003cnumber\u003e \u003csuffix\u003e ::= \u003cbinarySI\u003e | \u003cdecimalExponent\u003e | \u003cdecimalSI\u003e \u003cbinarySI\u003e ::= Ki | Mi | Gi | Ti | Pi | Ei\n (International System of units; See: http://physics.nist.gov/cuu/Units/binary.html)\n\u003cdecimalSI\u003e ::= m | \"\" | k | M | G | T | P | E\n (Note that 1024 = 1Ki but 1000 = 1k; I didn't choose the capitalization.)\n\u003cdecimalExponent\u003e ::= \"e\" \u003csignedNumber\u003e | \"E\" \u003csignedNumber\u003e\n\nNo matter which of the three exponent forms is used, no quantity may represent a number greater than 2^63-1 in magnitude, nor may it have more than 3 decimal places. Numbers larger or more precise will be capped or rounded up. (E.g.: 0.1m will rounded up to 1m.) This may be extended in the future if we require larger or smaller quantities.\n\nWhen a Quantity is parsed from a string, it will remember the type of suffix it had, and will use the same type again when it is serialized.\n\nBefore serializing, Quantity will be put in \"canonical form\". This means that Exponent/suffix will be adjusted up or down (with a corresponding increase or decrease in Mantissa) such that:\n a. No precision is lost\n b. No fractional digits will be emitted\n c. The exponent (or suffix) is as large as possible.\nThe sign will be omitted unless the number is negative.\n\nExamples:\n 1.5 will be serialized as \"1500m\"\n 1.5Gi will be serialized as \"1536Mi\"\n\nNote that the quantity will NEVER be internally represented by a floating point number. That is the whole point of this exercise.\n\nNon-canonical values will still parse as long as they are well formed, but will be re-emitted in their canonical form. (So always use canonical form, or don't diff.)\n\nThis format is intended to make it difficult to use these numbers without writing some sort of special handling code in the hopes that that will cause implementors to also use a fixed point implementation.","type":"string"},"io.k8s.apimachinery.pkg.apis.meta.v1.APIResource":{"description":"APIResource specifies the name of a resource and whether it is namespaced.","type":"object","required":["name","singularName","namespaced","kind","verbs"],"properties":{"categories":{"description":"categories is a list of the grouped resources this resource belongs to (e.g. 'all')","type":"array","items":{"type":"string","default":""}},"group":{"description":"group is the preferred group of the resource. Empty implies the group of the containing resource list. For subresources, this may have a different value, for example: Scale\".","type":"string"},"kind":{"description":"kind is the kind for the resource (e.g. 'Foo' is the kind for a resource 'foo')","type":"string","default":""},"name":{"description":"name is the plural name of the resource.","type":"string","default":""},"namespaced":{"description":"namespaced indicates if a resource is namespaced or not.","type":"boolean","default":false},"shortNames":{"description":"shortNames is a list of suggested short names of the resource.","type":"array","items":{"type":"string","default":""}},"singularName":{"description":"singularName is the singular name of the resource. This allows clients to handle plural and singular opaquely. The singularName is more correct for reporting status on a single item and both singular and plural are allowed from the kubectl CLI interface.","type":"string","default":""},"storageVersionHash":{"description":"The hash value of the storage version, the version this resource is converted to when written to the data store. Value must be treated as opaque by clients. Only equality comparison on the value is valid. This is an alpha feature and may change or be removed in the future. The field is populated by the apiserver only if the StorageVersionHash feature gate is enabled. This field will remain optional even if it graduates.","type":"string"},"verbs":{"description":"verbs is a list of supported kube verbs (this includes get, list, watch, create, update, patch, delete, deletecollection, and proxy)","type":"array","items":{"type":"string","default":""}},"version":{"description":"version is the preferred version of the resource. Empty implies the version of the containing resource list For subresources, this may have a different value, for example: v1 (while inside a v1beta1 version of the core resource's group)\".","type":"string"}}},"io.k8s.apimachinery.pkg.apis.meta.v1.APIResourceList":{"description":"APIResourceList is a list of APIResource, it is used to expose the name of the resources supported in a specific group and version, and if the resource is namespaced.","type":"object","required":["groupVersion","resources"],"properties":{"apiVersion":{"description":"APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources","type":"string"},"groupVersion":{"description":"groupVersion is the group and version this APIResourceList is for.","type":"string","default":""},"kind":{"description":"Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds","type":"string"},"resources":{"description":"resources contains the name of the resources and if they are namespaced.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.APIResource"}}},"x-kubernetes-group-version-kind":[{"group":"","kind":"APIResourceList","version":"v1"}]},"io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions":{"description":"DeleteOptions may be provided when deleting an API object.","type":"object","properties":{"apiVersion":{"description":"APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources","type":"string"},"dryRun":{"description":"When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed","type":"array","items":{"type":"string","default":""}},"gracePeriodSeconds":{"description":"The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.","type":"integer","format":"int64"},"kind":{"description":"Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds","type":"string"},"orphanDependents":{"description":"Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.","type":"boolean"},"preconditions":{"description":"Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned.","$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Preconditions"},"propagationPolicy":{"description":"Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.","type":"string"}},"x-kubernetes-group-version-kind":[{"group":"","kind":"DeleteOptions","version":"v1"},{"group":"admission.k8s.io","kind":"DeleteOptions","version":"v1"},{"group":"admission.k8s.io","kind":"DeleteOptions","version":"v1beta1"},{"group":"admissionregistration.k8s.io","kind":"DeleteOptions","version":"v1"},{"group":"admissionregistration.k8s.io","kind":"DeleteOptions","version":"v1beta1"},{"group":"apiextensions.k8s.io","kind":"DeleteOptions","version":"v1"},{"group":"apiextensions.k8s.io","kind":"DeleteOptions","version":"v1beta1"},{"group":"apiregistration.k8s.io","kind":"DeleteOptions","version":"v1"},{"group":"apiregistration.k8s.io","kind":"DeleteOptions","version":"v1beta1"},{"group":"apps","kind":"DeleteOptions","version":"v1"},{"group":"apps","kind":"DeleteOptions","version":"v1beta1"},{"group":"apps","kind":"DeleteOptions","version":"v1beta2"},{"group":"authentication.k8s.io","kind":"DeleteOptions","version":"v1"},{"group":"authentication.k8s.io","kind":"DeleteOptions","version":"v1beta1"},{"group":"authorization.k8s.io","kind":"DeleteOptions","version":"v1"},{"group":"authorization.k8s.io","kind":"DeleteOptions","version":"v1beta1"},{"group":"autoscaling","kind":"DeleteOptions","version":"v1"},{"group":"autoscaling","kind":"DeleteOptions","version":"v2"},{"group":"autoscaling","kind":"DeleteOptions","version":"v2beta1"},{"group":"autoscaling","kind":"DeleteOptions","version":"v2beta2"},{"group":"batch","kind":"DeleteOptions","version":"v1"},{"group":"batch","kind":"DeleteOptions","version":"v1beta1"},{"group":"certificates.k8s.io","kind":"DeleteOptions","version":"v1"},{"group":"certificates.k8s.io","kind":"DeleteOptions","version":"v1beta1"},{"group":"coordination.k8s.io","kind":"DeleteOptions","version":"v1"},{"group":"coordination.k8s.io","kind":"DeleteOptions","version":"v1beta1"},{"group":"discovery.k8s.io","kind":"DeleteOptions","version":"v1"},{"group":"discovery.k8s.io","kind":"DeleteOptions","version":"v1beta1"},{"group":"events.k8s.io","kind":"DeleteOptions","version":"v1"},{"group":"events.k8s.io","kind":"DeleteOptions","version":"v1beta1"},{"group":"extensions","kind":"DeleteOptions","version":"v1beta1"},{"group":"flowcontrol.apiserver.k8s.io","kind":"DeleteOptions","version":"v1alpha1"},{"group":"flowcontrol.apiserver.k8s.io","kind":"DeleteOptions","version":"v1beta1"},{"group":"flowcontrol.apiserver.k8s.io","kind":"DeleteOptions","version":"v1beta2"},{"group":"imagepolicy.k8s.io","kind":"DeleteOptions","version":"v1alpha1"},{"group":"internal.apiserver.k8s.io","kind":"DeleteOptions","version":"v1alpha1"},{"group":"networking.k8s.io","kind":"DeleteOptions","version":"v1"},{"group":"networking.k8s.io","kind":"DeleteOptions","version":"v1beta1"},{"group":"node.k8s.io","kind":"DeleteOptions","version":"v1"},{"group":"node.k8s.io","kind":"DeleteOptions","version":"v1alpha1"},{"group":"node.k8s.io","kind":"DeleteOptions","version":"v1beta1"},{"group":"policy","kind":"DeleteOptions","version":"v1"},{"group":"policy","kind":"DeleteOptions","version":"v1beta1"},{"group":"rbac.authorization.k8s.io","kind":"DeleteOptions","version":"v1"},{"group":"rbac.authorization.k8s.io","kind":"DeleteOptions","version":"v1alpha1"},{"group":"rbac.authorization.k8s.io","kind":"DeleteOptions","version":"v1beta1"},{"group":"scheduling.k8s.io","kind":"DeleteOptions","version":"v1"},{"group":"scheduling.k8s.io","kind":"DeleteOptions","version":"v1alpha1"},{"group":"scheduling.k8s.io","kind":"DeleteOptions","version":"v1beta1"},{"group":"storage.k8s.io","kind":"DeleteOptions","version":"v1"},{"group":"storage.k8s.io","kind":"DeleteOptions","version":"v1alpha1"},{"group":"storage.k8s.io","kind":"DeleteOptions","version":"v1beta1"}]},"io.k8s.apimachinery.pkg.apis.meta.v1.FieldsV1":{"description":"FieldsV1 stores a set of fields in a data structure like a Trie, in JSON format.\n\nEach key is either a '.' representing the field itself, and will always map to an empty set, or a string representing a sub-field or item. The string will follow one of these four formats: 'f:\u003cname\u003e', where \u003cname\u003e is the name of a field in a struct, or key in a map 'v:\u003cvalue\u003e', where \u003cvalue\u003e is the exact json formatted value of a list item 'i:\u003cindex\u003e', where \u003cindex\u003e is position of a item in a list 'k:\u003ckeys\u003e', where \u003ckeys\u003e is a map of a list item's key fields to their unique values If a key maps to an empty Fields value, the field that key represents is part of the set.\n\nThe exact format is defined in sigs.k8s.io/structured-merge-diff","type":"object"},"io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector":{"description":"A label selector is a label query over a set of resources. The result of matchLabels and matchExpressions are ANDed. An empty label selector matches all objects. A null label selector matches no objects.","type":"object","properties":{"matchExpressions":{"description":"matchExpressions is a list of label selector requirements. The requirements are ANDed.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelectorRequirement"}},"matchLabels":{"description":"matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is \"key\", the operator is \"In\", and the values array contains only \"value\". The requirements are ANDed.","type":"object","additionalProperties":{"type":"string","default":""}}},"x-kubernetes-map-type":"atomic"},"io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelectorRequirement":{"description":"A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.","type":"object","required":["key","operator"],"properties":{"key":{"description":"key is the label key that the selector applies to.","type":"string","default":"","x-kubernetes-patch-merge-key":"key","x-kubernetes-patch-strategy":"merge"},"operator":{"description":"operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.","type":"string","default":""},"values":{"description":"values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.","type":"array","items":{"type":"string","default":""}}}},"io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta":{"description":"ListMeta describes metadata that synthetic resources must have, including lists and various status objects. A resource may have only one of {ObjectMeta, ListMeta}.","type":"object","properties":{"continue":{"description":"continue may be set if the user set a limit on the number of items returned, and indicates that the server has more data available. The value is opaque and may be used to issue another request to the endpoint that served this list to retrieve the next set of available objects. Continuing a consistent list may not be possible if the server configuration has changed or more than a few minutes have passed. The resourceVersion field returned when using this continue value will be identical to the value in the first response, unless you have received this token from an error message.","type":"string"},"remainingItemCount":{"description":"remainingItemCount is the number of subsequent items in the list which are not included in this list response. If the list request contained label or field selectors, then the number of remaining items is unknown and the field will be left unset and omitted during serialization. If the list is complete (either because it is not chunking or because this is the last chunk), then there are no more remaining items and this field will be left unset and omitted during serialization. Servers older than v1.15 do not set this field. The intended use of the remainingItemCount is *estimating* the size of a collection. Clients should not rely on the remainingItemCount to be set or to be exact.","type":"integer","format":"int64"},"resourceVersion":{"description":"String that identifies the server's internal version of this object that can be used by clients to determine when objects have changed. Value must be treated as opaque by clients and passed unmodified back to the server. Populated by the system. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency","type":"string"},"selfLink":{"description":"selfLink is DEPRECATED read-only field that is no longer populated by the system.","type":"string"}}},"io.k8s.apimachinery.pkg.apis.meta.v1.ManagedFieldsEntry":{"description":"ManagedFieldsEntry is a workflow-id, a FieldSet and the group version of the resource that the fieldset applies to.","type":"object","properties":{"apiVersion":{"description":"APIVersion defines the version of this resource that this field set applies to. The format is \"group/version\" just like the top-level APIVersion field. It is necessary to track the version of a field set because it cannot be automatically converted.","type":"string"},"fieldsType":{"description":"FieldsType is the discriminator for the different fields format and version. There is currently only one possible value: \"FieldsV1\"","type":"string"},"fieldsV1":{"description":"FieldsV1 holds the first JSON version format as described in the \"FieldsV1\" type.","$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.FieldsV1"},"manager":{"description":"Manager is an identifier of the workflow managing these fields.","type":"string"},"operation":{"description":"Operation is the type of operation which lead to this ManagedFieldsEntry being created. The only valid values for this field are 'Apply' and 'Update'.","type":"string"},"subresource":{"description":"Subresource is the name of the subresource used to update that object, or empty string if the object was updated through the main resource. The value of this field is used to distinguish between managers, even if they share the same name. For example, a status update will be distinct from a regular update using the same manager name. Note that the APIVersion field is not related to the Subresource field and it always corresponds to the version of the main resource.","type":"string"},"time":{"description":"Time is the timestamp of when the ManagedFields entry was added. The timestamp will also be updated if a field is added, the manager changes any of the owned fields value or removes a field. The timestamp does not update when a field is removed from the entry because another manager took it over.","$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time"}}},"io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta":{"description":"ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create.","type":"object","properties":{"annotations":{"description":"Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations","type":"object","additionalProperties":{"type":"string","default":""}},"clusterName":{"description":"The name of the cluster which the object belongs to. This is used to distinguish resources with same name and namespace in different clusters. This field is not set anywhere right now and apiserver is going to ignore it if set in create or update request.","type":"string"},"creationTimestamp":{"description":"CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC.\n\nPopulated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata","default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time"},"deletionGracePeriodSeconds":{"description":"Number of seconds allowed for this object to gracefully terminate before it will be removed from the system. Only set when deletionTimestamp is also set. May only be shortened. Read-only.","type":"integer","format":"int64"},"deletionTimestamp":{"description":"DeletionTimestamp is RFC 3339 date and time at which this resource will be deleted. This field is set by the server when a graceful deletion is requested by the user, and is not directly settable by a client. The resource is expected to be deleted (no longer visible from resource lists, and not reachable by name) after the time in this field, once the finalizers list is empty. As long as the finalizers list contains items, deletion is blocked. Once the deletionTimestamp is set, this value may not be unset or be set further into the future, although it may be shortened or the resource may be deleted prior to this time. For example, a user may request that a pod is deleted in 30 seconds. The Kubelet will react by sending a graceful termination signal to the containers in the pod. After that 30 seconds, the Kubelet will send a hard termination signal (SIGKILL) to the container and after cleanup, remove the pod from the API. In the presence of network partitions, this object may still exist after this timestamp, until an administrator or automated process can determine the resource is fully terminated. If not set, graceful deletion of the object has not been requested.\n\nPopulated by the system when a graceful deletion is requested. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata","$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time"},"finalizers":{"description":"Must be empty before the object is deleted from the registry. Each entry is an identifier for the responsible component that will remove the entry from the list. If the deletionTimestamp of the object is non-nil, entries in this list can only be removed. Finalizers may be processed and removed in any order. Order is NOT enforced because it introduces significant risk of stuck finalizers. finalizers is a shared field, any actor with permission can reorder it. If the finalizer list is processed in order, then this can lead to a situation in which the component responsible for the first finalizer in the list is waiting for a signal (field value, external system, or other) produced by a component responsible for a finalizer later in the list, resulting in a deadlock. Without enforced ordering finalizers are free to order amongst themselves and are not vulnerable to ordering changes in the list.","type":"array","items":{"type":"string","default":""},"x-kubernetes-patch-strategy":"merge"},"generateName":{"description":"GenerateName is an optional prefix, used by the server, to generate a unique name ONLY IF the Name field has not been provided. If this field is used, the name returned to the client will be different than the name passed. This value will also be combined with a unique suffix. The provided value has the same validation rules as the Name field, and may be truncated by the length of the suffix required to make the value unique on the server.\n\nIf this field is specified and the generated name exists, the server will NOT return a 409 - instead, it will either return 201 Created or 500 with Reason ServerTimeout indicating a unique name could not be found in the time allotted, and the client should retry (optionally after the time indicated in the Retry-After header).\n\nApplied only if Name is not specified. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#idempotency","type":"string"},"generation":{"description":"A sequence number representing a specific generation of the desired state. Populated by the system. Read-only.","type":"integer","format":"int64"},"labels":{"description":"Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels","type":"object","additionalProperties":{"type":"string","default":""}},"managedFields":{"description":"ManagedFields maps workflow-id and version to the set of fields that are managed by that workflow. This is mostly for internal housekeeping, and users typically shouldn't need to set or understand this field. A workflow can be the user's name, a controller's name, or the name of a specific apply path like \"ci-cd\". The set of fields is always in the version that the workflow used when modifying the object.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ManagedFieldsEntry"}},"name":{"description":"Name must be unique within a namespace. Is required when creating resources, although some resources may allow a client to request the generation of an appropriate name automatically. Name is primarily intended for creation idempotence and configuration definition. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#names","type":"string"},"namespace":{"description":"Namespace defines the space within which each name must be unique. An empty namespace is equivalent to the \"default\" namespace, but \"default\" is the canonical representation. Not all objects are required to be scoped to a namespace - the value of this field for those objects will be empty.\n\nMust be a DNS_LABEL. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces","type":"string"},"ownerReferences":{"description":"List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, then an entry in this list will point to this controller, with the controller field set to true. There cannot be more than one managing controller.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.OwnerReference"},"x-kubernetes-patch-merge-key":"uid","x-kubernetes-patch-strategy":"merge"},"resourceVersion":{"description":"An opaque value that represents the internal version of this object that can be used by clients to determine when objects have changed. May be used for optimistic concurrency, change detection, and the watch operation on a resource or set of resources. Clients must treat these values as opaque and passed unmodified back to the server. They may only be valid for a particular resource or set of resources.\n\nPopulated by the system. Read-only. Value must be treated as opaque by clients and . More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency","type":"string"},"selfLink":{"description":"selfLink is DEPRECATED read-only field that is no longer populated by the system.","type":"string"},"uid":{"description":"UID is the unique in time and space value for this object. It is typically generated by the server on successful creation of a resource and is not allowed to change on PUT operations.\n\nPopulated by the system. Read-only. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#uids","type":"string"}}},"io.k8s.apimachinery.pkg.apis.meta.v1.OwnerReference":{"description":"OwnerReference contains enough information to let you identify an owning object. An owning object must be in the same namespace as the dependent, or be cluster-scoped, so there is no namespace field.","type":"object","required":["apiVersion","kind","name","uid"],"properties":{"apiVersion":{"description":"API version of the referent.","type":"string","default":""},"blockOwnerDeletion":{"description":"If true, AND if the owner has the \"foregroundDeletion\" finalizer, then the owner cannot be deleted from the key-value store until this reference is removed. See https://kubernetes.io/docs/concepts/architecture/garbage-collection/#foreground-deletion for how the garbage collector interacts with this field and enforces the foreground deletion. Defaults to false. To set this field, a user needs \"delete\" permission of the owner, otherwise 422 (Unprocessable Entity) will be returned.","type":"boolean"},"controller":{"description":"If true, this reference points to the managing controller.","type":"boolean"},"kind":{"description":"Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds","type":"string","default":""},"name":{"description":"Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#names","type":"string","default":""},"uid":{"description":"UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#uids","type":"string","default":""}},"x-kubernetes-map-type":"atomic"},"io.k8s.apimachinery.pkg.apis.meta.v1.Patch":{"description":"Patch is provided to give a concrete name and type to the Kubernetes PATCH request body.","type":"object"},"io.k8s.apimachinery.pkg.apis.meta.v1.Preconditions":{"description":"Preconditions must be fulfilled before an operation (update, delete, etc.) is carried out.","type":"object","properties":{"resourceVersion":{"description":"Specifies the target ResourceVersion","type":"string"},"uid":{"description":"Specifies the target UID.","type":"string"}}},"io.k8s.apimachinery.pkg.apis.meta.v1.Status":{"description":"Status is a return value for calls that don't return other objects.","type":"object","properties":{"apiVersion":{"description":"APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources","type":"string"},"code":{"description":"Suggested HTTP return code for this status, 0 if not set.","type":"integer","format":"int32"},"details":{"description":"Extended data associated with the reason. Each reason may define its own extended details. This field is optional and the data returned is not guaranteed to conform to any schema except that defined by the reason type.","$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.StatusDetails"},"kind":{"description":"Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds","type":"string"},"message":{"description":"A human-readable description of the status of this operation.","type":"string"},"metadata":{"description":"Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds","default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta"},"reason":{"description":"A machine-readable description of why this operation is in the \"Failure\" status. If this value is empty there is no information available. A Reason clarifies an HTTP status code but does not override it.","type":"string"},"status":{"description":"Status of the operation. One of: \"Success\" or \"Failure\". More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status","type":"string"}},"x-kubernetes-group-version-kind":[{"group":"","kind":"Status","version":"v1"}]},"io.k8s.apimachinery.pkg.apis.meta.v1.StatusCause":{"description":"StatusCause provides more information about an api.Status failure, including cases when multiple errors are encountered.","type":"object","properties":{"field":{"description":"The field of the resource that has caused this error, as named by its JSON serialization. May include dot and postfix notation for nested attributes. Arrays are zero-indexed. Fields may appear more than once in an array of causes due to fields having multiple errors. Optional.\n\nExamples:\n \"name\" - the field \"name\" on the current resource\n \"items[0].name\" - the field \"name\" on the first array entry in \"items\"","type":"string"},"message":{"description":"A human-readable description of the cause of the error. This field may be presented as-is to a reader.","type":"string"},"reason":{"description":"A machine-readable description of the cause of the error. If this value is empty there is no information available.","type":"string"}}},"io.k8s.apimachinery.pkg.apis.meta.v1.StatusDetails":{"description":"StatusDetails is a set of additional properties that MAY be set by the server to provide additional information about a response. The Reason field of a Status object defines what attributes will be set. Clients must ignore fields that do not match the defined type of each attribute, and should assume that any attribute may be empty, invalid, or under defined.","type":"object","properties":{"causes":{"description":"The Causes array includes more details associated with the StatusReason failure. Not all StatusReasons may provide detailed causes.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.StatusCause"}},"group":{"description":"The group attribute of the resource associated with the status StatusReason.","type":"string"},"kind":{"description":"The kind attribute of the resource associated with the status StatusReason. On some operations may differ from the requested resource Kind. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds","type":"string"},"name":{"description":"The name attribute of the resource associated with the status StatusReason (when there is a single name which can be described).","type":"string"},"retryAfterSeconds":{"description":"If specified, the time in seconds before the operation should be retried. Some errors may indicate the client must take an alternate action - for those errors this field may indicate how long to wait before taking the alternate action.","type":"integer","format":"int32"},"uid":{"description":"UID of the resource. (when there is a single resource which can be described). More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#uids","type":"string"}}},"io.k8s.apimachinery.pkg.apis.meta.v1.Time":{"description":"Time is a wrapper around time.Time which supports correct marshaling to YAML and JSON. Wrappers are provided for many of the factory methods that the time package offers.","type":"string","format":"date-time"},"io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent":{"description":"Event represents a single event to a watched resource.","type":"object","required":["type","object"],"properties":{"object":{"description":"Object is:\n * If Type is Added or Modified: the new state of the object.\n * If Type is Deleted: the state of the object immediately before deletion.\n * If Type is Error: *Status is recommended; other types may make sense\n depending on context.","default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.runtime.RawExtension"},"type":{"type":"string","default":""}},"x-kubernetes-group-version-kind":[{"group":"","kind":"WatchEvent","version":"v1"},{"group":"admission.k8s.io","kind":"WatchEvent","version":"v1"},{"group":"admission.k8s.io","kind":"WatchEvent","version":"v1beta1"},{"group":"admissionregistration.k8s.io","kind":"WatchEvent","version":"v1"},{"group":"admissionregistration.k8s.io","kind":"WatchEvent","version":"v1beta1"},{"group":"apiextensions.k8s.io","kind":"WatchEvent","version":"v1"},{"group":"apiextensions.k8s.io","kind":"WatchEvent","version":"v1beta1"},{"group":"apiregistration.k8s.io","kind":"WatchEvent","version":"v1"},{"group":"apiregistration.k8s.io","kind":"WatchEvent","version":"v1beta1"},{"group":"apps","kind":"WatchEvent","version":"v1"},{"group":"apps","kind":"WatchEvent","version":"v1beta1"},{"group":"apps","kind":"WatchEvent","version":"v1beta2"},{"group":"authentication.k8s.io","kind":"WatchEvent","version":"v1"},{"group":"authentication.k8s.io","kind":"WatchEvent","version":"v1beta1"},{"group":"authorization.k8s.io","kind":"WatchEvent","version":"v1"},{"group":"authorization.k8s.io","kind":"WatchEvent","version":"v1beta1"},{"group":"autoscaling","kind":"WatchEvent","version":"v1"},{"group":"autoscaling","kind":"WatchEvent","version":"v2"},{"group":"autoscaling","kind":"WatchEvent","version":"v2beta1"},{"group":"autoscaling","kind":"WatchEvent","version":"v2beta2"},{"group":"batch","kind":"WatchEvent","version":"v1"},{"group":"batch","kind":"WatchEvent","version":"v1beta1"},{"group":"certificates.k8s.io","kind":"WatchEvent","version":"v1"},{"group":"certificates.k8s.io","kind":"WatchEvent","version":"v1beta1"},{"group":"coordination.k8s.io","kind":"WatchEvent","version":"v1"},{"group":"coordination.k8s.io","kind":"WatchEvent","version":"v1beta1"},{"group":"discovery.k8s.io","kind":"WatchEvent","version":"v1"},{"group":"discovery.k8s.io","kind":"WatchEvent","version":"v1beta1"},{"group":"events.k8s.io","kind":"WatchEvent","version":"v1"},{"group":"events.k8s.io","kind":"WatchEvent","version":"v1beta1"},{"group":"extensions","kind":"WatchEvent","version":"v1beta1"},{"group":"flowcontrol.apiserver.k8s.io","kind":"WatchEvent","version":"v1alpha1"},{"group":"flowcontrol.apiserver.k8s.io","kind":"WatchEvent","version":"v1beta1"},{"group":"flowcontrol.apiserver.k8s.io","kind":"WatchEvent","version":"v1beta2"},{"group":"imagepolicy.k8s.io","kind":"WatchEvent","version":"v1alpha1"},{"group":"internal.apiserver.k8s.io","kind":"WatchEvent","version":"v1alpha1"},{"group":"networking.k8s.io","kind":"WatchEvent","version":"v1"},{"group":"networking.k8s.io","kind":"WatchEvent","version":"v1beta1"},{"group":"node.k8s.io","kind":"WatchEvent","version":"v1"},{"group":"node.k8s.io","kind":"WatchEvent","version":"v1alpha1"},{"group":"node.k8s.io","kind":"WatchEvent","version":"v1beta1"},{"group":"policy","kind":"WatchEvent","version":"v1"},{"group":"policy","kind":"WatchEvent","version":"v1beta1"},{"group":"rbac.authorization.k8s.io","kind":"WatchEvent","version":"v1"},{"group":"rbac.authorization.k8s.io","kind":"WatchEvent","version":"v1alpha1"},{"group":"rbac.authorization.k8s.io","kind":"WatchEvent","version":"v1beta1"},{"group":"scheduling.k8s.io","kind":"WatchEvent","version":"v1"},{"group":"scheduling.k8s.io","kind":"WatchEvent","version":"v1alpha1"},{"group":"scheduling.k8s.io","kind":"WatchEvent","version":"v1beta1"},{"group":"storage.k8s.io","kind":"WatchEvent","version":"v1"},{"group":"storage.k8s.io","kind":"WatchEvent","version":"v1alpha1"},{"group":"storage.k8s.io","kind":"WatchEvent","version":"v1beta1"}]},"io.k8s.apimachinery.pkg.runtime.RawExtension":{"description":"RawExtension is used to hold extensions in external versions.\n\nTo use this, make a field which has RawExtension as its type in your external, versioned struct, and Object in your internal struct. You also need to register your various plugin types.\n\n// Internal package: type MyAPIObject struct {\n\truntime.TypeMeta `json:\",inline\"`\n\tMyPlugin runtime.Object `json:\"myPlugin\"`\n} type PluginA struct {\n\tAOption string `json:\"aOption\"`\n}\n\n// External package: type MyAPIObject struct {\n\truntime.TypeMeta `json:\",inline\"`\n\tMyPlugin runtime.RawExtension `json:\"myPlugin\"`\n} type PluginA struct {\n\tAOption string `json:\"aOption\"`\n}\n\n// On the wire, the JSON will look something like this: {\n\t\"kind\":\"MyAPIObject\",\n\t\"apiVersion\":\"v1\",\n\t\"myPlugin\": {\n\t\t\"kind\":\"PluginA\",\n\t\t\"aOption\":\"foo\",\n\t},\n}\n\nSo what happens? Decode first uses json or yaml to unmarshal the serialized data into your external MyAPIObject. That causes the raw JSON to be stored, but not unpacked. The next step is to copy (using pkg/conversion) into the internal struct. The runtime package's DefaultScheme has conversion functions installed which will unpack the JSON stored in RawExtension, turning it into the correct object type, and storing it in the Object. (TODO: In the case where the object is of an unknown type, a runtime.Unknown object will be created and stored.)","type":"object"},"io.k8s.apimachinery.pkg.util.intstr.IntOrString":{"description":"IntOrString is a type that can hold an int32 or a string. When used in JSON or YAML marshalling and unmarshalling, it produces or consumes the inner type. This allows you to have, for example, a JSON field that can accept a name or number.","type":"string","format":"int-or-string"}}}} +{"openapi":"3.0.0","info":{"title":"Kubernetes","version":"v1.24.0"},"paths":{"/apis/batch/v1beta1/":{"get":{"tags":["batch_v1beta1"],"description":"get available resources","operationId":"getBatchV1beta1APIResources","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.APIResourceList"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.APIResourceList"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.APIResourceList"}}}}}}},"/apis/batch/v1beta1/cronjobs":{"get":{"tags":["batch_v1beta1"],"description":"list or watch objects of kind CronJob","operationId":"listBatchV1beta1CronJobForAllNamespaces","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJobList"}},"application/json;stream=watch":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJobList"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJobList"}},"application/vnd.kubernetes.protobuf;stream=watch":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJobList"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJobList"}}}}}},"parameters":[{"name":"allowWatchBookmarks","in":"query","description":"allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.","schema":{"type":"boolean","uniqueItems":true}},{"name":"continue","in":"query","description":"The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.","schema":{"type":"string","uniqueItems":true}},{"name":"fieldSelector","in":"query","description":"A selector to restrict the list of returned objects by their fields. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"labelSelector","in":"query","description":"A selector to restrict the list of returned objects by their labels. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"limit","in":"query","description":"limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.","schema":{"type":"integer","uniqueItems":true}},{"name":"pretty","in":"query","description":"If 'true', then the output is pretty printed.","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersion","in":"query","description":"resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersionMatch","in":"query","description":"resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"timeoutSeconds","in":"query","description":"Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.","schema":{"type":"integer","uniqueItems":true}},{"name":"watch","in":"query","description":"Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.","schema":{"type":"boolean","uniqueItems":true}}]},"/apis/batch/v1beta1/namespaces/{namespace}/cronjobs":{"get":{"tags":["batch_v1beta1"],"description":"list or watch objects of kind CronJob","operationId":"listBatchV1beta1NamespacedCronJob","parameters":[{"name":"labelSelector","in":"query","description":"A selector to restrict the list of returned objects by their labels. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"fieldSelector","in":"query","description":"A selector to restrict the list of returned objects by their fields. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"watch","in":"query","description":"Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.","schema":{"type":"boolean","uniqueItems":true}},{"name":"allowWatchBookmarks","in":"query","description":"allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.","schema":{"type":"boolean","uniqueItems":true}},{"name":"resourceVersion","in":"query","description":"resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersionMatch","in":"query","description":"resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"timeoutSeconds","in":"query","description":"Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.","schema":{"type":"integer","uniqueItems":true}},{"name":"limit","in":"query","description":"limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.","schema":{"type":"integer","uniqueItems":true}},{"name":"continue","in":"query","description":"The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.","schema":{"type":"string","uniqueItems":true}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJobList"}},"application/json;stream=watch":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJobList"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJobList"}},"application/vnd.kubernetes.protobuf;stream=watch":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJobList"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJobList"}}}}}},"post":{"tags":["batch_v1beta1"],"description":"create a CronJob","operationId":"createBatchV1beta1NamespacedCronJob","parameters":[{"name":"dryRun","in":"query","description":"When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed","schema":{"type":"string","uniqueItems":true}},{"name":"fieldManager","in":"query","description":"fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.","schema":{"type":"string","uniqueItems":true}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}}}},"202":{"description":"Accepted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}}}}}},"delete":{"tags":["batch_v1beta1"],"description":"delete collection of CronJob","operationId":"deleteBatchV1beta1CollectionNamespacedCronJob","parameters":[{"name":"gracePeriodSeconds","in":"query","description":"The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.","schema":{"type":"integer","uniqueItems":true}},{"name":"orphanDependents","in":"query","description":"Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.","schema":{"type":"boolean","uniqueItems":true}},{"name":"propagationPolicy","in":"query","description":"Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.","schema":{"type":"string","uniqueItems":true}},{"name":"dryRun","in":"query","description":"When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed","schema":{"type":"string","uniqueItems":true}},{"name":"labelSelector","in":"query","description":"A selector to restrict the list of returned objects by their labels. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"fieldSelector","in":"query","description":"A selector to restrict the list of returned objects by their fields. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersion","in":"query","description":"resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersionMatch","in":"query","description":"resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"timeoutSeconds","in":"query","description":"Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.","schema":{"type":"integer","uniqueItems":true}},{"name":"limit","in":"query","description":"limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.","schema":{"type":"integer","uniqueItems":true}},{"name":"continue","in":"query","description":"The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.","schema":{"type":"string","uniqueItems":true}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status"}}}}}},"parameters":[{"name":"namespace","in":"path","description":"object name and auth scope, such as for teams and projects","required":true,"schema":{"type":"string","uniqueItems":true}},{"name":"pretty","in":"query","description":"If 'true', then the output is pretty printed.","schema":{"type":"string","uniqueItems":true}}]},"/apis/batch/v1beta1/namespaces/{namespace}/cronjobs/{name}":{"get":{"tags":["batch_v1beta1"],"description":"read the specified CronJob","operationId":"readBatchV1beta1NamespacedCronJob","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}}}}}},"put":{"tags":["batch_v1beta1"],"description":"replace the specified CronJob","operationId":"replaceBatchV1beta1NamespacedCronJob","parameters":[{"name":"dryRun","in":"query","description":"When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed","schema":{"type":"string","uniqueItems":true}},{"name":"fieldManager","in":"query","description":"fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.","schema":{"type":"string","uniqueItems":true}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}}}}}},"delete":{"tags":["batch_v1beta1"],"description":"delete a CronJob","operationId":"deleteBatchV1beta1NamespacedCronJob","parameters":[{"name":"gracePeriodSeconds","in":"query","description":"The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.","schema":{"type":"integer","uniqueItems":true}},{"name":"orphanDependents","in":"query","description":"Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.","schema":{"type":"boolean","uniqueItems":true}},{"name":"propagationPolicy","in":"query","description":"Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.","schema":{"type":"string","uniqueItems":true}},{"name":"dryRun","in":"query","description":"When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed","schema":{"type":"string","uniqueItems":true}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status"}}}},"202":{"description":"Accepted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status"}}}}}},"patch":{"tags":["batch_v1beta1"],"description":"partially update the specified CronJob","operationId":"patchBatchV1beta1NamespacedCronJob","parameters":[{"name":"dryRun","in":"query","description":"When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed","schema":{"type":"string","uniqueItems":true}},{"name":"force","in":"query","description":"Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.","schema":{"type":"boolean","uniqueItems":true}},{"name":"fieldManager","in":"query","description":"fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).","schema":{"type":"string","uniqueItems":true}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}}}}}},"parameters":[{"name":"name","in":"path","description":"name of the CronJob","required":true,"schema":{"type":"string","uniqueItems":true}},{"name":"namespace","in":"path","description":"object name and auth scope, such as for teams and projects","required":true,"schema":{"type":"string","uniqueItems":true}},{"name":"pretty","in":"query","description":"If 'true', then the output is pretty printed.","schema":{"type":"string","uniqueItems":true}}]},"/apis/batch/v1beta1/namespaces/{namespace}/cronjobs/{name}/status":{"get":{"tags":["batch_v1beta1"],"description":"read status of the specified CronJob","operationId":"readBatchV1beta1NamespacedCronJobStatus","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}}}}}},"put":{"tags":["batch_v1beta1"],"description":"replace status of the specified CronJob","operationId":"replaceBatchV1beta1NamespacedCronJobStatus","parameters":[{"name":"dryRun","in":"query","description":"When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed","schema":{"type":"string","uniqueItems":true}},{"name":"fieldManager","in":"query","description":"fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.","schema":{"type":"string","uniqueItems":true}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}}}}}},"patch":{"tags":["batch_v1beta1"],"description":"partially update status of the specified CronJob","operationId":"patchBatchV1beta1NamespacedCronJobStatus","parameters":[{"name":"dryRun","in":"query","description":"When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed","schema":{"type":"string","uniqueItems":true}},{"name":"force","in":"query","description":"Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.","schema":{"type":"boolean","uniqueItems":true}},{"name":"fieldManager","in":"query","description":"fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).","schema":{"type":"string","uniqueItems":true}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}}}}}},"parameters":[{"name":"name","in":"path","description":"name of the CronJob","required":true,"schema":{"type":"string","uniqueItems":true}},{"name":"namespace","in":"path","description":"object name and auth scope, such as for teams and projects","required":true,"schema":{"type":"string","uniqueItems":true}},{"name":"pretty","in":"query","description":"If 'true', then the output is pretty printed.","schema":{"type":"string","uniqueItems":true}}]},"/apis/batch/v1beta1/watch/cronjobs":{"get":{"tags":["batch_v1beta1"],"description":"watch individual changes to a list of CronJob. deprecated: use the 'watch' parameter with a list operation instead.","operationId":"watchBatchV1beta1CronJobListForAllNamespaces","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/json;stream=watch":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/vnd.kubernetes.protobuf;stream=watch":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}}}}}},"parameters":[{"name":"allowWatchBookmarks","in":"query","description":"allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.","schema":{"type":"boolean","uniqueItems":true}},{"name":"continue","in":"query","description":"The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.","schema":{"type":"string","uniqueItems":true}},{"name":"fieldSelector","in":"query","description":"A selector to restrict the list of returned objects by their fields. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"labelSelector","in":"query","description":"A selector to restrict the list of returned objects by their labels. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"limit","in":"query","description":"limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.","schema":{"type":"integer","uniqueItems":true}},{"name":"pretty","in":"query","description":"If 'true', then the output is pretty printed.","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersion","in":"query","description":"resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersionMatch","in":"query","description":"resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"timeoutSeconds","in":"query","description":"Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.","schema":{"type":"integer","uniqueItems":true}},{"name":"watch","in":"query","description":"Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.","schema":{"type":"boolean","uniqueItems":true}}]},"/apis/batch/v1beta1/watch/namespaces/{namespace}/cronjobs":{"get":{"tags":["batch_v1beta1"],"description":"watch individual changes to a list of CronJob. deprecated: use the 'watch' parameter with a list operation instead.","operationId":"watchBatchV1beta1NamespacedCronJobList","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/json;stream=watch":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/vnd.kubernetes.protobuf;stream=watch":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}}}}}},"parameters":[{"name":"allowWatchBookmarks","in":"query","description":"allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.","schema":{"type":"boolean","uniqueItems":true}},{"name":"continue","in":"query","description":"The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.","schema":{"type":"string","uniqueItems":true}},{"name":"fieldSelector","in":"query","description":"A selector to restrict the list of returned objects by their fields. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"labelSelector","in":"query","description":"A selector to restrict the list of returned objects by their labels. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"limit","in":"query","description":"limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.","schema":{"type":"integer","uniqueItems":true}},{"name":"namespace","in":"path","description":"object name and auth scope, such as for teams and projects","required":true,"schema":{"type":"string","uniqueItems":true}},{"name":"pretty","in":"query","description":"If 'true', then the output is pretty printed.","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersion","in":"query","description":"resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersionMatch","in":"query","description":"resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"timeoutSeconds","in":"query","description":"Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.","schema":{"type":"integer","uniqueItems":true}},{"name":"watch","in":"query","description":"Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.","schema":{"type":"boolean","uniqueItems":true}}]},"/apis/batch/v1beta1/watch/namespaces/{namespace}/cronjobs/{name}":{"get":{"tags":["batch_v1beta1"],"description":"watch changes to an object of kind CronJob. deprecated: use the 'watch' parameter with a list operation instead, filtered to a single item with the 'fieldSelector' parameter.","operationId":"watchBatchV1beta1NamespacedCronJob","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/json;stream=watch":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/vnd.kubernetes.protobuf;stream=watch":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}}}}}},"parameters":[{"name":"allowWatchBookmarks","in":"query","description":"allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.","schema":{"type":"boolean","uniqueItems":true}},{"name":"continue","in":"query","description":"The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.","schema":{"type":"string","uniqueItems":true}},{"name":"fieldSelector","in":"query","description":"A selector to restrict the list of returned objects by their fields. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"labelSelector","in":"query","description":"A selector to restrict the list of returned objects by their labels. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"limit","in":"query","description":"limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.","schema":{"type":"integer","uniqueItems":true}},{"name":"name","in":"path","description":"name of the CronJob","required":true,"schema":{"type":"string","uniqueItems":true}},{"name":"namespace","in":"path","description":"object name and auth scope, such as for teams and projects","required":true,"schema":{"type":"string","uniqueItems":true}},{"name":"pretty","in":"query","description":"If 'true', then the output is pretty printed.","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersion","in":"query","description":"resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersionMatch","in":"query","description":"resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"timeoutSeconds","in":"query","description":"Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.","schema":{"type":"integer","uniqueItems":true}},{"name":"watch","in":"query","description":"Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.","schema":{"type":"boolean","uniqueItems":true}}]}},"components":{"schemas":{"io.k8s.api.batch.v1.JobSpec":{"description":"JobSpec describes how the job execution will look like.","type":"object","required":["template"],"properties":{"activeDeadlineSeconds":{"description":"Specifies the duration in seconds relative to the startTime that the job may be continuously active before the system tries to terminate it; value must be positive integer. If a Job is suspended (at creation or through an update), this timer will effectively be stopped and reset when the Job is resumed again.","type":"integer","format":"int64"},"backoffLimit":{"description":"Specifies the number of retries before marking this job failed. Defaults to 6","type":"integer","format":"int32"},"completionMode":{"description":"CompletionMode specifies how Pod completions are tracked. It can be `NonIndexed` (default) or `Indexed`.\n\n`NonIndexed` means that the Job is considered complete when there have been .spec.completions successfully completed Pods. Each Pod completion is homologous to each other.\n\n`Indexed` means that the Pods of a Job get an associated completion index from 0 to (.spec.completions - 1), available in the annotation batch.kubernetes.io/job-completion-index. The Job is considered complete when there is one successfully completed Pod for each index. When value is `Indexed`, .spec.completions must be specified and `.spec.parallelism` must be less than or equal to 10^5. In addition, The Pod name takes the form `$(job-name)-$(index)-$(random-string)`, the Pod hostname takes the form `$(job-name)-$(index)`.\n\nThis field is beta-level. More completion modes can be added in the future. If the Job controller observes a mode that it doesn't recognize, the controller skips updates for the Job.","type":"string"},"completions":{"description":"Specifies the desired number of successfully finished pods the job should be run with. Setting to nil means that the success of any pod signals the success of all pods, and allows parallelism to have any positive value. Setting to 1 means that parallelism is limited to 1 and the success of that pod signals the success of the job. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/","type":"integer","format":"int32"},"manualSelector":{"description":"manualSelector controls generation of pod labels and pod selectors. Leave `manualSelector` unset unless you are certain what you are doing. When false or unset, the system pick labels unique to this job and appends those labels to the pod template. When true, the user is responsible for picking unique labels and specifying the selector. Failure to pick a unique label may cause this and other jobs to not function correctly. However, You may see `manualSelector=true` in jobs that were created with the old `extensions/v1beta1` API. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/#specifying-your-own-pod-selector","type":"boolean"},"parallelism":{"description":"Specifies the maximum desired number of pods the job should run at any given time. The actual number of pods running in steady state will be less than this number when ((.spec.completions - .status.successful) \u003c .spec.parallelism), i.e. when the work left to do is less than max parallelism. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/","type":"integer","format":"int32"},"selector":{"description":"A label query over pods that should match the pod count. Normally, the system sets this field for you. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors","$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector"},"suspend":{"description":"Suspend specifies whether the Job controller should create Pods or not. If a Job is created with suspend set to true, no Pods are created by the Job controller. If a Job is suspended after creation (i.e. the flag goes from false to true), the Job controller will delete all active Pods associated with this Job. Users must design their workload to gracefully handle this. Suspending a Job will reset the StartTime field of the Job, effectively resetting the ActiveDeadlineSeconds timer too. Defaults to false.\n\nThis field is beta-level, gated by SuspendJob feature flag (enabled by default).","type":"boolean"},"template":{"description":"Describes the pod that will be created when executing a job. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/","default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.PodTemplateSpec"},"ttlSecondsAfterFinished":{"description":"ttlSecondsAfterFinished limits the lifetime of a Job that has finished execution (either Complete or Failed). If this field is set, ttlSecondsAfterFinished after the Job finishes, it is eligible to be automatically deleted. When the Job is being deleted, its lifecycle guarantees (e.g. finalizers) will be honored. If this field is unset, the Job won't be automatically deleted. If this field is set to zero, the Job becomes eligible to be deleted immediately after it finishes.","type":"integer","format":"int32"}}},"io.k8s.api.batch.v1beta1.CronJob":{"description":"CronJob represents the configuration of a single cron job.","type":"object","properties":{"apiVersion":{"description":"APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources","type":"string"},"kind":{"description":"Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds","type":"string"},"metadata":{"description":"Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata","default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"},"spec":{"description":"Specification of the desired behavior of a cron job, including the schedule. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status","default":{},"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJobSpec"},"status":{"description":"Current status of a cron job. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status","default":{},"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJobStatus"}},"x-kubernetes-group-version-kind":[{"group":"batch","kind":"CronJob","version":"v1beta1"}]},"io.k8s.api.batch.v1beta1.CronJobList":{"description":"CronJobList is a collection of cron jobs.","type":"object","required":["items"],"properties":{"apiVersion":{"description":"APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources","type":"string"},"items":{"description":"items is the list of CronJobs.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}},"kind":{"description":"Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds","type":"string"},"metadata":{"description":"Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata","default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta"}},"x-kubernetes-group-version-kind":[{"group":"batch","kind":"CronJobList","version":"v1beta1"}]},"io.k8s.api.batch.v1beta1.CronJobSpec":{"description":"CronJobSpec describes how the job execution will look like and when it will actually run.","type":"object","required":["schedule","jobTemplate"],"properties":{"concurrencyPolicy":{"description":"Specifies how to treat concurrent executions of a Job. Valid values are: - \"Allow\" (default): allows CronJobs to run concurrently; - \"Forbid\": forbids concurrent runs, skipping next run if previous run hasn't finished yet; - \"Replace\": cancels currently running job and replaces it with a new one","type":"string"},"failedJobsHistoryLimit":{"description":"The number of failed finished jobs to retain. This is a pointer to distinguish between explicit zero and not specified. Defaults to 1.","type":"integer","format":"int32"},"jobTemplate":{"description":"Specifies the job that will be created when executing a CronJob.","default":{},"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.JobTemplateSpec"},"schedule":{"description":"The schedule in Cron format, see https://en.wikipedia.org/wiki/Cron.","type":"string","default":""},"startingDeadlineSeconds":{"description":"Optional deadline in seconds for starting the job if it misses scheduled time for any reason. Missed jobs executions will be counted as failed ones.","type":"integer","format":"int64"},"successfulJobsHistoryLimit":{"description":"The number of successful finished jobs to retain. This is a pointer to distinguish between explicit zero and not specified. Defaults to 3.","type":"integer","format":"int32"},"suspend":{"description":"This flag tells the controller to suspend subsequent executions, it does not apply to already started executions. Defaults to false.","type":"boolean"}}},"io.k8s.api.batch.v1beta1.CronJobStatus":{"description":"CronJobStatus represents the current state of a cron job.","type":"object","properties":{"active":{"description":"A list of pointers to currently running jobs.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.ObjectReference"},"x-kubernetes-list-type":"atomic"},"lastScheduleTime":{"description":"Information when was the last time the job was successfully scheduled.","$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time"},"lastSuccessfulTime":{"description":"Information when was the last time the job successfully completed.","$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time"}}},"io.k8s.api.batch.v1beta1.JobTemplateSpec":{"description":"JobTemplateSpec describes the data a Job should have when created from a template","type":"object","properties":{"metadata":{"description":"Standard object's metadata of the jobs created from this template. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata","default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"},"spec":{"description":"Specification of the desired behavior of the job. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status","default":{},"$ref":"#/components/schemas/io.k8s.api.batch.v1.JobSpec"}}},"io.k8s.api.core.v1.AWSElasticBlockStoreVolumeSource":{"description":"Represents a Persistent Disk resource in AWS.\n\nAn AWS EBS disk must exist before mounting to a container. The disk must also be in the same AWS zone as the kubelet. An AWS EBS disk can only be mounted as read/write once. AWS EBS volumes support ownership management and SELinux relabeling.","type":"object","required":["volumeID"],"properties":{"fsType":{"description":"fsType is the filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore","type":"string"},"partition":{"description":"partition is the partition in the volume that you want to mount. If omitted, the default is to mount by volume name. Examples: For volume /dev/sda1, you specify the partition as \"1\". Similarly, the volume partition for /dev/sda is \"0\" (or you can leave the property empty).","type":"integer","format":"int32"},"readOnly":{"description":"readOnly value true will force the readOnly setting in VolumeMounts. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore","type":"boolean"},"volumeID":{"description":"volumeID is unique ID of the persistent disk resource in AWS (Amazon EBS volume). More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore","type":"string","default":""}}},"io.k8s.api.core.v1.Affinity":{"description":"Affinity is a group of affinity scheduling rules.","type":"object","properties":{"nodeAffinity":{"description":"Describes node affinity scheduling rules for the pod.","$ref":"#/components/schemas/io.k8s.api.core.v1.NodeAffinity"},"podAffinity":{"description":"Describes pod affinity scheduling rules (e.g. co-locate this pod in the same node, zone, etc. as some other pod(s)).","$ref":"#/components/schemas/io.k8s.api.core.v1.PodAffinity"},"podAntiAffinity":{"description":"Describes pod anti-affinity scheduling rules (e.g. avoid putting this pod in the same node, zone, etc. as some other pod(s)).","$ref":"#/components/schemas/io.k8s.api.core.v1.PodAntiAffinity"}}},"io.k8s.api.core.v1.AzureDiskVolumeSource":{"description":"AzureDisk represents an Azure Data Disk mount on the host and bind mount to the pod.","type":"object","required":["diskName","diskURI"],"properties":{"cachingMode":{"description":"cachingMode is the Host Caching mode: None, Read Only, Read Write.","type":"string"},"diskName":{"description":"diskName is the Name of the data disk in the blob storage","type":"string","default":""},"diskURI":{"description":"diskURI is the URI of data disk in the blob storage","type":"string","default":""},"fsType":{"description":"fsType is Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.","type":"string"},"kind":{"description":"kind expected values are Shared: multiple blob disks per storage account Dedicated: single blob disk per storage account Managed: azure managed data disk (only in managed availability set). defaults to shared","type":"string"},"readOnly":{"description":"readOnly Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.","type":"boolean"}}},"io.k8s.api.core.v1.AzureFileVolumeSource":{"description":"AzureFile represents an Azure File Service mount on the host and bind mount to the pod.","type":"object","required":["secretName","shareName"],"properties":{"readOnly":{"description":"readOnly defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.","type":"boolean"},"secretName":{"description":"secretName is the name of secret that contains Azure Storage Account Name and Key","type":"string","default":""},"shareName":{"description":"shareName is the azure share Name","type":"string","default":""}}},"io.k8s.api.core.v1.CSIVolumeSource":{"description":"Represents a source location of a volume to mount, managed by an external CSI driver","type":"object","required":["driver"],"properties":{"driver":{"description":"driver is the name of the CSI driver that handles this volume. Consult with your admin for the correct name as registered in the cluster.","type":"string","default":""},"fsType":{"description":"fsType to mount. Ex. \"ext4\", \"xfs\", \"ntfs\". If not provided, the empty value is passed to the associated CSI driver which will determine the default filesystem to apply.","type":"string"},"nodePublishSecretRef":{"description":"nodePublishSecretRef is a reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI NodePublishVolume and NodeUnpublishVolume calls. This field is optional, and may be empty if no secret is required. If the secret object contains more than one secret, all secret references are passed.","$ref":"#/components/schemas/io.k8s.api.core.v1.LocalObjectReference"},"readOnly":{"description":"readOnly specifies a read-only configuration for the volume. Defaults to false (read/write).","type":"boolean"},"volumeAttributes":{"description":"volumeAttributes stores driver-specific properties that are passed to the CSI driver. Consult your driver's documentation for supported values.","type":"object","additionalProperties":{"type":"string","default":""}}}},"io.k8s.api.core.v1.Capabilities":{"description":"Adds and removes POSIX capabilities from running containers.","type":"object","properties":{"add":{"description":"Added capabilities","type":"array","items":{"type":"string","default":""}},"drop":{"description":"Removed capabilities","type":"array","items":{"type":"string","default":""}}}},"io.k8s.api.core.v1.CephFSVolumeSource":{"description":"Represents a Ceph Filesystem mount that lasts the lifetime of a pod Cephfs volumes do not support ownership management or SELinux relabeling.","type":"object","required":["monitors"],"properties":{"monitors":{"description":"monitors is Required: Monitors is a collection of Ceph monitors More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it","type":"array","items":{"type":"string","default":""}},"path":{"description":"path is Optional: Used as the mounted root, rather than the full Ceph tree, default is /","type":"string"},"readOnly":{"description":"readOnly is Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it","type":"boolean"},"secretFile":{"description":"secretFile is Optional: SecretFile is the path to key ring for User, default is /etc/ceph/user.secret More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it","type":"string"},"secretRef":{"description":"secretRef is Optional: SecretRef is reference to the authentication secret for User, default is empty. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it","$ref":"#/components/schemas/io.k8s.api.core.v1.LocalObjectReference"},"user":{"description":"user is optional: User is the rados user name, default is admin More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it","type":"string"}}},"io.k8s.api.core.v1.CinderVolumeSource":{"description":"Represents a cinder volume resource in Openstack. A Cinder volume must exist before mounting to a container. The volume must also be in the same region as the kubelet. Cinder volumes support ownership management and SELinux relabeling.","type":"object","required":["volumeID"],"properties":{"fsType":{"description":"fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://examples.k8s.io/mysql-cinder-pd/README.md","type":"string"},"readOnly":{"description":"readOnly defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. More info: https://examples.k8s.io/mysql-cinder-pd/README.md","type":"boolean"},"secretRef":{"description":"secretRef is optional: points to a secret object containing parameters used to connect to OpenStack.","$ref":"#/components/schemas/io.k8s.api.core.v1.LocalObjectReference"},"volumeID":{"description":"volumeID used to identify the volume in cinder. More info: https://examples.k8s.io/mysql-cinder-pd/README.md","type":"string","default":""}}},"io.k8s.api.core.v1.ConfigMapEnvSource":{"description":"ConfigMapEnvSource selects a ConfigMap to populate the environment variables with.\n\nThe contents of the target ConfigMap's Data field will represent the key-value pairs as environment variables.","type":"object","properties":{"name":{"description":"Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names","type":"string"},"optional":{"description":"Specify whether the ConfigMap must be defined","type":"boolean"}}},"io.k8s.api.core.v1.ConfigMapKeySelector":{"description":"Selects a key from a ConfigMap.","type":"object","required":["key"],"properties":{"key":{"description":"The key to select.","type":"string","default":""},"name":{"description":"Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names","type":"string"},"optional":{"description":"Specify whether the ConfigMap or its key must be defined","type":"boolean"}},"x-kubernetes-map-type":"atomic"},"io.k8s.api.core.v1.ConfigMapProjection":{"description":"Adapts a ConfigMap into a projected volume.\n\nThe contents of the target ConfigMap's Data field will be presented in a projected volume as files using the keys in the Data field as the file names, unless the items element is populated with specific mappings of keys to paths. Note that this is identical to a configmap volume source without the default mode.","type":"object","properties":{"items":{"description":"items if unspecified, each key-value pair in the Data field of the referenced ConfigMap will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the ConfigMap, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.KeyToPath"}},"name":{"description":"Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names","type":"string"},"optional":{"description":"optional specify whether the ConfigMap or its keys must be defined","type":"boolean"}}},"io.k8s.api.core.v1.ConfigMapVolumeSource":{"description":"Adapts a ConfigMap into a volume.\n\nThe contents of the target ConfigMap's Data field will be presented in a volume as files using the keys in the Data field as the file names, unless the items element is populated with specific mappings of keys to paths. ConfigMap volumes support ownership management and SELinux relabeling.","type":"object","properties":{"defaultMode":{"description":"defaultMode is optional: mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.","type":"integer","format":"int32"},"items":{"description":"items if unspecified, each key-value pair in the Data field of the referenced ConfigMap will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the ConfigMap, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.KeyToPath"}},"name":{"description":"Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names","type":"string"},"optional":{"description":"optional specify whether the ConfigMap or its keys must be defined","type":"boolean"}}},"io.k8s.api.core.v1.Container":{"description":"A single application container that you want to run within a pod.","type":"object","required":["name"],"properties":{"args":{"description":"Arguments to the entrypoint. The container image's CMD is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \"$$(VAR_NAME)\" will produce the string literal \"$(VAR_NAME)\". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell","type":"array","items":{"type":"string","default":""}},"command":{"description":"Entrypoint array. Not executed within a shell. The container image's ENTRYPOINT is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \"$$(VAR_NAME)\" will produce the string literal \"$(VAR_NAME)\". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell","type":"array","items":{"type":"string","default":""}},"env":{"description":"List of environment variables to set in the container. Cannot be updated.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.EnvVar"},"x-kubernetes-patch-merge-key":"name","x-kubernetes-patch-strategy":"merge"},"envFrom":{"description":"List of sources to populate environment variables in the container. The keys defined within a source must be a C_IDENTIFIER. All invalid keys will be reported as an event when the container is starting. When a key exists in multiple sources, the value associated with the last source will take precedence. Values defined by an Env with a duplicate key will take precedence. Cannot be updated.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.EnvFromSource"}},"image":{"description":"Container image name. More info: https://kubernetes.io/docs/concepts/containers/images This field is optional to allow higher level config management to default or override container images in workload controllers like Deployments and StatefulSets.","type":"string"},"imagePullPolicy":{"description":"Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. Cannot be updated. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images\n\n","type":"string"},"lifecycle":{"description":"Actions that the management system should take in response to container lifecycle events. Cannot be updated.","$ref":"#/components/schemas/io.k8s.api.core.v1.Lifecycle"},"livenessProbe":{"description":"Periodic probe of container liveness. Container will be restarted if the probe fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes","$ref":"#/components/schemas/io.k8s.api.core.v1.Probe"},"name":{"description":"Name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated.","type":"string","default":""},"ports":{"description":"List of ports to expose from the container. Exposing a port here gives the system additional information about the network connections a container uses, but is primarily informational. Not specifying a port here DOES NOT prevent that port from being exposed. Any port which is listening on the default \"0.0.0.0\" address inside a container will be accessible from the network. Cannot be updated.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.ContainerPort"},"x-kubernetes-list-map-keys":["containerPort","protocol"],"x-kubernetes-list-type":"map","x-kubernetes-patch-merge-key":"containerPort","x-kubernetes-patch-strategy":"merge"},"readinessProbe":{"description":"Periodic probe of container service readiness. Container will be removed from service endpoints if the probe fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes","$ref":"#/components/schemas/io.k8s.api.core.v1.Probe"},"resources":{"description":"Compute Resources required by this container. Cannot be updated. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/","default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.ResourceRequirements"},"securityContext":{"description":"SecurityContext defines the security options the container should be run with. If set, the fields of SecurityContext override the equivalent fields of PodSecurityContext. More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/","$ref":"#/components/schemas/io.k8s.api.core.v1.SecurityContext"},"startupProbe":{"description":"StartupProbe indicates that the Pod has successfully initialized. If specified, no other probes are executed until this completes successfully. If this probe fails, the Pod will be restarted, just as if the livenessProbe failed. This can be used to provide different probe parameters at the beginning of a Pod's lifecycle, when it might take a long time to load data or warm a cache, than during steady-state operation. This cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes","$ref":"#/components/schemas/io.k8s.api.core.v1.Probe"},"stdin":{"description":"Whether this container should allocate a buffer for stdin in the container runtime. If this is not set, reads from stdin in the container will always result in EOF. Default is false.","type":"boolean"},"stdinOnce":{"description":"Whether the container runtime should close the stdin channel after it has been opened by a single attach. When stdin is true the stdin stream will remain open across multiple attach sessions. If stdinOnce is set to true, stdin is opened on container start, is empty until the first client attaches to stdin, and then remains open and accepts data until the client disconnects, at which time stdin is closed and remains closed until the container is restarted. If this flag is false, a container processes that reads from stdin will never receive an EOF. Default is false","type":"boolean"},"terminationMessagePath":{"description":"Optional: Path at which the file to which the container's termination message will be written is mounted into the container's filesystem. Message written is intended to be brief final status, such as an assertion failure message. Will be truncated by the node if greater than 4096 bytes. The total message length across all containers will be limited to 12kb. Defaults to /dev/termination-log. Cannot be updated.","type":"string"},"terminationMessagePolicy":{"description":"Indicate how the termination message should be populated. File will use the contents of terminationMessagePath to populate the container status message on both success and failure. FallbackToLogsOnError will use the last chunk of container log output if the termination message file is empty and the container exited with an error. The log output is limited to 2048 bytes or 80 lines, whichever is smaller. Defaults to File. Cannot be updated.\n\n","type":"string"},"tty":{"description":"Whether this container should allocate a TTY for itself, also requires 'stdin' to be true. Default is false.","type":"boolean"},"volumeDevices":{"description":"volumeDevices is the list of block devices to be used by the container.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.VolumeDevice"},"x-kubernetes-patch-merge-key":"devicePath","x-kubernetes-patch-strategy":"merge"},"volumeMounts":{"description":"Pod volumes to mount into the container's filesystem. Cannot be updated.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.VolumeMount"},"x-kubernetes-patch-merge-key":"mountPath","x-kubernetes-patch-strategy":"merge"},"workingDir":{"description":"Container's working directory. If not specified, the container runtime's default will be used, which might be configured in the container image. Cannot be updated.","type":"string"}}},"io.k8s.api.core.v1.ContainerPort":{"description":"ContainerPort represents a network port in a single container.","type":"object","required":["containerPort"],"properties":{"containerPort":{"description":"Number of port to expose on the pod's IP address. This must be a valid port number, 0 \u003c x \u003c 65536.","type":"integer","format":"int32","default":0},"hostIP":{"description":"What host IP to bind the external port to.","type":"string"},"hostPort":{"description":"Number of port to expose on the host. If specified, this must be a valid port number, 0 \u003c x \u003c 65536. If HostNetwork is specified, this must match ContainerPort. Most containers do not need this.","type":"integer","format":"int32"},"name":{"description":"If specified, this must be an IANA_SVC_NAME and unique within the pod. Each named port in a pod must have a unique name. Name for the port that can be referred to by services.","type":"string"},"protocol":{"description":"Protocol for port. Must be UDP, TCP, or SCTP. Defaults to \"TCP\".\n\n","type":"string","default":"TCP"}}},"io.k8s.api.core.v1.DownwardAPIProjection":{"description":"Represents downward API info for projecting into a projected volume. Note that this is identical to a downwardAPI volume source without the default mode.","type":"object","properties":{"items":{"description":"Items is a list of DownwardAPIVolume file","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.DownwardAPIVolumeFile"}}}},"io.k8s.api.core.v1.DownwardAPIVolumeFile":{"description":"DownwardAPIVolumeFile represents information to create the file containing the pod field","type":"object","required":["path"],"properties":{"fieldRef":{"description":"Required: Selects a field of the pod: only annotations, labels, name and namespace are supported.","$ref":"#/components/schemas/io.k8s.api.core.v1.ObjectFieldSelector"},"mode":{"description":"Optional: mode bits used to set permissions on this file, must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.","type":"integer","format":"int32"},"path":{"description":"Required: Path is the relative path name of the file to be created. Must not be absolute or contain the '..' path. Must be utf-8 encoded. The first item of the relative path must not start with '..'","type":"string","default":""},"resourceFieldRef":{"description":"Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported.","$ref":"#/components/schemas/io.k8s.api.core.v1.ResourceFieldSelector"}}},"io.k8s.api.core.v1.DownwardAPIVolumeSource":{"description":"DownwardAPIVolumeSource represents a volume containing downward API info. Downward API volumes support ownership management and SELinux relabeling.","type":"object","properties":{"defaultMode":{"description":"Optional: mode bits to use on created files by default. Must be a Optional: mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.","type":"integer","format":"int32"},"items":{"description":"Items is a list of downward API volume file","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.DownwardAPIVolumeFile"}}}},"io.k8s.api.core.v1.EmptyDirVolumeSource":{"description":"Represents an empty directory for a pod. Empty directory volumes support ownership management and SELinux relabeling.","type":"object","properties":{"medium":{"description":"medium represents what type of storage medium should back this directory. The default is \"\" which means to use the node's default medium. Must be an empty string (default) or Memory. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir","type":"string"},"sizeLimit":{"description":"sizeLimit is the total amount of local storage required for this EmptyDir volume. The size limit is also applicable for memory medium. The maximum usage on memory medium EmptyDir would be the minimum value between the SizeLimit specified here and the sum of memory limits of all containers in a pod. The default is nil which means that the limit is undefined. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir","$ref":"#/components/schemas/io.k8s.apimachinery.pkg.api.resource.Quantity"}}},"io.k8s.api.core.v1.EnvFromSource":{"description":"EnvFromSource represents the source of a set of ConfigMaps","type":"object","properties":{"configMapRef":{"description":"The ConfigMap to select from","$ref":"#/components/schemas/io.k8s.api.core.v1.ConfigMapEnvSource"},"prefix":{"description":"An optional identifier to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER.","type":"string"},"secretRef":{"description":"The Secret to select from","$ref":"#/components/schemas/io.k8s.api.core.v1.SecretEnvSource"}}},"io.k8s.api.core.v1.EnvVar":{"description":"EnvVar represents an environment variable present in a Container.","type":"object","required":["name"],"properties":{"name":{"description":"Name of the environment variable. Must be a C_IDENTIFIER.","type":"string","default":""},"value":{"description":"Variable references $(VAR_NAME) are expanded using the previously defined environment variables in the container and any service environment variables. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \"$$(VAR_NAME)\" will produce the string literal \"$(VAR_NAME)\". Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to \"\".","type":"string"},"valueFrom":{"description":"Source for the environment variable's value. Cannot be used if value is not empty.","$ref":"#/components/schemas/io.k8s.api.core.v1.EnvVarSource"}}},"io.k8s.api.core.v1.EnvVarSource":{"description":"EnvVarSource represents a source for the value of an EnvVar.","type":"object","properties":{"configMapKeyRef":{"description":"Selects a key of a ConfigMap.","$ref":"#/components/schemas/io.k8s.api.core.v1.ConfigMapKeySelector"},"fieldRef":{"description":"Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['\u003cKEY\u003e']`, `metadata.annotations['\u003cKEY\u003e']`, spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.","$ref":"#/components/schemas/io.k8s.api.core.v1.ObjectFieldSelector"},"resourceFieldRef":{"description":"Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.","$ref":"#/components/schemas/io.k8s.api.core.v1.ResourceFieldSelector"},"secretKeyRef":{"description":"Selects a key of a secret in the pod's namespace","$ref":"#/components/schemas/io.k8s.api.core.v1.SecretKeySelector"}}},"io.k8s.api.core.v1.EphemeralContainer":{"description":"An EphemeralContainer is a temporary container that you may add to an existing Pod for user-initiated activities such as debugging. Ephemeral containers have no resource or scheduling guarantees, and they will not be restarted when they exit or when a Pod is removed or restarted. The kubelet may evict a Pod if an ephemeral container causes the Pod to exceed its resource allocation.\n\nTo add an ephemeral container, use the ephemeralcontainers subresource of an existing Pod. Ephemeral containers may not be removed or restarted.","type":"object","required":["name"],"properties":{"args":{"description":"Arguments to the entrypoint. The image's CMD is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \"$$(VAR_NAME)\" will produce the string literal \"$(VAR_NAME)\". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell","type":"array","items":{"type":"string","default":""}},"command":{"description":"Entrypoint array. Not executed within a shell. The image's ENTRYPOINT is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \"$$(VAR_NAME)\" will produce the string literal \"$(VAR_NAME)\". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell","type":"array","items":{"type":"string","default":""}},"env":{"description":"List of environment variables to set in the container. Cannot be updated.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.EnvVar"},"x-kubernetes-patch-merge-key":"name","x-kubernetes-patch-strategy":"merge"},"envFrom":{"description":"List of sources to populate environment variables in the container. The keys defined within a source must be a C_IDENTIFIER. All invalid keys will be reported as an event when the container is starting. When a key exists in multiple sources, the value associated with the last source will take precedence. Values defined by an Env with a duplicate key will take precedence. Cannot be updated.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.EnvFromSource"}},"image":{"description":"Container image name. More info: https://kubernetes.io/docs/concepts/containers/images","type":"string"},"imagePullPolicy":{"description":"Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. Cannot be updated. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images\n\n","type":"string"},"lifecycle":{"description":"Lifecycle is not allowed for ephemeral containers.","$ref":"#/components/schemas/io.k8s.api.core.v1.Lifecycle"},"livenessProbe":{"description":"Probes are not allowed for ephemeral containers.","$ref":"#/components/schemas/io.k8s.api.core.v1.Probe"},"name":{"description":"Name of the ephemeral container specified as a DNS_LABEL. This name must be unique among all containers, init containers and ephemeral containers.","type":"string","default":""},"ports":{"description":"Ports are not allowed for ephemeral containers.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.ContainerPort"},"x-kubernetes-list-map-keys":["containerPort","protocol"],"x-kubernetes-list-type":"map","x-kubernetes-patch-merge-key":"containerPort","x-kubernetes-patch-strategy":"merge"},"readinessProbe":{"description":"Probes are not allowed for ephemeral containers.","$ref":"#/components/schemas/io.k8s.api.core.v1.Probe"},"resources":{"description":"Resources are not allowed for ephemeral containers. Ephemeral containers use spare resources already allocated to the pod.","default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.ResourceRequirements"},"securityContext":{"description":"Optional: SecurityContext defines the security options the ephemeral container should be run with. If set, the fields of SecurityContext override the equivalent fields of PodSecurityContext.","$ref":"#/components/schemas/io.k8s.api.core.v1.SecurityContext"},"startupProbe":{"description":"Probes are not allowed for ephemeral containers.","$ref":"#/components/schemas/io.k8s.api.core.v1.Probe"},"stdin":{"description":"Whether this container should allocate a buffer for stdin in the container runtime. If this is not set, reads from stdin in the container will always result in EOF. Default is false.","type":"boolean"},"stdinOnce":{"description":"Whether the container runtime should close the stdin channel after it has been opened by a single attach. When stdin is true the stdin stream will remain open across multiple attach sessions. If stdinOnce is set to true, stdin is opened on container start, is empty until the first client attaches to stdin, and then remains open and accepts data until the client disconnects, at which time stdin is closed and remains closed until the container is restarted. If this flag is false, a container processes that reads from stdin will never receive an EOF. Default is false","type":"boolean"},"targetContainerName":{"description":"If set, the name of the container from PodSpec that this ephemeral container targets. The ephemeral container will be run in the namespaces (IPC, PID, etc) of this container. If not set then the ephemeral container uses the namespaces configured in the Pod spec.\n\nThe container runtime must implement support for this feature. If the runtime does not support namespace targeting then the result of setting this field is undefined.","type":"string"},"terminationMessagePath":{"description":"Optional: Path at which the file to which the container's termination message will be written is mounted into the container's filesystem. Message written is intended to be brief final status, such as an assertion failure message. Will be truncated by the node if greater than 4096 bytes. The total message length across all containers will be limited to 12kb. Defaults to /dev/termination-log. Cannot be updated.","type":"string"},"terminationMessagePolicy":{"description":"Indicate how the termination message should be populated. File will use the contents of terminationMessagePath to populate the container status message on both success and failure. FallbackToLogsOnError will use the last chunk of container log output if the termination message file is empty and the container exited with an error. The log output is limited to 2048 bytes or 80 lines, whichever is smaller. Defaults to File. Cannot be updated.\n\n","type":"string"},"tty":{"description":"Whether this container should allocate a TTY for itself, also requires 'stdin' to be true. Default is false.","type":"boolean"},"volumeDevices":{"description":"volumeDevices is the list of block devices to be used by the container.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.VolumeDevice"},"x-kubernetes-patch-merge-key":"devicePath","x-kubernetes-patch-strategy":"merge"},"volumeMounts":{"description":"Pod volumes to mount into the container's filesystem. Subpath mounts are not allowed for ephemeral containers. Cannot be updated.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.VolumeMount"},"x-kubernetes-patch-merge-key":"mountPath","x-kubernetes-patch-strategy":"merge"},"workingDir":{"description":"Container's working directory. If not specified, the container runtime's default will be used, which might be configured in the container image. Cannot be updated.","type":"string"}}},"io.k8s.api.core.v1.EphemeralVolumeSource":{"description":"Represents an ephemeral volume that is handled by a normal storage driver.","type":"object","properties":{"volumeClaimTemplate":{"description":"Will be used to create a stand-alone PVC to provision the volume. The pod in which this EphemeralVolumeSource is embedded will be the owner of the PVC, i.e. the PVC will be deleted together with the pod. The name of the PVC will be `\u003cpod name\u003e-\u003cvolume name\u003e` where `\u003cvolume name\u003e` is the name from the `PodSpec.Volumes` array entry. Pod validation will reject the pod if the concatenated name is not valid for a PVC (for example, too long).\n\nAn existing PVC with that name that is not owned by the pod will *not* be used for the pod to avoid using an unrelated volume by mistake. Starting the pod is then blocked until the unrelated PVC is removed. If such a pre-created PVC is meant to be used by the pod, the PVC has to updated with an owner reference to the pod once the pod exists. Normally this should not be necessary, but it may be useful when manually reconstructing a broken cluster.\n\nThis field is read-only and no changes will be made by Kubernetes to the PVC after it has been created.\n\nRequired, must not be nil.","$ref":"#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaimTemplate"}}},"io.k8s.api.core.v1.ExecAction":{"description":"ExecAction describes a \"run in container\" action.","type":"object","properties":{"command":{"description":"Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is simply exec'd, it is not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy.","type":"array","items":{"type":"string","default":""}}}},"io.k8s.api.core.v1.FCVolumeSource":{"description":"Represents a Fibre Channel volume. Fibre Channel volumes can only be mounted as read/write once. Fibre Channel volumes support ownership management and SELinux relabeling.","type":"object","properties":{"fsType":{"description":"fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.","type":"string"},"lun":{"description":"lun is Optional: FC target lun number","type":"integer","format":"int32"},"readOnly":{"description":"readOnly is Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.","type":"boolean"},"targetWWNs":{"description":"targetWWNs is Optional: FC target worldwide names (WWNs)","type":"array","items":{"type":"string","default":""}},"wwids":{"description":"wwids Optional: FC volume world wide identifiers (wwids) Either wwids or combination of targetWWNs and lun must be set, but not both simultaneously.","type":"array","items":{"type":"string","default":""}}}},"io.k8s.api.core.v1.FlexVolumeSource":{"description":"FlexVolume represents a generic volume resource that is provisioned/attached using an exec based plugin.","type":"object","required":["driver"],"properties":{"driver":{"description":"driver is the name of the driver to use for this volume.","type":"string","default":""},"fsType":{"description":"fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". The default filesystem depends on FlexVolume script.","type":"string"},"options":{"description":"options is Optional: this field holds extra command options if any.","type":"object","additionalProperties":{"type":"string","default":""}},"readOnly":{"description":"readOnly is Optional: defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.","type":"boolean"},"secretRef":{"description":"secretRef is Optional: secretRef is reference to the secret object containing sensitive information to pass to the plugin scripts. This may be empty if no secret object is specified. If the secret object contains more than one secret, all secrets are passed to the plugin scripts.","$ref":"#/components/schemas/io.k8s.api.core.v1.LocalObjectReference"}}},"io.k8s.api.core.v1.FlockerVolumeSource":{"description":"Represents a Flocker volume mounted by the Flocker agent. One and only one of datasetName and datasetUUID should be set. Flocker volumes do not support ownership management or SELinux relabeling.","type":"object","properties":{"datasetName":{"description":"datasetName is Name of the dataset stored as metadata -\u003e name on the dataset for Flocker should be considered as deprecated","type":"string"},"datasetUUID":{"description":"datasetUUID is the UUID of the dataset. This is unique identifier of a Flocker dataset","type":"string"}}},"io.k8s.api.core.v1.GCEPersistentDiskVolumeSource":{"description":"Represents a Persistent Disk resource in Google Compute Engine.\n\nA GCE PD must exist before mounting to a container. The disk must also be in the same GCE project and zone as the kubelet. A GCE PD can only be mounted as read/write once or read-only many times. GCE PDs support ownership management and SELinux relabeling.","type":"object","required":["pdName"],"properties":{"fsType":{"description":"fsType is filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk","type":"string"},"partition":{"description":"partition is the partition in the volume that you want to mount. If omitted, the default is to mount by volume name. Examples: For volume /dev/sda1, you specify the partition as \"1\". Similarly, the volume partition for /dev/sda is \"0\" (or you can leave the property empty). More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk","type":"integer","format":"int32"},"pdName":{"description":"pdName is unique name of the PD resource in GCE. Used to identify the disk in GCE. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk","type":"string","default":""},"readOnly":{"description":"readOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk","type":"boolean"}}},"io.k8s.api.core.v1.GRPCAction":{"type":"object","required":["port"],"properties":{"port":{"description":"Port number of the gRPC service. Number must be in the range 1 to 65535.","type":"integer","format":"int32","default":0},"service":{"description":"Service is the name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md).\n\nIf this is not specified, the default behavior is defined by gRPC.","type":"string","default":""}}},"io.k8s.api.core.v1.GitRepoVolumeSource":{"description":"Represents a volume that is populated with the contents of a git repository. Git repo volumes do not support ownership management. Git repo volumes support SELinux relabeling.\n\nDEPRECATED: GitRepo is deprecated. To provision a container with a git repo, mount an EmptyDir into an InitContainer that clones the repo using git, then mount the EmptyDir into the Pod's container.","type":"object","required":["repository"],"properties":{"directory":{"description":"directory is the target directory name. Must not contain or start with '..'. If '.' is supplied, the volume directory will be the git repository. Otherwise, if specified, the volume will contain the git repository in the subdirectory with the given name.","type":"string"},"repository":{"description":"repository is the URL","type":"string","default":""},"revision":{"description":"revision is the commit hash for the specified revision.","type":"string"}}},"io.k8s.api.core.v1.GlusterfsVolumeSource":{"description":"Represents a Glusterfs mount that lasts the lifetime of a pod. Glusterfs volumes do not support ownership management or SELinux relabeling.","type":"object","required":["endpoints","path"],"properties":{"endpoints":{"description":"endpoints is the endpoint name that details Glusterfs topology. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod","type":"string","default":""},"path":{"description":"path is the Glusterfs volume path. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod","type":"string","default":""},"readOnly":{"description":"readOnly here will force the Glusterfs volume to be mounted with read-only permissions. Defaults to false. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod","type":"boolean"}}},"io.k8s.api.core.v1.HTTPGetAction":{"description":"HTTPGetAction describes an action based on HTTP Get requests.","type":"object","required":["port"],"properties":{"host":{"description":"Host name to connect to, defaults to the pod IP. You probably want to set \"Host\" in httpHeaders instead.","type":"string"},"httpHeaders":{"description":"Custom headers to set in the request. HTTP allows repeated headers.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.HTTPHeader"}},"path":{"description":"Path to access on the HTTP server.","type":"string"},"port":{"description":"Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME.","default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.util.intstr.IntOrString"},"scheme":{"description":"Scheme to use for connecting to the host. Defaults to HTTP.\n\n","type":"string"}}},"io.k8s.api.core.v1.HTTPHeader":{"description":"HTTPHeader describes a custom header to be used in HTTP probes","type":"object","required":["name","value"],"properties":{"name":{"description":"The header field name","type":"string","default":""},"value":{"description":"The header field value","type":"string","default":""}}},"io.k8s.api.core.v1.HostAlias":{"description":"HostAlias holds the mapping between IP and hostnames that will be injected as an entry in the pod's hosts file.","type":"object","properties":{"hostnames":{"description":"Hostnames for the above IP address.","type":"array","items":{"type":"string","default":""}},"ip":{"description":"IP address of the host file entry.","type":"string"}}},"io.k8s.api.core.v1.HostPathVolumeSource":{"description":"Represents a host path mapped into a pod. Host path volumes do not support ownership management or SELinux relabeling.","type":"object","required":["path"],"properties":{"path":{"description":"path of the directory on the host. If the path is a symlink, it will follow the link to the real path. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath","type":"string","default":""},"type":{"description":"type for HostPath Volume Defaults to \"\" More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath","type":"string"}}},"io.k8s.api.core.v1.ISCSIVolumeSource":{"description":"Represents an ISCSI disk. ISCSI volumes can only be mounted as read/write once. ISCSI volumes support ownership management and SELinux relabeling.","type":"object","required":["targetPortal","iqn","lun"],"properties":{"chapAuthDiscovery":{"description":"chapAuthDiscovery defines whether support iSCSI Discovery CHAP authentication","type":"boolean"},"chapAuthSession":{"description":"chapAuthSession defines whether support iSCSI Session CHAP authentication","type":"boolean"},"fsType":{"description":"fsType is the filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#iscsi","type":"string"},"initiatorName":{"description":"initiatorName is the custom iSCSI Initiator Name. If initiatorName is specified with iscsiInterface simultaneously, new iSCSI interface \u003ctarget portal\u003e:\u003cvolume name\u003e will be created for the connection.","type":"string"},"iqn":{"description":"iqn is the target iSCSI Qualified Name.","type":"string","default":""},"iscsiInterface":{"description":"iscsiInterface is the interface Name that uses an iSCSI transport. Defaults to 'default' (tcp).","type":"string"},"lun":{"description":"lun represents iSCSI Target Lun number.","type":"integer","format":"int32","default":0},"portals":{"description":"portals is the iSCSI Target Portal List. The portal is either an IP or ip_addr:port if the port is other than default (typically TCP ports 860 and 3260).","type":"array","items":{"type":"string","default":""}},"readOnly":{"description":"readOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false.","type":"boolean"},"secretRef":{"description":"secretRef is the CHAP Secret for iSCSI target and initiator authentication","$ref":"#/components/schemas/io.k8s.api.core.v1.LocalObjectReference"},"targetPortal":{"description":"targetPortal is iSCSI Target Portal. The Portal is either an IP or ip_addr:port if the port is other than default (typically TCP ports 860 and 3260).","type":"string","default":""}}},"io.k8s.api.core.v1.KeyToPath":{"description":"Maps a string key to a path within a volume.","type":"object","required":["key","path"],"properties":{"key":{"description":"key is the key to project.","type":"string","default":""},"mode":{"description":"mode is Optional: mode bits used to set permissions on this file. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.","type":"integer","format":"int32"},"path":{"description":"path is the relative path of the file to map the key to. May not be an absolute path. May not contain the path element '..'. May not start with the string '..'.","type":"string","default":""}}},"io.k8s.api.core.v1.Lifecycle":{"description":"Lifecycle describes actions that the management system should take in response to container lifecycle events. For the PostStart and PreStop lifecycle handlers, management of the container blocks until the action is complete, unless the container process fails, in which case the handler is aborted.","type":"object","properties":{"postStart":{"description":"PostStart is called immediately after a container is created. If the handler fails, the container is terminated and restarted according to its restart policy. Other management of the container blocks until the hook completes. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks","$ref":"#/components/schemas/io.k8s.api.core.v1.LifecycleHandler"},"preStop":{"description":"PreStop is called immediately before a container is terminated due to an API request or management event such as liveness/startup probe failure, preemption, resource contention, etc. The handler is not called if the container crashes or exits. The Pod's termination grace period countdown begins before the PreStop hook is executed. Regardless of the outcome of the handler, the container will eventually terminate within the Pod's termination grace period (unless delayed by finalizers). Other management of the container blocks until the hook completes or until the termination grace period is reached. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks","$ref":"#/components/schemas/io.k8s.api.core.v1.LifecycleHandler"}}},"io.k8s.api.core.v1.LifecycleHandler":{"description":"LifecycleHandler defines a specific action that should be taken in a lifecycle hook. One and only one of the fields, except TCPSocket must be specified.","type":"object","properties":{"exec":{"description":"Exec specifies the action to take.","$ref":"#/components/schemas/io.k8s.api.core.v1.ExecAction"},"httpGet":{"description":"HTTPGet specifies the http request to perform.","$ref":"#/components/schemas/io.k8s.api.core.v1.HTTPGetAction"},"tcpSocket":{"description":"Deprecated. TCPSocket is NOT supported as a LifecycleHandler and kept for the backward compatibility. There are no validation of this field and lifecycle hooks will fail in runtime when tcp handler is specified.","$ref":"#/components/schemas/io.k8s.api.core.v1.TCPSocketAction"}}},"io.k8s.api.core.v1.LocalObjectReference":{"description":"LocalObjectReference contains enough information to let you locate the referenced object inside the same namespace.","type":"object","properties":{"name":{"description":"Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names","type":"string"}},"x-kubernetes-map-type":"atomic"},"io.k8s.api.core.v1.NFSVolumeSource":{"description":"Represents an NFS mount that lasts the lifetime of a pod. NFS volumes do not support ownership management or SELinux relabeling.","type":"object","required":["server","path"],"properties":{"path":{"description":"path that is exported by the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs","type":"string","default":""},"readOnly":{"description":"readOnly here will force the NFS export to be mounted with read-only permissions. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs","type":"boolean"},"server":{"description":"server is the hostname or IP address of the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs","type":"string","default":""}}},"io.k8s.api.core.v1.NodeAffinity":{"description":"Node affinity is a group of node affinity scheduling rules.","type":"object","properties":{"preferredDuringSchedulingIgnoredDuringExecution":{"description":"The scheduler will prefer to schedule pods to nodes that satisfy the affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding \"weight\" to the sum if the node matches the corresponding matchExpressions; the node(s) with the highest sum are the most preferred.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.PreferredSchedulingTerm"}},"requiredDuringSchedulingIgnoredDuringExecution":{"description":"If the affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to an update), the system may or may not try to eventually evict the pod from its node.","$ref":"#/components/schemas/io.k8s.api.core.v1.NodeSelector"}}},"io.k8s.api.core.v1.NodeSelector":{"description":"A node selector represents the union of the results of one or more label queries over a set of nodes; that is, it represents the OR of the selectors represented by the node selector terms.","type":"object","required":["nodeSelectorTerms"],"properties":{"nodeSelectorTerms":{"description":"Required. A list of node selector terms. The terms are ORed.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.NodeSelectorTerm"}}},"x-kubernetes-map-type":"atomic"},"io.k8s.api.core.v1.NodeSelectorRequirement":{"description":"A node selector requirement is a selector that contains values, a key, and an operator that relates the key and values.","type":"object","required":["key","operator"],"properties":{"key":{"description":"The label key that the selector applies to.","type":"string","default":""},"operator":{"description":"Represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.\n\n","type":"string","default":""},"values":{"description":"An array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. If the operator is Gt or Lt, the values array must have a single element, which will be interpreted as an integer. This array is replaced during a strategic merge patch.","type":"array","items":{"type":"string","default":""}}}},"io.k8s.api.core.v1.NodeSelectorTerm":{"description":"A null or empty node selector term matches no objects. The requirements of them are ANDed. The TopologySelectorTerm type implements a subset of the NodeSelectorTerm.","type":"object","properties":{"matchExpressions":{"description":"A list of node selector requirements by node's labels.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.NodeSelectorRequirement"}},"matchFields":{"description":"A list of node selector requirements by node's fields.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.NodeSelectorRequirement"}}},"x-kubernetes-map-type":"atomic"},"io.k8s.api.core.v1.ObjectFieldSelector":{"description":"ObjectFieldSelector selects an APIVersioned field of an object.","type":"object","required":["fieldPath"],"properties":{"apiVersion":{"description":"Version of the schema the FieldPath is written in terms of, defaults to \"v1\".","type":"string"},"fieldPath":{"description":"Path of the field to select in the specified API version.","type":"string","default":""}},"x-kubernetes-map-type":"atomic"},"io.k8s.api.core.v1.ObjectReference":{"description":"ObjectReference contains enough information to let you inspect or modify the referred object.","type":"object","properties":{"apiVersion":{"description":"API version of the referent.","type":"string"},"fieldPath":{"description":"If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: \"spec.containers{name}\" (where \"name\" refers to the name of the container that triggered the event) or if no container name is specified \"spec.containers[2]\" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object.","type":"string"},"kind":{"description":"Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds","type":"string"},"name":{"description":"Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names","type":"string"},"namespace":{"description":"Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/","type":"string"},"resourceVersion":{"description":"Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency","type":"string"},"uid":{"description":"UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids","type":"string"}},"x-kubernetes-map-type":"atomic"},"io.k8s.api.core.v1.PersistentVolumeClaimSpec":{"description":"PersistentVolumeClaimSpec describes the common attributes of storage devices and allows a Source for provider-specific attributes","type":"object","properties":{"accessModes":{"description":"accessModes contains the desired access modes the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1","type":"array","items":{"type":"string","default":""}},"dataSource":{"description":"dataSource field can be used to specify either: * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot) * An existing PVC (PersistentVolumeClaim) If the provisioner or an external controller can support the specified data source, it will create a new volume based on the contents of the specified data source. If the AnyVolumeDataSource feature gate is enabled, this field will always have the same contents as the DataSourceRef field.","$ref":"#/components/schemas/io.k8s.api.core.v1.TypedLocalObjectReference"},"dataSourceRef":{"description":"dataSourceRef specifies the object from which to populate the volume with data, if a non-empty volume is desired. This may be any local object from a non-empty API group (non core object) or a PersistentVolumeClaim object. When this field is specified, volume binding will only succeed if the type of the specified object matches some installed volume populator or dynamic provisioner. This field will replace the functionality of the DataSource field and as such if both fields are non-empty, they must have the same value. For backwards compatibility, both fields (DataSource and DataSourceRef) will be set to the same value automatically if one of them is empty and the other is non-empty. There are two important differences between DataSource and DataSourceRef: * While DataSource only allows two specific types of objects, DataSourceRef\n allows any non-core object, as well as PersistentVolumeClaim objects.\n* While DataSource ignores disallowed values (dropping them), DataSourceRef\n preserves all values, and generates an error if a disallowed value is\n specified.\n(Alpha) Using this field requires the AnyVolumeDataSource feature gate to be enabled.","$ref":"#/components/schemas/io.k8s.api.core.v1.TypedLocalObjectReference"},"resources":{"description":"resources represents the minimum resources the volume should have. If RecoverVolumeExpansionFailure feature is enabled users are allowed to specify resource requirements that are lower than previous value but must still be higher than capacity recorded in the status field of the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources","default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.ResourceRequirements"},"selector":{"description":"selector is a label query over volumes to consider for binding.","$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector"},"storageClassName":{"description":"storageClassName is the name of the StorageClass required by the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1","type":"string"},"volumeMode":{"description":"volumeMode defines what type of volume is required by the claim. Value of Filesystem is implied when not included in claim spec.","type":"string"},"volumeName":{"description":"volumeName is the binding reference to the PersistentVolume backing this claim.","type":"string"}}},"io.k8s.api.core.v1.PersistentVolumeClaimTemplate":{"description":"PersistentVolumeClaimTemplate is used to produce PersistentVolumeClaim objects as part of an EphemeralVolumeSource.","type":"object","required":["spec"],"properties":{"metadata":{"description":"May contain labels and annotations that will be copied into the PVC when creating it. No other fields are allowed and will be rejected during validation.","default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"},"spec":{"description":"The specification for the PersistentVolumeClaim. The entire content is copied unchanged into the PVC that gets created from this template. The same fields as in a PersistentVolumeClaim are also valid here.","default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaimSpec"}}},"io.k8s.api.core.v1.PersistentVolumeClaimVolumeSource":{"description":"PersistentVolumeClaimVolumeSource references the user's PVC in the same namespace. This volume finds the bound PV and mounts that volume for the pod. A PersistentVolumeClaimVolumeSource is, essentially, a wrapper around another type of volume that is owned by someone else (the system).","type":"object","required":["claimName"],"properties":{"claimName":{"description":"claimName is the name of a PersistentVolumeClaim in the same namespace as the pod using this volume. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims","type":"string","default":""},"readOnly":{"description":"readOnly Will force the ReadOnly setting in VolumeMounts. Default false.","type":"boolean"}}},"io.k8s.api.core.v1.PhotonPersistentDiskVolumeSource":{"description":"Represents a Photon Controller persistent disk resource.","type":"object","required":["pdID"],"properties":{"fsType":{"description":"fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.","type":"string"},"pdID":{"description":"pdID is the ID that identifies Photon Controller persistent disk","type":"string","default":""}}},"io.k8s.api.core.v1.PodAffinity":{"description":"Pod affinity is a group of inter pod affinity scheduling rules.","type":"object","properties":{"preferredDuringSchedulingIgnoredDuringExecution":{"description":"The scheduler will prefer to schedule pods to nodes that satisfy the affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding \"weight\" to the sum if the node has pods which matches the corresponding podAffinityTerm; the node(s) with the highest sum are the most preferred.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.WeightedPodAffinityTerm"}},"requiredDuringSchedulingIgnoredDuringExecution":{"description":"If the affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to a pod label update), the system may or may not try to eventually evict the pod from its node. When there are multiple elements, the lists of nodes corresponding to each podAffinityTerm are intersected, i.e. all terms must be satisfied.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.PodAffinityTerm"}}}},"io.k8s.api.core.v1.PodAffinityTerm":{"description":"Defines a set of pods (namely those matching the labelSelector relative to the given namespace(s)) that this pod should be co-located (affinity) or not co-located (anti-affinity) with, where co-located is defined as running on a node whose value of the label with key \u003ctopologyKey\u003e matches that of any node on which a pod of the set of pods is running","type":"object","required":["topologyKey"],"properties":{"labelSelector":{"description":"A label query over a set of resources, in this case pods.","$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector"},"namespaceSelector":{"description":"A label query over the set of namespaces that the term applies to. The term is applied to the union of the namespaces selected by this field and the ones listed in the namespaces field. null selector and null or empty namespaces list means \"this pod's namespace\". An empty selector ({}) matches all namespaces. This field is beta-level and is only honored when PodAffinityNamespaceSelector feature is enabled.","$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector"},"namespaces":{"description":"namespaces specifies a static list of namespace names that the term applies to. The term is applied to the union of the namespaces listed in this field and the ones selected by namespaceSelector. null or empty namespaces list and null namespaceSelector means \"this pod's namespace\"","type":"array","items":{"type":"string","default":""}},"topologyKey":{"description":"This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching the labelSelector in the specified namespaces, where co-located is defined as running on a node whose value of the label with key topologyKey matches that of any node on which any of the selected pods is running. Empty topologyKey is not allowed.","type":"string","default":""}}},"io.k8s.api.core.v1.PodAntiAffinity":{"description":"Pod anti affinity is a group of inter pod anti affinity scheduling rules.","type":"object","properties":{"preferredDuringSchedulingIgnoredDuringExecution":{"description":"The scheduler will prefer to schedule pods to nodes that satisfy the anti-affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling anti-affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding \"weight\" to the sum if the node has pods which matches the corresponding podAffinityTerm; the node(s) with the highest sum are the most preferred.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.WeightedPodAffinityTerm"}},"requiredDuringSchedulingIgnoredDuringExecution":{"description":"If the anti-affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the anti-affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to a pod label update), the system may or may not try to eventually evict the pod from its node. When there are multiple elements, the lists of nodes corresponding to each podAffinityTerm are intersected, i.e. all terms must be satisfied.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.PodAffinityTerm"}}}},"io.k8s.api.core.v1.PodDNSConfig":{"description":"PodDNSConfig defines the DNS parameters of a pod in addition to those generated from DNSPolicy.","type":"object","properties":{"nameservers":{"description":"A list of DNS name server IP addresses. This will be appended to the base nameservers generated from DNSPolicy. Duplicated nameservers will be removed.","type":"array","items":{"type":"string","default":""}},"options":{"description":"A list of DNS resolver options. This will be merged with the base options generated from DNSPolicy. Duplicated entries will be removed. Resolution options given in Options will override those that appear in the base DNSPolicy.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.PodDNSConfigOption"}},"searches":{"description":"A list of DNS search domains for host-name lookup. This will be appended to the base search paths generated from DNSPolicy. Duplicated search paths will be removed.","type":"array","items":{"type":"string","default":""}}}},"io.k8s.api.core.v1.PodDNSConfigOption":{"description":"PodDNSConfigOption defines DNS resolver options of a pod.","type":"object","properties":{"name":{"description":"Required.","type":"string"},"value":{"type":"string"}}},"io.k8s.api.core.v1.PodOS":{"description":"PodOS defines the OS parameters of a pod.","type":"object","required":["name"],"properties":{"name":{"description":"Name is the name of the operating system. The currently supported values are linux and windows. Additional value may be defined in future and can be one of: https://github.com/opencontainers/runtime-spec/blob/master/config.md#platform-specific-configuration Clients should expect to handle additional values and treat unrecognized values in this field as os: null","type":"string","default":""}}},"io.k8s.api.core.v1.PodReadinessGate":{"description":"PodReadinessGate contains the reference to a pod condition","type":"object","required":["conditionType"],"properties":{"conditionType":{"description":"ConditionType refers to a condition in the pod's condition list with matching type.\n\n","type":"string","default":""}}},"io.k8s.api.core.v1.PodSecurityContext":{"description":"PodSecurityContext holds pod-level security attributes and common container settings. Some fields are also present in container.securityContext. Field values of container.securityContext take precedence over field values of PodSecurityContext.","type":"object","properties":{"fsGroup":{"description":"A special supplemental group that applies to all containers in a pod. Some volume types allow the Kubelet to change the ownership of that volume to be owned by the pod:\n\n1. The owning GID will be the FSGroup 2. The setgid bit is set (new files created in the volume will be owned by FSGroup) 3. The permission bits are OR'd with rw-rw----\n\nIf unset, the Kubelet will not modify the ownership and permissions of any volume. Note that this field cannot be set when spec.os.name is windows.","type":"integer","format":"int64"},"fsGroupChangePolicy":{"description":"fsGroupChangePolicy defines behavior of changing ownership and permission of the volume before being exposed inside Pod. This field will only apply to volume types which support fsGroup based ownership(and permissions). It will have no effect on ephemeral volume types such as: secret, configmaps and emptydir. Valid values are \"OnRootMismatch\" and \"Always\". If not specified, \"Always\" is used. Note that this field cannot be set when spec.os.name is windows.","type":"string"},"runAsGroup":{"description":"The GID to run the entrypoint of the container process. Uses runtime default if unset. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container. Note that this field cannot be set when spec.os.name is windows.","type":"integer","format":"int64"},"runAsNonRoot":{"description":"Indicates that the container must run as a non-root user. If true, the Kubelet will validate the image at runtime to ensure that it does not run as UID 0 (root) and fail to start the container if it does. If unset or false, no such validation will be performed. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.","type":"boolean"},"runAsUser":{"description":"The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container. Note that this field cannot be set when spec.os.name is windows.","type":"integer","format":"int64"},"seLinuxOptions":{"description":"The SELinux context to be applied to all containers. If unspecified, the container runtime will allocate a random SELinux context for each container. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container. Note that this field cannot be set when spec.os.name is windows.","$ref":"#/components/schemas/io.k8s.api.core.v1.SELinuxOptions"},"seccompProfile":{"description":"The seccomp options to use by the containers in this pod. Note that this field cannot be set when spec.os.name is windows.","$ref":"#/components/schemas/io.k8s.api.core.v1.SeccompProfile"},"supplementalGroups":{"description":"A list of groups applied to the first process run in each container, in addition to the container's primary GID. If unspecified, no groups will be added to any container. Note that this field cannot be set when spec.os.name is windows.","type":"array","items":{"type":"integer","format":"int64","default":0}},"sysctls":{"description":"Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported sysctls (by the container runtime) might fail to launch. Note that this field cannot be set when spec.os.name is windows.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.Sysctl"}},"windowsOptions":{"description":"The Windows specific settings applied to all containers. If unspecified, the options within a container's SecurityContext will be used. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. Note that this field cannot be set when spec.os.name is linux.","$ref":"#/components/schemas/io.k8s.api.core.v1.WindowsSecurityContextOptions"}}},"io.k8s.api.core.v1.PodSpec":{"description":"PodSpec is a description of a pod.","type":"object","required":["containers"],"properties":{"activeDeadlineSeconds":{"description":"Optional duration in seconds the pod may be active on the node relative to StartTime before the system will actively try to mark it failed and kill associated containers. Value must be a positive integer.","type":"integer","format":"int64"},"affinity":{"description":"If specified, the pod's scheduling constraints","$ref":"#/components/schemas/io.k8s.api.core.v1.Affinity"},"automountServiceAccountToken":{"description":"AutomountServiceAccountToken indicates whether a service account token should be automatically mounted.","type":"boolean"},"containers":{"description":"List of containers belonging to the pod. Containers cannot currently be added or removed. There must be at least one container in a Pod. Cannot be updated.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.Container"},"x-kubernetes-patch-merge-key":"name","x-kubernetes-patch-strategy":"merge"},"dnsConfig":{"description":"Specifies the DNS parameters of a pod. Parameters specified here will be merged to the generated DNS configuration based on DNSPolicy.","$ref":"#/components/schemas/io.k8s.api.core.v1.PodDNSConfig"},"dnsPolicy":{"description":"Set DNS policy for the pod. Defaults to \"ClusterFirst\". Valid values are 'ClusterFirstWithHostNet', 'ClusterFirst', 'Default' or 'None'. DNS parameters given in DNSConfig will be merged with the policy selected with DNSPolicy. To have DNS options set along with hostNetwork, you have to specify DNS policy explicitly to 'ClusterFirstWithHostNet'.\n\n","type":"string"},"enableServiceLinks":{"description":"EnableServiceLinks indicates whether information about services should be injected into pod's environment variables, matching the syntax of Docker links. Optional: Defaults to true.","type":"boolean"},"ephemeralContainers":{"description":"List of ephemeral containers run in this pod. Ephemeral containers may be run in an existing pod to perform user-initiated actions such as debugging. This list cannot be specified when creating a pod, and it cannot be modified by updating the pod spec. In order to add an ephemeral container to an existing pod, use the pod's ephemeralcontainers subresource.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.EphemeralContainer"},"x-kubernetes-patch-merge-key":"name","x-kubernetes-patch-strategy":"merge"},"hostAliases":{"description":"HostAliases is an optional list of hosts and IPs that will be injected into the pod's hosts file if specified. This is only valid for non-hostNetwork pods.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.HostAlias"},"x-kubernetes-patch-merge-key":"ip","x-kubernetes-patch-strategy":"merge"},"hostIPC":{"description":"Use the host's ipc namespace. Optional: Default to false.","type":"boolean"},"hostNetwork":{"description":"Host networking requested for this pod. Use the host's network namespace. If this option is set, the ports that will be used must be specified. Default to false.","type":"boolean"},"hostPID":{"description":"Use the host's pid namespace. Optional: Default to false.","type":"boolean"},"hostname":{"description":"Specifies the hostname of the Pod If not specified, the pod's hostname will be set to a system-defined value.","type":"string"},"imagePullSecrets":{"description":"ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this PodSpec. If specified, these secrets will be passed to individual puller implementations for them to use. For example, in the case of docker, only DockerConfig type secrets are honored. More info: https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.LocalObjectReference"},"x-kubernetes-patch-merge-key":"name","x-kubernetes-patch-strategy":"merge"},"initContainers":{"description":"List of initialization containers belonging to the pod. Init containers are executed in order prior to containers being started. If any init container fails, the pod is considered to have failed and is handled according to its restartPolicy. The name for an init container or normal container must be unique among all containers. Init containers may not have Lifecycle actions, Readiness probes, Liveness probes, or Startup probes. The resourceRequirements of an init container are taken into account during scheduling by finding the highest request/limit for each resource type, and then using the max of of that value or the sum of the normal containers. Limits are applied to init containers in a similar fashion. Init containers cannot currently be added or removed. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.Container"},"x-kubernetes-patch-merge-key":"name","x-kubernetes-patch-strategy":"merge"},"nodeName":{"description":"NodeName is a request to schedule this pod onto a specific node. If it is non-empty, the scheduler simply schedules this pod onto that node, assuming that it fits resource requirements.","type":"string"},"nodeSelector":{"description":"NodeSelector is a selector which must be true for the pod to fit on a node. Selector which must match a node's labels for the pod to be scheduled on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/","type":"object","additionalProperties":{"type":"string","default":""},"x-kubernetes-map-type":"atomic"},"os":{"description":"Specifies the OS of the containers in the pod. Some pod and container fields are restricted if this is set.\n\nIf the OS field is set to linux, the following fields must be unset: -securityContext.windowsOptions\n\nIf the OS field is set to windows, following fields must be unset: - spec.hostPID - spec.hostIPC - spec.securityContext.seLinuxOptions - spec.securityContext.seccompProfile - spec.securityContext.fsGroup - spec.securityContext.fsGroupChangePolicy - spec.securityContext.sysctls - spec.shareProcessNamespace - spec.securityContext.runAsUser - spec.securityContext.runAsGroup - spec.securityContext.supplementalGroups - spec.containers[*].securityContext.seLinuxOptions - spec.containers[*].securityContext.seccompProfile - spec.containers[*].securityContext.capabilities - spec.containers[*].securityContext.readOnlyRootFilesystem - spec.containers[*].securityContext.privileged - spec.containers[*].securityContext.allowPrivilegeEscalation - spec.containers[*].securityContext.procMount - spec.containers[*].securityContext.runAsUser - spec.containers[*].securityContext.runAsGroup This is an alpha field and requires the IdentifyPodOS feature","$ref":"#/components/schemas/io.k8s.api.core.v1.PodOS"},"overhead":{"description":"Overhead represents the resource overhead associated with running a pod for a given RuntimeClass. This field will be autopopulated at admission time by the RuntimeClass admission controller. If the RuntimeClass admission controller is enabled, overhead must not be set in Pod create requests. The RuntimeClass admission controller will reject Pod create requests which have the overhead already set. If RuntimeClass is configured and selected in the PodSpec, Overhead will be set to the value defined in the corresponding RuntimeClass, otherwise it will remain unset and treated as zero. More info: https://git.k8s.io/enhancements/keps/sig-node/688-pod-overhead/README.md This field is beta-level as of Kubernetes v1.18, and is only honored by servers that enable the PodOverhead feature.","type":"object","additionalProperties":{"default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.api.resource.Quantity"}},"preemptionPolicy":{"description":"PreemptionPolicy is the Policy for preempting pods with lower priority. One of Never, PreemptLowerPriority. Defaults to PreemptLowerPriority if unset.","type":"string"},"priority":{"description":"The priority value. Various system components use this field to find the priority of the pod. When Priority Admission Controller is enabled, it prevents users from setting this field. The admission controller populates this field from PriorityClassName. The higher the value, the higher the priority.","type":"integer","format":"int32"},"priorityClassName":{"description":"If specified, indicates the pod's priority. \"system-node-critical\" and \"system-cluster-critical\" are two special keywords which indicate the highest priorities with the former being the highest priority. Any other name must be defined by creating a PriorityClass object with that name. If not specified, the pod priority will be default or zero if there is no default.","type":"string"},"readinessGates":{"description":"If specified, all readiness gates will be evaluated for pod readiness. A pod is ready when all its containers are ready AND all conditions specified in the readiness gates have status equal to \"True\" More info: https://git.k8s.io/enhancements/keps/sig-network/580-pod-readiness-gates","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.PodReadinessGate"}},"restartPolicy":{"description":"Restart policy for all containers within the pod. One of Always, OnFailure, Never. Default to Always. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy\n\n","type":"string"},"runtimeClassName":{"description":"RuntimeClassName refers to a RuntimeClass object in the node.k8s.io group, which should be used to run this pod. If no RuntimeClass resource matches the named class, the pod will not be run. If unset or empty, the \"legacy\" RuntimeClass will be used, which is an implicit class with an empty definition that uses the default runtime handler. More info: https://git.k8s.io/enhancements/keps/sig-node/585-runtime-class This is a beta feature as of Kubernetes v1.14.","type":"string"},"schedulerName":{"description":"If specified, the pod will be dispatched by specified scheduler. If not specified, the pod will be dispatched by default scheduler.","type":"string"},"securityContext":{"description":"SecurityContext holds pod-level security attributes and common container settings. Optional: Defaults to empty. See type description for default values of each field.","$ref":"#/components/schemas/io.k8s.api.core.v1.PodSecurityContext"},"serviceAccount":{"description":"DeprecatedServiceAccount is a deprecated alias for ServiceAccountName. Deprecated: Use serviceAccountName instead.","type":"string"},"serviceAccountName":{"description":"ServiceAccountName is the name of the ServiceAccount to use to run this pod. More info: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/","type":"string"},"setHostnameAsFQDN":{"description":"If true the pod's hostname will be configured as the pod's FQDN, rather than the leaf name (the default). In Linux containers, this means setting the FQDN in the hostname field of the kernel (the nodename field of struct utsname). In Windows containers, this means setting the registry value of hostname for the registry key HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters to FQDN. If a pod does not have FQDN, this has no effect. Default to false.","type":"boolean"},"shareProcessNamespace":{"description":"Share a single process namespace between all of the containers in a pod. When this is set containers will be able to view and signal processes from other containers in the same pod, and the first process in each container will not be assigned PID 1. HostPID and ShareProcessNamespace cannot both be set. Optional: Default to false.","type":"boolean"},"subdomain":{"description":"If specified, the fully qualified Pod hostname will be \"\u003chostname\u003e.\u003csubdomain\u003e.\u003cpod namespace\u003e.svc.\u003ccluster domain\u003e\". If not specified, the pod will not have a domainname at all.","type":"string"},"terminationGracePeriodSeconds":{"description":"Optional duration in seconds the pod needs to terminate gracefully. May be decreased in delete request. Value must be non-negative integer. The value zero indicates stop immediately via the kill signal (no opportunity to shut down). If this value is nil, the default grace period will be used instead. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. Defaults to 30 seconds.","type":"integer","format":"int64"},"tolerations":{"description":"If specified, the pod's tolerations.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.Toleration"}},"topologySpreadConstraints":{"description":"TopologySpreadConstraints describes how a group of pods ought to spread across topology domains. Scheduler will schedule pods in a way which abides by the constraints. All topologySpreadConstraints are ANDed.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.TopologySpreadConstraint"},"x-kubernetes-list-map-keys":["topologyKey","whenUnsatisfiable"],"x-kubernetes-list-type":"map","x-kubernetes-patch-merge-key":"topologyKey","x-kubernetes-patch-strategy":"merge"},"volumes":{"description":"List of volumes that can be mounted by containers belonging to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.Volume"},"x-kubernetes-patch-merge-key":"name","x-kubernetes-patch-strategy":"merge,retainKeys"}}},"io.k8s.api.core.v1.PodTemplateSpec":{"description":"PodTemplateSpec describes the data a pod should have when created from a template","type":"object","properties":{"metadata":{"description":"Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata","default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"},"spec":{"description":"Specification of the desired behavior of the pod. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status","default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.PodSpec"}}},"io.k8s.api.core.v1.PortworxVolumeSource":{"description":"PortworxVolumeSource represents a Portworx volume resource.","type":"object","required":["volumeID"],"properties":{"fsType":{"description":"fSType represents the filesystem type to mount Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\". Implicitly inferred to be \"ext4\" if unspecified.","type":"string"},"readOnly":{"description":"readOnly defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.","type":"boolean"},"volumeID":{"description":"volumeID uniquely identifies a Portworx volume","type":"string","default":""}}},"io.k8s.api.core.v1.PreferredSchedulingTerm":{"description":"An empty preferred scheduling term matches all objects with implicit weight 0 (i.e. it's a no-op). A null preferred scheduling term matches no objects (i.e. is also a no-op).","type":"object","required":["weight","preference"],"properties":{"preference":{"description":"A node selector term, associated with the corresponding weight.","default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.NodeSelectorTerm"},"weight":{"description":"Weight associated with matching the corresponding nodeSelectorTerm, in the range 1-100.","type":"integer","format":"int32","default":0}}},"io.k8s.api.core.v1.Probe":{"description":"Probe describes a health check to be performed against a container to determine whether it is alive or ready to receive traffic.","type":"object","properties":{"exec":{"description":"Exec specifies the action to take.","$ref":"#/components/schemas/io.k8s.api.core.v1.ExecAction"},"failureThreshold":{"description":"Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1.","type":"integer","format":"int32"},"grpc":{"description":"GRPC specifies an action involving a GRPC port.","$ref":"#/components/schemas/io.k8s.api.core.v1.GRPCAction"},"httpGet":{"description":"HTTPGet specifies the http request to perform.","$ref":"#/components/schemas/io.k8s.api.core.v1.HTTPGetAction"},"initialDelaySeconds":{"description":"Number of seconds after the container has started before liveness probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes","type":"integer","format":"int32"},"periodSeconds":{"description":"How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1.","type":"integer","format":"int32"},"successThreshold":{"description":"Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1.","type":"integer","format":"int32"},"tcpSocket":{"description":"TCPSocket specifies an action involving a TCP port.","$ref":"#/components/schemas/io.k8s.api.core.v1.TCPSocketAction"},"terminationGracePeriodSeconds":{"description":"Optional duration in seconds the pod needs to terminate gracefully upon probe failure. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this value overrides the value provided by the pod spec. Value must be non-negative integer. The value zero indicates stop immediately via the kill signal (no opportunity to shut down). This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate. Minimum value is 1. spec.terminationGracePeriodSeconds is used if unset.","type":"integer","format":"int64"},"timeoutSeconds":{"description":"Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes","type":"integer","format":"int32"}}},"io.k8s.api.core.v1.ProjectedVolumeSource":{"description":"Represents a projected volume source","type":"object","properties":{"defaultMode":{"description":"defaultMode are the mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.","type":"integer","format":"int32"},"sources":{"description":"sources is the list of volume projections","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.VolumeProjection"}}}},"io.k8s.api.core.v1.QuobyteVolumeSource":{"description":"Represents a Quobyte mount that lasts the lifetime of a pod. Quobyte volumes do not support ownership management or SELinux relabeling.","type":"object","required":["registry","volume"],"properties":{"group":{"description":"group to map volume access to Default is no group","type":"string"},"readOnly":{"description":"readOnly here will force the Quobyte volume to be mounted with read-only permissions. Defaults to false.","type":"boolean"},"registry":{"description":"registry represents a single or multiple Quobyte Registry services specified as a string as host:port pair (multiple entries are separated with commas) which acts as the central registry for volumes","type":"string","default":""},"tenant":{"description":"tenant owning the given Quobyte volume in the Backend Used with dynamically provisioned Quobyte volumes, value is set by the plugin","type":"string"},"user":{"description":"user to map volume access to Defaults to serivceaccount user","type":"string"},"volume":{"description":"volume is a string that references an already created Quobyte volume by name.","type":"string","default":""}}},"io.k8s.api.core.v1.RBDVolumeSource":{"description":"Represents a Rados Block Device mount that lasts the lifetime of a pod. RBD volumes support ownership management and SELinux relabeling.","type":"object","required":["monitors","image"],"properties":{"fsType":{"description":"fsType is the filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#rbd","type":"string"},"image":{"description":"image is the rados image name. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it","type":"string","default":""},"keyring":{"description":"keyring is the path to key ring for RBDUser. Default is /etc/ceph/keyring. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it","type":"string"},"monitors":{"description":"monitors is a collection of Ceph monitors. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it","type":"array","items":{"type":"string","default":""}},"pool":{"description":"pool is the rados pool name. Default is rbd. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it","type":"string"},"readOnly":{"description":"readOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it","type":"boolean"},"secretRef":{"description":"secretRef is name of the authentication secret for RBDUser. If provided overrides keyring. Default is nil. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it","$ref":"#/components/schemas/io.k8s.api.core.v1.LocalObjectReference"},"user":{"description":"user is the rados user name. Default is admin. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it","type":"string"}}},"io.k8s.api.core.v1.ResourceFieldSelector":{"description":"ResourceFieldSelector represents container resources (cpu, memory) and their output format","type":"object","required":["resource"],"properties":{"containerName":{"description":"Container name: required for volumes, optional for env vars","type":"string"},"divisor":{"description":"Specifies the output format of the exposed resources, defaults to \"1\"","default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.api.resource.Quantity"},"resource":{"description":"Required: resource to select","type":"string","default":""}},"x-kubernetes-map-type":"atomic"},"io.k8s.api.core.v1.ResourceRequirements":{"description":"ResourceRequirements describes the compute resource requirements.","type":"object","properties":{"limits":{"description":"Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/","type":"object","additionalProperties":{"default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.api.resource.Quantity"}},"requests":{"description":"Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/","type":"object","additionalProperties":{"default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.api.resource.Quantity"}}}},"io.k8s.api.core.v1.SELinuxOptions":{"description":"SELinuxOptions are the labels to be applied to the container","type":"object","properties":{"level":{"description":"Level is SELinux level label that applies to the container.","type":"string"},"role":{"description":"Role is a SELinux role label that applies to the container.","type":"string"},"type":{"description":"Type is a SELinux type label that applies to the container.","type":"string"},"user":{"description":"User is a SELinux user label that applies to the container.","type":"string"}}},"io.k8s.api.core.v1.ScaleIOVolumeSource":{"description":"ScaleIOVolumeSource represents a persistent ScaleIO volume","type":"object","required":["gateway","system","secretRef"],"properties":{"fsType":{"description":"fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Default is \"xfs\".","type":"string"},"gateway":{"description":"gateway is the host address of the ScaleIO API Gateway.","type":"string","default":""},"protectionDomain":{"description":"protectionDomain is the name of the ScaleIO Protection Domain for the configured storage.","type":"string"},"readOnly":{"description":"readOnly Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.","type":"boolean"},"secretRef":{"description":"secretRef references to the secret for ScaleIO user and other sensitive information. If this is not provided, Login operation will fail.","$ref":"#/components/schemas/io.k8s.api.core.v1.LocalObjectReference"},"sslEnabled":{"description":"sslEnabled Flag enable/disable SSL communication with Gateway, default false","type":"boolean"},"storageMode":{"description":"storageMode indicates whether the storage for a volume should be ThickProvisioned or ThinProvisioned. Default is ThinProvisioned.","type":"string"},"storagePool":{"description":"storagePool is the ScaleIO Storage Pool associated with the protection domain.","type":"string"},"system":{"description":"system is the name of the storage system as configured in ScaleIO.","type":"string","default":""},"volumeName":{"description":"volumeName is the name of a volume already created in the ScaleIO system that is associated with this volume source.","type":"string"}}},"io.k8s.api.core.v1.SeccompProfile":{"description":"SeccompProfile defines a pod/container's seccomp profile settings. Only one profile source may be set.","type":"object","required":["type"],"properties":{"localhostProfile":{"description":"localhostProfile indicates a profile defined in a file on the node should be used. The profile must be preconfigured on the node to work. Must be a descending path, relative to the kubelet's configured seccomp profile location. Must only be set if type is \"Localhost\".","type":"string"},"type":{"description":"type indicates which kind of seccomp profile will be applied. Valid options are:\n\nLocalhost - a profile defined in a file on the node should be used. RuntimeDefault - the container runtime default profile should be used. Unconfined - no profile should be applied.\n\n","type":"string","default":""}},"x-kubernetes-unions":[{"discriminator":"type","fields-to-discriminateBy":{"localhostProfile":"LocalhostProfile"}}]},"io.k8s.api.core.v1.SecretEnvSource":{"description":"SecretEnvSource selects a Secret to populate the environment variables with.\n\nThe contents of the target Secret's Data field will represent the key-value pairs as environment variables.","type":"object","properties":{"name":{"description":"Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names","type":"string"},"optional":{"description":"Specify whether the Secret must be defined","type":"boolean"}}},"io.k8s.api.core.v1.SecretKeySelector":{"description":"SecretKeySelector selects a key of a Secret.","type":"object","required":["key"],"properties":{"key":{"description":"The key of the secret to select from. Must be a valid secret key.","type":"string","default":""},"name":{"description":"Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names","type":"string"},"optional":{"description":"Specify whether the Secret or its key must be defined","type":"boolean"}},"x-kubernetes-map-type":"atomic"},"io.k8s.api.core.v1.SecretProjection":{"description":"Adapts a secret into a projected volume.\n\nThe contents of the target Secret's Data field will be presented in a projected volume as files using the keys in the Data field as the file names. Note that this is identical to a secret volume source without the default mode.","type":"object","properties":{"items":{"description":"items if unspecified, each key-value pair in the Data field of the referenced Secret will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the Secret, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.KeyToPath"}},"name":{"description":"Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names","type":"string"},"optional":{"description":"optional field specify whether the Secret or its key must be defined","type":"boolean"}}},"io.k8s.api.core.v1.SecretVolumeSource":{"description":"Adapts a Secret into a volume.\n\nThe contents of the target Secret's Data field will be presented in a volume as files using the keys in the Data field as the file names. Secret volumes support ownership management and SELinux relabeling.","type":"object","properties":{"defaultMode":{"description":"defaultMode is Optional: mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.","type":"integer","format":"int32"},"items":{"description":"items If unspecified, each key-value pair in the Data field of the referenced Secret will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the Secret, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.KeyToPath"}},"optional":{"description":"optional field specify whether the Secret or its keys must be defined","type":"boolean"},"secretName":{"description":"secretName is the name of the secret in the pod's namespace to use. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret","type":"string"}}},"io.k8s.api.core.v1.SecurityContext":{"description":"SecurityContext holds security configuration that will be applied to a container. Some fields are present in both SecurityContext and PodSecurityContext. When both are set, the values in SecurityContext take precedence.","type":"object","properties":{"allowPrivilegeEscalation":{"description":"AllowPrivilegeEscalation controls whether a process can gain more privileges than its parent process. This bool directly controls if the no_new_privs flag will be set on the container process. AllowPrivilegeEscalation is true always when the container is: 1) run as Privileged 2) has CAP_SYS_ADMIN Note that this field cannot be set when spec.os.name is windows.","type":"boolean"},"capabilities":{"description":"The capabilities to add/drop when running containers. Defaults to the default set of capabilities granted by the container runtime. Note that this field cannot be set when spec.os.name is windows.","$ref":"#/components/schemas/io.k8s.api.core.v1.Capabilities"},"privileged":{"description":"Run container in privileged mode. Processes in privileged containers are essentially equivalent to root on the host. Defaults to false. Note that this field cannot be set when spec.os.name is windows.","type":"boolean"},"procMount":{"description":"procMount denotes the type of proc mount to use for the containers. The default is DefaultProcMount which uses the container runtime defaults for readonly paths and masked paths. This requires the ProcMountType feature flag to be enabled. Note that this field cannot be set when spec.os.name is windows.","type":"string"},"readOnlyRootFilesystem":{"description":"Whether this container has a read-only root filesystem. Default is false. Note that this field cannot be set when spec.os.name is windows.","type":"boolean"},"runAsGroup":{"description":"The GID to run the entrypoint of the container process. Uses runtime default if unset. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. Note that this field cannot be set when spec.os.name is windows.","type":"integer","format":"int64"},"runAsNonRoot":{"description":"Indicates that the container must run as a non-root user. If true, the Kubelet will validate the image at runtime to ensure that it does not run as UID 0 (root) and fail to start the container if it does. If unset or false, no such validation will be performed. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.","type":"boolean"},"runAsUser":{"description":"The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. Note that this field cannot be set when spec.os.name is windows.","type":"integer","format":"int64"},"seLinuxOptions":{"description":"The SELinux context to be applied to the container. If unspecified, the container runtime will allocate a random SELinux context for each container. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. Note that this field cannot be set when spec.os.name is windows.","$ref":"#/components/schemas/io.k8s.api.core.v1.SELinuxOptions"},"seccompProfile":{"description":"The seccomp options to use by this container. If seccomp options are provided at both the pod \u0026 container level, the container options override the pod options. Note that this field cannot be set when spec.os.name is windows.","$ref":"#/components/schemas/io.k8s.api.core.v1.SeccompProfile"},"windowsOptions":{"description":"The Windows specific settings applied to all containers. If unspecified, the options from the PodSecurityContext will be used. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. Note that this field cannot be set when spec.os.name is linux.","$ref":"#/components/schemas/io.k8s.api.core.v1.WindowsSecurityContextOptions"}}},"io.k8s.api.core.v1.ServiceAccountTokenProjection":{"description":"ServiceAccountTokenProjection represents a projected service account token volume. This projection can be used to insert a service account token into the pods runtime filesystem for use against APIs (Kubernetes API Server or otherwise).","type":"object","required":["path"],"properties":{"audience":{"description":"audience is the intended audience of the token. A recipient of a token must identify itself with an identifier specified in the audience of the token, and otherwise should reject the token. The audience defaults to the identifier of the apiserver.","type":"string"},"expirationSeconds":{"description":"expirationSeconds is the requested duration of validity of the service account token. As the token approaches expiration, the kubelet volume plugin will proactively rotate the service account token. The kubelet will start trying to rotate the token if the token is older than 80 percent of its time to live or if the token is older than 24 hours.Defaults to 1 hour and must be at least 10 minutes.","type":"integer","format":"int64"},"path":{"description":"path is the path relative to the mount point of the file to project the token into.","type":"string","default":""}}},"io.k8s.api.core.v1.StorageOSVolumeSource":{"description":"Represents a StorageOS persistent volume resource.","type":"object","properties":{"fsType":{"description":"fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.","type":"string"},"readOnly":{"description":"readOnly defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.","type":"boolean"},"secretRef":{"description":"secretRef specifies the secret to use for obtaining the StorageOS API credentials. If not specified, default values will be attempted.","$ref":"#/components/schemas/io.k8s.api.core.v1.LocalObjectReference"},"volumeName":{"description":"volumeName is the human-readable name of the StorageOS volume. Volume names are only unique within a namespace.","type":"string"},"volumeNamespace":{"description":"volumeNamespace specifies the scope of the volume within StorageOS. If no namespace is specified then the Pod's namespace will be used. This allows the Kubernetes name scoping to be mirrored within StorageOS for tighter integration. Set VolumeName to any name to override the default behaviour. Set to \"default\" if you are not using namespaces within StorageOS. Namespaces that do not pre-exist within StorageOS will be created.","type":"string"}}},"io.k8s.api.core.v1.Sysctl":{"description":"Sysctl defines a kernel parameter to be set","type":"object","required":["name","value"],"properties":{"name":{"description":"Name of a property to set","type":"string","default":""},"value":{"description":"Value of a property to set","type":"string","default":""}}},"io.k8s.api.core.v1.TCPSocketAction":{"description":"TCPSocketAction describes an action based on opening a socket","type":"object","required":["port"],"properties":{"host":{"description":"Optional: Host name to connect to, defaults to the pod IP.","type":"string"},"port":{"description":"Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME.","default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.util.intstr.IntOrString"}}},"io.k8s.api.core.v1.Toleration":{"description":"The pod this Toleration is attached to tolerates any taint that matches the triple \u003ckey,value,effect\u003e using the matching operator \u003coperator\u003e.","type":"object","properties":{"effect":{"description":"Effect indicates the taint effect to match. Empty means match all taint effects. When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute.\n\n","type":"string"},"key":{"description":"Key is the taint key that the toleration applies to. Empty means match all taint keys. If the key is empty, operator must be Exists; this combination means to match all values and all keys.","type":"string"},"operator":{"description":"Operator represents a key's relationship to the value. Valid operators are Exists and Equal. Defaults to Equal. Exists is equivalent to wildcard for value, so that a pod can tolerate all taints of a particular category.\n\n","type":"string"},"tolerationSeconds":{"description":"TolerationSeconds represents the period of time the toleration (which must be of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default, it is not set, which means tolerate the taint forever (do not evict). Zero and negative values will be treated as 0 (evict immediately) by the system.","type":"integer","format":"int64"},"value":{"description":"Value is the taint value the toleration matches to. If the operator is Exists, the value should be empty, otherwise just a regular string.","type":"string"}}},"io.k8s.api.core.v1.TopologySpreadConstraint":{"description":"TopologySpreadConstraint specifies how to spread matching pods among the given topology.","type":"object","required":["maxSkew","topologyKey","whenUnsatisfiable"],"properties":{"labelSelector":{"description":"LabelSelector is used to find matching pods. Pods that match this label selector are counted to determine the number of pods in their corresponding topology domain.","$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector"},"maxSkew":{"description":"MaxSkew describes the degree to which pods may be unevenly distributed. When `whenUnsatisfiable=DoNotSchedule`, it is the maximum permitted difference between the number of matching pods in the target topology and the global minimum. For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same labelSelector spread as 1/1/0: | zone1 | zone2 | zone3 | | P | P | | - if MaxSkew is 1, incoming pod can only be scheduled to zone3 to become 1/1/1; scheduling it onto zone1(zone2) would make the ActualSkew(2-0) on zone1(zone2) violate MaxSkew(1). - if MaxSkew is 2, incoming pod can be scheduled onto any zone. When `whenUnsatisfiable=ScheduleAnyway`, it is used to give higher precedence to topologies that satisfy it. It's a required field. Default value is 1 and 0 is not allowed.","type":"integer","format":"int32","default":0},"topologyKey":{"description":"TopologyKey is the key of node labels. Nodes that have a label with this key and identical values are considered to be in the same topology. We consider each \u003ckey, value\u003e as a \"bucket\", and try to put balanced number of pods into each bucket. It's a required field.","type":"string","default":""},"whenUnsatisfiable":{"description":"WhenUnsatisfiable indicates how to deal with a pod if it doesn't satisfy the spread constraint. - DoNotSchedule (default) tells the scheduler not to schedule it. - ScheduleAnyway tells the scheduler to schedule the pod in any location,\n but giving higher precedence to topologies that would help reduce the\n skew.\nA constraint is considered \"Unsatisfiable\" for an incoming pod if and only if every possible node assignment for that pod would violate \"MaxSkew\" on some topology. For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same labelSelector spread as 3/1/1: | zone1 | zone2 | zone3 | | P P P | P | P | If WhenUnsatisfiable is set to DoNotSchedule, incoming pod can only be scheduled to zone2(zone3) to become 3/2/1(3/1/2) as ActualSkew(2-1) on zone2(zone3) satisfies MaxSkew(1). In other words, the cluster can still be imbalanced, but scheduler won't make it *more* imbalanced. It's a required field.\n\n","type":"string","default":""}}},"io.k8s.api.core.v1.TypedLocalObjectReference":{"description":"TypedLocalObjectReference contains enough information to let you locate the typed referenced object inside the same namespace.","type":"object","required":["kind","name"],"properties":{"apiGroup":{"description":"APIGroup is the group for the resource being referenced. If APIGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, APIGroup is required.","type":"string"},"kind":{"description":"Kind is the type of resource being referenced","type":"string","default":""},"name":{"description":"Name is the name of resource being referenced","type":"string","default":""}},"x-kubernetes-map-type":"atomic"},"io.k8s.api.core.v1.Volume":{"description":"Volume represents a named volume in a pod that may be accessed by any container in the pod.","type":"object","required":["name"],"properties":{"awsElasticBlockStore":{"description":"awsElasticBlockStore represents an AWS Disk resource that is attached to a kubelet's host machine and then exposed to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore","$ref":"#/components/schemas/io.k8s.api.core.v1.AWSElasticBlockStoreVolumeSource"},"azureDisk":{"description":"azureDisk represents an Azure Data Disk mount on the host and bind mount to the pod.","$ref":"#/components/schemas/io.k8s.api.core.v1.AzureDiskVolumeSource"},"azureFile":{"description":"azureFile represents an Azure File Service mount on the host and bind mount to the pod.","$ref":"#/components/schemas/io.k8s.api.core.v1.AzureFileVolumeSource"},"cephfs":{"description":"cephFS represents a Ceph FS mount on the host that shares a pod's lifetime","$ref":"#/components/schemas/io.k8s.api.core.v1.CephFSVolumeSource"},"cinder":{"description":"cinder represents a cinder volume attached and mounted on kubelets host machine. More info: https://examples.k8s.io/mysql-cinder-pd/README.md","$ref":"#/components/schemas/io.k8s.api.core.v1.CinderVolumeSource"},"configMap":{"description":"configMap represents a configMap that should populate this volume","$ref":"#/components/schemas/io.k8s.api.core.v1.ConfigMapVolumeSource"},"csi":{"description":"csi (Container Storage Interface) represents ephemeral storage that is handled by certain external CSI drivers (Beta feature).","$ref":"#/components/schemas/io.k8s.api.core.v1.CSIVolumeSource"},"downwardAPI":{"description":"downwardAPI represents downward API about the pod that should populate this volume","$ref":"#/components/schemas/io.k8s.api.core.v1.DownwardAPIVolumeSource"},"emptyDir":{"description":"emptyDir represents a temporary directory that shares a pod's lifetime. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir","$ref":"#/components/schemas/io.k8s.api.core.v1.EmptyDirVolumeSource"},"ephemeral":{"description":"ephemeral represents a volume that is handled by a cluster storage driver. The volume's lifecycle is tied to the pod that defines it - it will be created before the pod starts, and deleted when the pod is removed.\n\nUse this if: a) the volume is only needed while the pod runs, b) features of normal volumes like restoring from snapshot or capacity\n tracking are needed,\nc) the storage driver is specified through a storage class, and d) the storage driver supports dynamic volume provisioning through\n a PersistentVolumeClaim (see EphemeralVolumeSource for more\n information on the connection between this volume type\n and PersistentVolumeClaim).\n\nUse PersistentVolumeClaim or one of the vendor-specific APIs for volumes that persist for longer than the lifecycle of an individual pod.\n\nUse CSI for light-weight local ephemeral volumes if the CSI driver is meant to be used that way - see the documentation of the driver for more information.\n\nA pod can use both types of ephemeral volumes and persistent volumes at the same time.","$ref":"#/components/schemas/io.k8s.api.core.v1.EphemeralVolumeSource"},"fc":{"description":"fc represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod.","$ref":"#/components/schemas/io.k8s.api.core.v1.FCVolumeSource"},"flexVolume":{"description":"flexVolume represents a generic volume resource that is provisioned/attached using an exec based plugin.","$ref":"#/components/schemas/io.k8s.api.core.v1.FlexVolumeSource"},"flocker":{"description":"flocker represents a Flocker volume attached to a kubelet's host machine. This depends on the Flocker control service being running","$ref":"#/components/schemas/io.k8s.api.core.v1.FlockerVolumeSource"},"gcePersistentDisk":{"description":"gcePersistentDisk represents a GCE Disk resource that is attached to a kubelet's host machine and then exposed to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk","$ref":"#/components/schemas/io.k8s.api.core.v1.GCEPersistentDiskVolumeSource"},"gitRepo":{"description":"gitRepo represents a git repository at a particular revision. DEPRECATED: GitRepo is deprecated. To provision a container with a git repo, mount an EmptyDir into an InitContainer that clones the repo using git, then mount the EmptyDir into the Pod's container.","$ref":"#/components/schemas/io.k8s.api.core.v1.GitRepoVolumeSource"},"glusterfs":{"description":"glusterfs represents a Glusterfs mount on the host that shares a pod's lifetime. More info: https://examples.k8s.io/volumes/glusterfs/README.md","$ref":"#/components/schemas/io.k8s.api.core.v1.GlusterfsVolumeSource"},"hostPath":{"description":"hostPath represents a pre-existing file or directory on the host machine that is directly exposed to the container. This is generally used for system agents or other privileged things that are allowed to see the host machine. Most containers will NOT need this. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath","$ref":"#/components/schemas/io.k8s.api.core.v1.HostPathVolumeSource"},"iscsi":{"description":"iscsi represents an ISCSI Disk resource that is attached to a kubelet's host machine and then exposed to the pod. More info: https://examples.k8s.io/volumes/iscsi/README.md","$ref":"#/components/schemas/io.k8s.api.core.v1.ISCSIVolumeSource"},"name":{"description":"name of the volume. Must be a DNS_LABEL and unique within the pod. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names","type":"string","default":""},"nfs":{"description":"nfs represents an NFS mount on the host that shares a pod's lifetime More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs","$ref":"#/components/schemas/io.k8s.api.core.v1.NFSVolumeSource"},"persistentVolumeClaim":{"description":"persistentVolumeClaimVolumeSource represents a reference to a PersistentVolumeClaim in the same namespace. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims","$ref":"#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaimVolumeSource"},"photonPersistentDisk":{"description":"photonPersistentDisk represents a PhotonController persistent disk attached and mounted on kubelets host machine","$ref":"#/components/schemas/io.k8s.api.core.v1.PhotonPersistentDiskVolumeSource"},"portworxVolume":{"description":"portworxVolume represents a portworx volume attached and mounted on kubelets host machine","$ref":"#/components/schemas/io.k8s.api.core.v1.PortworxVolumeSource"},"projected":{"description":"projected items for all in one resources secrets, configmaps, and downward API","$ref":"#/components/schemas/io.k8s.api.core.v1.ProjectedVolumeSource"},"quobyte":{"description":"quobyte represents a Quobyte mount on the host that shares a pod's lifetime","$ref":"#/components/schemas/io.k8s.api.core.v1.QuobyteVolumeSource"},"rbd":{"description":"rbd represents a Rados Block Device mount on the host that shares a pod's lifetime. More info: https://examples.k8s.io/volumes/rbd/README.md","$ref":"#/components/schemas/io.k8s.api.core.v1.RBDVolumeSource"},"scaleIO":{"description":"scaleIO represents a ScaleIO persistent volume attached and mounted on Kubernetes nodes.","$ref":"#/components/schemas/io.k8s.api.core.v1.ScaleIOVolumeSource"},"secret":{"description":"secret represents a secret that should populate this volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret","$ref":"#/components/schemas/io.k8s.api.core.v1.SecretVolumeSource"},"storageos":{"description":"storageOS represents a StorageOS volume attached and mounted on Kubernetes nodes.","$ref":"#/components/schemas/io.k8s.api.core.v1.StorageOSVolumeSource"},"vsphereVolume":{"description":"vsphereVolume represents a vSphere volume attached and mounted on kubelets host machine","$ref":"#/components/schemas/io.k8s.api.core.v1.VsphereVirtualDiskVolumeSource"}}},"io.k8s.api.core.v1.VolumeDevice":{"description":"volumeDevice describes a mapping of a raw block device within a container.","type":"object","required":["name","devicePath"],"properties":{"devicePath":{"description":"devicePath is the path inside of the container that the device will be mapped to.","type":"string","default":""},"name":{"description":"name must match the name of a persistentVolumeClaim in the pod","type":"string","default":""}}},"io.k8s.api.core.v1.VolumeMount":{"description":"VolumeMount describes a mounting of a Volume within a container.","type":"object","required":["name","mountPath"],"properties":{"mountPath":{"description":"Path within the container at which the volume should be mounted. Must not contain ':'.","type":"string","default":""},"mountPropagation":{"description":"mountPropagation determines how mounts are propagated from the host to container and the other way around. When not set, MountPropagationNone is used. This field is beta in 1.10.","type":"string"},"name":{"description":"This must match the Name of a Volume.","type":"string","default":""},"readOnly":{"description":"Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false.","type":"boolean"},"subPath":{"description":"Path within the volume from which the container's volume should be mounted. Defaults to \"\" (volume's root).","type":"string"},"subPathExpr":{"description":"Expanded path within the volume from which the container's volume should be mounted. Behaves similarly to SubPath but environment variable references $(VAR_NAME) are expanded using the container's environment. Defaults to \"\" (volume's root). SubPathExpr and SubPath are mutually exclusive.","type":"string"}}},"io.k8s.api.core.v1.VolumeProjection":{"description":"Projection that may be projected along with other supported volume types","type":"object","properties":{"configMap":{"description":"configMap information about the configMap data to project","$ref":"#/components/schemas/io.k8s.api.core.v1.ConfigMapProjection"},"downwardAPI":{"description":"downwardAPI information about the downwardAPI data to project","$ref":"#/components/schemas/io.k8s.api.core.v1.DownwardAPIProjection"},"secret":{"description":"secret information about the secret data to project","$ref":"#/components/schemas/io.k8s.api.core.v1.SecretProjection"},"serviceAccountToken":{"description":"serviceAccountToken is information about the serviceAccountToken data to project","$ref":"#/components/schemas/io.k8s.api.core.v1.ServiceAccountTokenProjection"}}},"io.k8s.api.core.v1.VsphereVirtualDiskVolumeSource":{"description":"Represents a vSphere volume resource.","type":"object","required":["volumePath"],"properties":{"fsType":{"description":"fsType is filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.","type":"string"},"storagePolicyID":{"description":"storagePolicyID is the storage Policy Based Management (SPBM) profile ID associated with the StoragePolicyName.","type":"string"},"storagePolicyName":{"description":"storagePolicyName is the storage Policy Based Management (SPBM) profile name.","type":"string"},"volumePath":{"description":"volumePath is the path that identifies vSphere volume vmdk","type":"string","default":""}}},"io.k8s.api.core.v1.WeightedPodAffinityTerm":{"description":"The weights of all of the matched WeightedPodAffinityTerm fields are added per-node to find the most preferred node(s)","type":"object","required":["weight","podAffinityTerm"],"properties":{"podAffinityTerm":{"description":"Required. A pod affinity term, associated with the corresponding weight.","default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.PodAffinityTerm"},"weight":{"description":"weight associated with matching the corresponding podAffinityTerm, in the range 1-100.","type":"integer","format":"int32","default":0}}},"io.k8s.api.core.v1.WindowsSecurityContextOptions":{"description":"WindowsSecurityContextOptions contain Windows-specific options and credentials.","type":"object","properties":{"gmsaCredentialSpec":{"description":"GMSACredentialSpec is where the GMSA admission webhook (https://github.com/kubernetes-sigs/windows-gmsa) inlines the contents of the GMSA credential spec named by the GMSACredentialSpecName field.","type":"string"},"gmsaCredentialSpecName":{"description":"GMSACredentialSpecName is the name of the GMSA credential spec to use.","type":"string"},"hostProcess":{"description":"HostProcess determines if a container should be run as a 'Host Process' container. This field is alpha-level and will only be honored by components that enable the WindowsHostProcessContainers feature flag. Setting this field without the feature flag will result in errors when validating the Pod. All of a Pod's containers must have the same effective HostProcess value (it is not allowed to have a mix of HostProcess containers and non-HostProcess containers). In addition, if HostProcess is true then HostNetwork must also be set to true.","type":"boolean"},"runAsUserName":{"description":"The UserName in Windows to run the entrypoint of the container process. Defaults to the user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.","type":"string"}}},"io.k8s.apimachinery.pkg.api.resource.Quantity":{"description":"Quantity is a fixed-point representation of a number. It provides convenient marshaling/unmarshaling in JSON and YAML, in addition to String() and AsInt64() accessors.\n\nThe serialization format is:\n\n\u003cquantity\u003e ::= \u003csignedNumber\u003e\u003csuffix\u003e\n (Note that \u003csuffix\u003e may be empty, from the \"\" case in \u003cdecimalSI\u003e.)\n\u003cdigit\u003e ::= 0 | 1 | ... | 9 \u003cdigits\u003e ::= \u003cdigit\u003e | \u003cdigit\u003e\u003cdigits\u003e \u003cnumber\u003e ::= \u003cdigits\u003e | \u003cdigits\u003e.\u003cdigits\u003e | \u003cdigits\u003e. | .\u003cdigits\u003e \u003csign\u003e ::= \"+\" | \"-\" \u003csignedNumber\u003e ::= \u003cnumber\u003e | \u003csign\u003e\u003cnumber\u003e \u003csuffix\u003e ::= \u003cbinarySI\u003e | \u003cdecimalExponent\u003e | \u003cdecimalSI\u003e \u003cbinarySI\u003e ::= Ki | Mi | Gi | Ti | Pi | Ei\n (International System of units; See: http://physics.nist.gov/cuu/Units/binary.html)\n\u003cdecimalSI\u003e ::= m | \"\" | k | M | G | T | P | E\n (Note that 1024 = 1Ki but 1000 = 1k; I didn't choose the capitalization.)\n\u003cdecimalExponent\u003e ::= \"e\" \u003csignedNumber\u003e | \"E\" \u003csignedNumber\u003e\n\nNo matter which of the three exponent forms is used, no quantity may represent a number greater than 2^63-1 in magnitude, nor may it have more than 3 decimal places. Numbers larger or more precise will be capped or rounded up. (E.g.: 0.1m will rounded up to 1m.) This may be extended in the future if we require larger or smaller quantities.\n\nWhen a Quantity is parsed from a string, it will remember the type of suffix it had, and will use the same type again when it is serialized.\n\nBefore serializing, Quantity will be put in \"canonical form\". This means that Exponent/suffix will be adjusted up or down (with a corresponding increase or decrease in Mantissa) such that:\n a. No precision is lost\n b. No fractional digits will be emitted\n c. The exponent (or suffix) is as large as possible.\nThe sign will be omitted unless the number is negative.\n\nExamples:\n 1.5 will be serialized as \"1500m\"\n 1.5Gi will be serialized as \"1536Mi\"\n\nNote that the quantity will NEVER be internally represented by a floating point number. That is the whole point of this exercise.\n\nNon-canonical values will still parse as long as they are well formed, but will be re-emitted in their canonical form. (So always use canonical form, or don't diff.)\n\nThis format is intended to make it difficult to use these numbers without writing some sort of special handling code in the hopes that that will cause implementors to also use a fixed point implementation.","type":"string"},"io.k8s.apimachinery.pkg.apis.meta.v1.APIResource":{"description":"APIResource specifies the name of a resource and whether it is namespaced.","type":"object","required":["name","singularName","namespaced","kind","verbs"],"properties":{"categories":{"description":"categories is a list of the grouped resources this resource belongs to (e.g. 'all')","type":"array","items":{"type":"string","default":""}},"group":{"description":"group is the preferred group of the resource. Empty implies the group of the containing resource list. For subresources, this may have a different value, for example: Scale\".","type":"string"},"kind":{"description":"kind is the kind for the resource (e.g. 'Foo' is the kind for a resource 'foo')","type":"string","default":""},"name":{"description":"name is the plural name of the resource.","type":"string","default":""},"namespaced":{"description":"namespaced indicates if a resource is namespaced or not.","type":"boolean","default":false},"shortNames":{"description":"shortNames is a list of suggested short names of the resource.","type":"array","items":{"type":"string","default":""}},"singularName":{"description":"singularName is the singular name of the resource. This allows clients to handle plural and singular opaquely. The singularName is more correct for reporting status on a single item and both singular and plural are allowed from the kubectl CLI interface.","type":"string","default":""},"storageVersionHash":{"description":"The hash value of the storage version, the version this resource is converted to when written to the data store. Value must be treated as opaque by clients. Only equality comparison on the value is valid. This is an alpha feature and may change or be removed in the future. The field is populated by the apiserver only if the StorageVersionHash feature gate is enabled. This field will remain optional even if it graduates.","type":"string"},"verbs":{"description":"verbs is a list of supported kube verbs (this includes get, list, watch, create, update, patch, delete, deletecollection, and proxy)","type":"array","items":{"type":"string","default":""}},"version":{"description":"version is the preferred version of the resource. Empty implies the version of the containing resource list For subresources, this may have a different value, for example: v1 (while inside a v1beta1 version of the core resource's group)\".","type":"string"}}},"io.k8s.apimachinery.pkg.apis.meta.v1.APIResourceList":{"description":"APIResourceList is a list of APIResource, it is used to expose the name of the resources supported in a specific group and version, and if the resource is namespaced.","type":"object","required":["groupVersion","resources"],"properties":{"apiVersion":{"description":"APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources","type":"string"},"groupVersion":{"description":"groupVersion is the group and version this APIResourceList is for.","type":"string","default":""},"kind":{"description":"Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds","type":"string"},"resources":{"description":"resources contains the name of the resources and if they are namespaced.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.APIResource"}}},"x-kubernetes-group-version-kind":[{"group":"","kind":"APIResourceList","version":"v1"}]},"io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions":{"description":"DeleteOptions may be provided when deleting an API object.","type":"object","properties":{"apiVersion":{"description":"APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources","type":"string"},"dryRun":{"description":"When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed","type":"array","items":{"type":"string","default":""}},"gracePeriodSeconds":{"description":"The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.","type":"integer","format":"int64"},"kind":{"description":"Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds","type":"string"},"orphanDependents":{"description":"Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.","type":"boolean"},"preconditions":{"description":"Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned.","$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Preconditions"},"propagationPolicy":{"description":"Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.","type":"string"}},"x-kubernetes-group-version-kind":[{"group":"","kind":"DeleteOptions","version":"v1"},{"group":"admission.k8s.io","kind":"DeleteOptions","version":"v1"},{"group":"admission.k8s.io","kind":"DeleteOptions","version":"v1beta1"},{"group":"admissionregistration.k8s.io","kind":"DeleteOptions","version":"v1"},{"group":"admissionregistration.k8s.io","kind":"DeleteOptions","version":"v1beta1"},{"group":"apiextensions.k8s.io","kind":"DeleteOptions","version":"v1"},{"group":"apiextensions.k8s.io","kind":"DeleteOptions","version":"v1beta1"},{"group":"apiregistration.k8s.io","kind":"DeleteOptions","version":"v1"},{"group":"apiregistration.k8s.io","kind":"DeleteOptions","version":"v1beta1"},{"group":"apps","kind":"DeleteOptions","version":"v1"},{"group":"apps","kind":"DeleteOptions","version":"v1beta1"},{"group":"apps","kind":"DeleteOptions","version":"v1beta2"},{"group":"authentication.k8s.io","kind":"DeleteOptions","version":"v1"},{"group":"authentication.k8s.io","kind":"DeleteOptions","version":"v1beta1"},{"group":"authorization.k8s.io","kind":"DeleteOptions","version":"v1"},{"group":"authorization.k8s.io","kind":"DeleteOptions","version":"v1beta1"},{"group":"autoscaling","kind":"DeleteOptions","version":"v1"},{"group":"autoscaling","kind":"DeleteOptions","version":"v2"},{"group":"autoscaling","kind":"DeleteOptions","version":"v2beta1"},{"group":"autoscaling","kind":"DeleteOptions","version":"v2beta2"},{"group":"batch","kind":"DeleteOptions","version":"v1"},{"group":"batch","kind":"DeleteOptions","version":"v1beta1"},{"group":"certificates.k8s.io","kind":"DeleteOptions","version":"v1"},{"group":"certificates.k8s.io","kind":"DeleteOptions","version":"v1beta1"},{"group":"coordination.k8s.io","kind":"DeleteOptions","version":"v1"},{"group":"coordination.k8s.io","kind":"DeleteOptions","version":"v1beta1"},{"group":"discovery.k8s.io","kind":"DeleteOptions","version":"v1"},{"group":"discovery.k8s.io","kind":"DeleteOptions","version":"v1beta1"},{"group":"events.k8s.io","kind":"DeleteOptions","version":"v1"},{"group":"events.k8s.io","kind":"DeleteOptions","version":"v1beta1"},{"group":"extensions","kind":"DeleteOptions","version":"v1beta1"},{"group":"flowcontrol.apiserver.k8s.io","kind":"DeleteOptions","version":"v1alpha1"},{"group":"flowcontrol.apiserver.k8s.io","kind":"DeleteOptions","version":"v1beta1"},{"group":"flowcontrol.apiserver.k8s.io","kind":"DeleteOptions","version":"v1beta2"},{"group":"imagepolicy.k8s.io","kind":"DeleteOptions","version":"v1alpha1"},{"group":"internal.apiserver.k8s.io","kind":"DeleteOptions","version":"v1alpha1"},{"group":"networking.k8s.io","kind":"DeleteOptions","version":"v1"},{"group":"networking.k8s.io","kind":"DeleteOptions","version":"v1beta1"},{"group":"node.k8s.io","kind":"DeleteOptions","version":"v1"},{"group":"node.k8s.io","kind":"DeleteOptions","version":"v1alpha1"},{"group":"node.k8s.io","kind":"DeleteOptions","version":"v1beta1"},{"group":"policy","kind":"DeleteOptions","version":"v1"},{"group":"policy","kind":"DeleteOptions","version":"v1beta1"},{"group":"rbac.authorization.k8s.io","kind":"DeleteOptions","version":"v1"},{"group":"rbac.authorization.k8s.io","kind":"DeleteOptions","version":"v1alpha1"},{"group":"rbac.authorization.k8s.io","kind":"DeleteOptions","version":"v1beta1"},{"group":"scheduling.k8s.io","kind":"DeleteOptions","version":"v1"},{"group":"scheduling.k8s.io","kind":"DeleteOptions","version":"v1alpha1"},{"group":"scheduling.k8s.io","kind":"DeleteOptions","version":"v1beta1"},{"group":"storage.k8s.io","kind":"DeleteOptions","version":"v1"},{"group":"storage.k8s.io","kind":"DeleteOptions","version":"v1alpha1"},{"group":"storage.k8s.io","kind":"DeleteOptions","version":"v1beta1"}]},"io.k8s.apimachinery.pkg.apis.meta.v1.FieldsV1":{"description":"FieldsV1 stores a set of fields in a data structure like a Trie, in JSON format.\n\nEach key is either a '.' representing the field itself, and will always map to an empty set, or a string representing a sub-field or item. The string will follow one of these four formats: 'f:\u003cname\u003e', where \u003cname\u003e is the name of a field in a struct, or key in a map 'v:\u003cvalue\u003e', where \u003cvalue\u003e is the exact json formatted value of a list item 'i:\u003cindex\u003e', where \u003cindex\u003e is position of a item in a list 'k:\u003ckeys\u003e', where \u003ckeys\u003e is a map of a list item's key fields to their unique values If a key maps to an empty Fields value, the field that key represents is part of the set.\n\nThe exact format is defined in sigs.k8s.io/structured-merge-diff","type":"object"},"io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector":{"description":"A label selector is a label query over a set of resources. The result of matchLabels and matchExpressions are ANDed. An empty label selector matches all objects. A null label selector matches no objects.","type":"object","properties":{"matchExpressions":{"description":"matchExpressions is a list of label selector requirements. The requirements are ANDed.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelectorRequirement"}},"matchLabels":{"description":"matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is \"key\", the operator is \"In\", and the values array contains only \"value\". The requirements are ANDed.","type":"object","additionalProperties":{"type":"string","default":""}}},"x-kubernetes-map-type":"atomic"},"io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelectorRequirement":{"description":"A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.","type":"object","required":["key","operator"],"properties":{"key":{"description":"key is the label key that the selector applies to.","type":"string","default":"","x-kubernetes-patch-merge-key":"key","x-kubernetes-patch-strategy":"merge"},"operator":{"description":"operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.","type":"string","default":""},"values":{"description":"values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.","type":"array","items":{"type":"string","default":""}}}},"io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta":{"description":"ListMeta describes metadata that synthetic resources must have, including lists and various status objects. A resource may have only one of {ObjectMeta, ListMeta}.","type":"object","properties":{"continue":{"description":"continue may be set if the user set a limit on the number of items returned, and indicates that the server has more data available. The value is opaque and may be used to issue another request to the endpoint that served this list to retrieve the next set of available objects. Continuing a consistent list may not be possible if the server configuration has changed or more than a few minutes have passed. The resourceVersion field returned when using this continue value will be identical to the value in the first response, unless you have received this token from an error message.","type":"string"},"remainingItemCount":{"description":"remainingItemCount is the number of subsequent items in the list which are not included in this list response. If the list request contained label or field selectors, then the number of remaining items is unknown and the field will be left unset and omitted during serialization. If the list is complete (either because it is not chunking or because this is the last chunk), then there are no more remaining items and this field will be left unset and omitted during serialization. Servers older than v1.15 do not set this field. The intended use of the remainingItemCount is *estimating* the size of a collection. Clients should not rely on the remainingItemCount to be set or to be exact.","type":"integer","format":"int64"},"resourceVersion":{"description":"String that identifies the server's internal version of this object that can be used by clients to determine when objects have changed. Value must be treated as opaque by clients and passed unmodified back to the server. Populated by the system. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency","type":"string"},"selfLink":{"description":"selfLink is DEPRECATED read-only field that is no longer populated by the system.","type":"string"}}},"io.k8s.apimachinery.pkg.apis.meta.v1.ManagedFieldsEntry":{"description":"ManagedFieldsEntry is a workflow-id, a FieldSet and the group version of the resource that the fieldset applies to.","type":"object","properties":{"apiVersion":{"description":"APIVersion defines the version of this resource that this field set applies to. The format is \"group/version\" just like the top-level APIVersion field. It is necessary to track the version of a field set because it cannot be automatically converted.","type":"string"},"fieldsType":{"description":"FieldsType is the discriminator for the different fields format and version. There is currently only one possible value: \"FieldsV1\"","type":"string"},"fieldsV1":{"description":"FieldsV1 holds the first JSON version format as described in the \"FieldsV1\" type.","$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.FieldsV1"},"manager":{"description":"Manager is an identifier of the workflow managing these fields.","type":"string"},"operation":{"description":"Operation is the type of operation which lead to this ManagedFieldsEntry being created. The only valid values for this field are 'Apply' and 'Update'.","type":"string"},"subresource":{"description":"Subresource is the name of the subresource used to update that object, or empty string if the object was updated through the main resource. The value of this field is used to distinguish between managers, even if they share the same name. For example, a status update will be distinct from a regular update using the same manager name. Note that the APIVersion field is not related to the Subresource field and it always corresponds to the version of the main resource.","type":"string"},"time":{"description":"Time is the timestamp of when the ManagedFields entry was added. The timestamp will also be updated if a field is added, the manager changes any of the owned fields value or removes a field. The timestamp does not update when a field is removed from the entry because another manager took it over.","$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time"}}},"io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta":{"description":"ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create.","type":"object","properties":{"annotations":{"description":"Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations","type":"object","additionalProperties":{"type":"string","default":""}},"clusterName":{"description":"The name of the cluster which the object belongs to. This is used to distinguish resources with same name and namespace in different clusters. This field is not set anywhere right now and apiserver is going to ignore it if set in create or update request.","type":"string"},"creationTimestamp":{"description":"CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC.\n\nPopulated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata","default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time"},"deletionGracePeriodSeconds":{"description":"Number of seconds allowed for this object to gracefully terminate before it will be removed from the system. Only set when deletionTimestamp is also set. May only be shortened. Read-only.","type":"integer","format":"int64"},"deletionTimestamp":{"description":"DeletionTimestamp is RFC 3339 date and time at which this resource will be deleted. This field is set by the server when a graceful deletion is requested by the user, and is not directly settable by a client. The resource is expected to be deleted (no longer visible from resource lists, and not reachable by name) after the time in this field, once the finalizers list is empty. As long as the finalizers list contains items, deletion is blocked. Once the deletionTimestamp is set, this value may not be unset or be set further into the future, although it may be shortened or the resource may be deleted prior to this time. For example, a user may request that a pod is deleted in 30 seconds. The Kubelet will react by sending a graceful termination signal to the containers in the pod. After that 30 seconds, the Kubelet will send a hard termination signal (SIGKILL) to the container and after cleanup, remove the pod from the API. In the presence of network partitions, this object may still exist after this timestamp, until an administrator or automated process can determine the resource is fully terminated. If not set, graceful deletion of the object has not been requested.\n\nPopulated by the system when a graceful deletion is requested. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata","$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time"},"finalizers":{"description":"Must be empty before the object is deleted from the registry. Each entry is an identifier for the responsible component that will remove the entry from the list. If the deletionTimestamp of the object is non-nil, entries in this list can only be removed. Finalizers may be processed and removed in any order. Order is NOT enforced because it introduces significant risk of stuck finalizers. finalizers is a shared field, any actor with permission can reorder it. If the finalizer list is processed in order, then this can lead to a situation in which the component responsible for the first finalizer in the list is waiting for a signal (field value, external system, or other) produced by a component responsible for a finalizer later in the list, resulting in a deadlock. Without enforced ordering finalizers are free to order amongst themselves and are not vulnerable to ordering changes in the list.","type":"array","items":{"type":"string","default":""},"x-kubernetes-patch-strategy":"merge"},"generateName":{"description":"GenerateName is an optional prefix, used by the server, to generate a unique name ONLY IF the Name field has not been provided. If this field is used, the name returned to the client will be different than the name passed. This value will also be combined with a unique suffix. The provided value has the same validation rules as the Name field, and may be truncated by the length of the suffix required to make the value unique on the server.\n\nIf this field is specified and the generated name exists, the server will NOT return a 409 - instead, it will either return 201 Created or 500 with Reason ServerTimeout indicating a unique name could not be found in the time allotted, and the client should retry (optionally after the time indicated in the Retry-After header).\n\nApplied only if Name is not specified. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#idempotency","type":"string"},"generation":{"description":"A sequence number representing a specific generation of the desired state. Populated by the system. Read-only.","type":"integer","format":"int64"},"labels":{"description":"Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels","type":"object","additionalProperties":{"type":"string","default":""}},"managedFields":{"description":"ManagedFields maps workflow-id and version to the set of fields that are managed by that workflow. This is mostly for internal housekeeping, and users typically shouldn't need to set or understand this field. A workflow can be the user's name, a controller's name, or the name of a specific apply path like \"ci-cd\". The set of fields is always in the version that the workflow used when modifying the object.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ManagedFieldsEntry"}},"name":{"description":"Name must be unique within a namespace. Is required when creating resources, although some resources may allow a client to request the generation of an appropriate name automatically. Name is primarily intended for creation idempotence and configuration definition. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#names","type":"string"},"namespace":{"description":"Namespace defines the space within which each name must be unique. An empty namespace is equivalent to the \"default\" namespace, but \"default\" is the canonical representation. Not all objects are required to be scoped to a namespace - the value of this field for those objects will be empty.\n\nMust be a DNS_LABEL. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces","type":"string"},"ownerReferences":{"description":"List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, then an entry in this list will point to this controller, with the controller field set to true. There cannot be more than one managing controller.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.OwnerReference"},"x-kubernetes-patch-merge-key":"uid","x-kubernetes-patch-strategy":"merge"},"resourceVersion":{"description":"An opaque value that represents the internal version of this object that can be used by clients to determine when objects have changed. May be used for optimistic concurrency, change detection, and the watch operation on a resource or set of resources. Clients must treat these values as opaque and passed unmodified back to the server. They may only be valid for a particular resource or set of resources.\n\nPopulated by the system. Read-only. Value must be treated as opaque by clients and . More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency","type":"string"},"selfLink":{"description":"selfLink is DEPRECATED read-only field that is no longer populated by the system.","type":"string"},"uid":{"description":"UID is the unique in time and space value for this object. It is typically generated by the server on successful creation of a resource and is not allowed to change on PUT operations.\n\nPopulated by the system. Read-only. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#uids","type":"string"}}},"io.k8s.apimachinery.pkg.apis.meta.v1.OwnerReference":{"description":"OwnerReference contains enough information to let you identify an owning object. An owning object must be in the same namespace as the dependent, or be cluster-scoped, so there is no namespace field.","type":"object","required":["apiVersion","kind","name","uid"],"properties":{"apiVersion":{"description":"API version of the referent.","type":"string","default":""},"blockOwnerDeletion":{"description":"If true, AND if the owner has the \"foregroundDeletion\" finalizer, then the owner cannot be deleted from the key-value store until this reference is removed. See https://kubernetes.io/docs/concepts/architecture/garbage-collection/#foreground-deletion for how the garbage collector interacts with this field and enforces the foreground deletion. Defaults to false. To set this field, a user needs \"delete\" permission of the owner, otherwise 422 (Unprocessable Entity) will be returned.","type":"boolean"},"controller":{"description":"If true, this reference points to the managing controller.","type":"boolean"},"kind":{"description":"Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds","type":"string","default":""},"name":{"description":"Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#names","type":"string","default":""},"uid":{"description":"UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#uids","type":"string","default":""}},"x-kubernetes-map-type":"atomic"},"io.k8s.apimachinery.pkg.apis.meta.v1.Patch":{"description":"Patch is provided to give a concrete name and type to the Kubernetes PATCH request body.","type":"object"},"io.k8s.apimachinery.pkg.apis.meta.v1.Preconditions":{"description":"Preconditions must be fulfilled before an operation (update, delete, etc.) is carried out.","type":"object","properties":{"resourceVersion":{"description":"Specifies the target ResourceVersion","type":"string"},"uid":{"description":"Specifies the target UID.","type":"string"}}},"io.k8s.apimachinery.pkg.apis.meta.v1.Status":{"description":"Status is a return value for calls that don't return other objects.","type":"object","properties":{"apiVersion":{"description":"APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources","type":"string"},"code":{"description":"Suggested HTTP return code for this status, 0 if not set.","type":"integer","format":"int32"},"details":{"description":"Extended data associated with the reason. Each reason may define its own extended details. This field is optional and the data returned is not guaranteed to conform to any schema except that defined by the reason type.","$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.StatusDetails"},"kind":{"description":"Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds","type":"string"},"message":{"description":"A human-readable description of the status of this operation.","type":"string"},"metadata":{"description":"Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds","default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta"},"reason":{"description":"A machine-readable description of why this operation is in the \"Failure\" status. If this value is empty there is no information available. A Reason clarifies an HTTP status code but does not override it.","type":"string"},"status":{"description":"Status of the operation. One of: \"Success\" or \"Failure\". More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status","type":"string"}},"x-kubernetes-group-version-kind":[{"group":"","kind":"Status","version":"v1"}]},"io.k8s.apimachinery.pkg.apis.meta.v1.StatusCause":{"description":"StatusCause provides more information about an api.Status failure, including cases when multiple errors are encountered.","type":"object","properties":{"field":{"description":"The field of the resource that has caused this error, as named by its JSON serialization. May include dot and postfix notation for nested attributes. Arrays are zero-indexed. Fields may appear more than once in an array of causes due to fields having multiple errors. Optional.\n\nExamples:\n \"name\" - the field \"name\" on the current resource\n \"items[0].name\" - the field \"name\" on the first array entry in \"items\"","type":"string"},"message":{"description":"A human-readable description of the cause of the error. This field may be presented as-is to a reader.","type":"string"},"reason":{"description":"A machine-readable description of the cause of the error. If this value is empty there is no information available.","type":"string"}}},"io.k8s.apimachinery.pkg.apis.meta.v1.StatusDetails":{"description":"StatusDetails is a set of additional properties that MAY be set by the server to provide additional information about a response. The Reason field of a Status object defines what attributes will be set. Clients must ignore fields that do not match the defined type of each attribute, and should assume that any attribute may be empty, invalid, or under defined.","type":"object","properties":{"causes":{"description":"The Causes array includes more details associated with the StatusReason failure. Not all StatusReasons may provide detailed causes.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.StatusCause"}},"group":{"description":"The group attribute of the resource associated with the status StatusReason.","type":"string"},"kind":{"description":"The kind attribute of the resource associated with the status StatusReason. On some operations may differ from the requested resource Kind. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds","type":"string"},"name":{"description":"The name attribute of the resource associated with the status StatusReason (when there is a single name which can be described).","type":"string"},"retryAfterSeconds":{"description":"If specified, the time in seconds before the operation should be retried. Some errors may indicate the client must take an alternate action - for those errors this field may indicate how long to wait before taking the alternate action.","type":"integer","format":"int32"},"uid":{"description":"UID of the resource. (when there is a single resource which can be described). More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#uids","type":"string"}}},"io.k8s.apimachinery.pkg.apis.meta.v1.Time":{"description":"Time is a wrapper around time.Time which supports correct marshaling to YAML and JSON. Wrappers are provided for many of the factory methods that the time package offers.","type":"string","format":"date-time"},"io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent":{"description":"Event represents a single event to a watched resource.","type":"object","required":["type","object"],"properties":{"object":{"description":"Object is:\n * If Type is Added or Modified: the new state of the object.\n * If Type is Deleted: the state of the object immediately before deletion.\n * If Type is Error: *Status is recommended; other types may make sense\n depending on context.","default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.runtime.RawExtension"},"type":{"type":"string","default":""}},"x-kubernetes-group-version-kind":[{"group":"","kind":"WatchEvent","version":"v1"},{"group":"admission.k8s.io","kind":"WatchEvent","version":"v1"},{"group":"admission.k8s.io","kind":"WatchEvent","version":"v1beta1"},{"group":"admissionregistration.k8s.io","kind":"WatchEvent","version":"v1"},{"group":"admissionregistration.k8s.io","kind":"WatchEvent","version":"v1beta1"},{"group":"apiextensions.k8s.io","kind":"WatchEvent","version":"v1"},{"group":"apiextensions.k8s.io","kind":"WatchEvent","version":"v1beta1"},{"group":"apiregistration.k8s.io","kind":"WatchEvent","version":"v1"},{"group":"apiregistration.k8s.io","kind":"WatchEvent","version":"v1beta1"},{"group":"apps","kind":"WatchEvent","version":"v1"},{"group":"apps","kind":"WatchEvent","version":"v1beta1"},{"group":"apps","kind":"WatchEvent","version":"v1beta2"},{"group":"authentication.k8s.io","kind":"WatchEvent","version":"v1"},{"group":"authentication.k8s.io","kind":"WatchEvent","version":"v1beta1"},{"group":"authorization.k8s.io","kind":"WatchEvent","version":"v1"},{"group":"authorization.k8s.io","kind":"WatchEvent","version":"v1beta1"},{"group":"autoscaling","kind":"WatchEvent","version":"v1"},{"group":"autoscaling","kind":"WatchEvent","version":"v2"},{"group":"autoscaling","kind":"WatchEvent","version":"v2beta1"},{"group":"autoscaling","kind":"WatchEvent","version":"v2beta2"},{"group":"batch","kind":"WatchEvent","version":"v1"},{"group":"batch","kind":"WatchEvent","version":"v1beta1"},{"group":"certificates.k8s.io","kind":"WatchEvent","version":"v1"},{"group":"certificates.k8s.io","kind":"WatchEvent","version":"v1beta1"},{"group":"coordination.k8s.io","kind":"WatchEvent","version":"v1"},{"group":"coordination.k8s.io","kind":"WatchEvent","version":"v1beta1"},{"group":"discovery.k8s.io","kind":"WatchEvent","version":"v1"},{"group":"discovery.k8s.io","kind":"WatchEvent","version":"v1beta1"},{"group":"events.k8s.io","kind":"WatchEvent","version":"v1"},{"group":"events.k8s.io","kind":"WatchEvent","version":"v1beta1"},{"group":"extensions","kind":"WatchEvent","version":"v1beta1"},{"group":"flowcontrol.apiserver.k8s.io","kind":"WatchEvent","version":"v1alpha1"},{"group":"flowcontrol.apiserver.k8s.io","kind":"WatchEvent","version":"v1beta1"},{"group":"flowcontrol.apiserver.k8s.io","kind":"WatchEvent","version":"v1beta2"},{"group":"imagepolicy.k8s.io","kind":"WatchEvent","version":"v1alpha1"},{"group":"internal.apiserver.k8s.io","kind":"WatchEvent","version":"v1alpha1"},{"group":"networking.k8s.io","kind":"WatchEvent","version":"v1"},{"group":"networking.k8s.io","kind":"WatchEvent","version":"v1beta1"},{"group":"node.k8s.io","kind":"WatchEvent","version":"v1"},{"group":"node.k8s.io","kind":"WatchEvent","version":"v1alpha1"},{"group":"node.k8s.io","kind":"WatchEvent","version":"v1beta1"},{"group":"policy","kind":"WatchEvent","version":"v1"},{"group":"policy","kind":"WatchEvent","version":"v1beta1"},{"group":"rbac.authorization.k8s.io","kind":"WatchEvent","version":"v1"},{"group":"rbac.authorization.k8s.io","kind":"WatchEvent","version":"v1alpha1"},{"group":"rbac.authorization.k8s.io","kind":"WatchEvent","version":"v1beta1"},{"group":"scheduling.k8s.io","kind":"WatchEvent","version":"v1"},{"group":"scheduling.k8s.io","kind":"WatchEvent","version":"v1alpha1"},{"group":"scheduling.k8s.io","kind":"WatchEvent","version":"v1beta1"},{"group":"storage.k8s.io","kind":"WatchEvent","version":"v1"},{"group":"storage.k8s.io","kind":"WatchEvent","version":"v1alpha1"},{"group":"storage.k8s.io","kind":"WatchEvent","version":"v1beta1"}]},"io.k8s.apimachinery.pkg.runtime.RawExtension":{"description":"RawExtension is used to hold extensions in external versions.\n\nTo use this, make a field which has RawExtension as its type in your external, versioned struct, and Object in your internal struct. You also need to register your various plugin types.\n\n// Internal package: type MyAPIObject struct {\n\truntime.TypeMeta `json:\",inline\"`\n\tMyPlugin runtime.Object `json:\"myPlugin\"`\n} type PluginA struct {\n\tAOption string `json:\"aOption\"`\n}\n\n// External package: type MyAPIObject struct {\n\truntime.TypeMeta `json:\",inline\"`\n\tMyPlugin runtime.RawExtension `json:\"myPlugin\"`\n} type PluginA struct {\n\tAOption string `json:\"aOption\"`\n}\n\n// On the wire, the JSON will look something like this: {\n\t\"kind\":\"MyAPIObject\",\n\t\"apiVersion\":\"v1\",\n\t\"myPlugin\": {\n\t\t\"kind\":\"PluginA\",\n\t\t\"aOption\":\"foo\",\n\t},\n}\n\nSo what happens? Decode first uses json or yaml to unmarshal the serialized data into your external MyAPIObject. That causes the raw JSON to be stored, but not unpacked. The next step is to copy (using pkg/conversion) into the internal struct. The runtime package's DefaultScheme has conversion functions installed which will unpack the JSON stored in RawExtension, turning it into the correct object type, and storing it in the Object. (TODO: In the case where the object is of an unknown type, a runtime.Unknown object will be created and stored.)","type":"object"},"io.k8s.apimachinery.pkg.util.intstr.IntOrString":{"description":"IntOrString is a type that can hold an int32 or a string. When used in JSON or YAML marshalling and unmarshalling, it produces or consumes the inner type. This allows you to have, for example, a JSON field that can accept a name or number.","type":"string","format":"int-or-string"}}}} diff --git a/openapi/openapitest/testdata/api__v1_openapi.json b/openapi/openapitest/testdata/api__v1_openapi.json index d039c7a6f..4637e313d 100644 --- a/openapi/openapitest/testdata/api__v1_openapi.json +++ b/openapi/openapitest/testdata/api__v1_openapi.json @@ -5235,7 +5235,7 @@ "description": "SecurityContext holds pod-level security attributes and common container settings. Optional: Defaults to empty. See type description for default values of each field." }, "serviceAccount": { - "description": "DeprecatedServiceAccount is a depreciated alias for ServiceAccountName. Deprecated: Use serviceAccountName instead.", + "description": "DeprecatedServiceAccount is a deprecated alias for ServiceAccountName. Deprecated: Use serviceAccountName instead.", "type": "string" }, "serviceAccountName": { diff --git a/openapi/openapitest/testdata/apis__apps__v1_openapi.json b/openapi/openapitest/testdata/apis__apps__v1_openapi.json index 21c3c4c37..137cad66c 100644 --- a/openapi/openapitest/testdata/apis__apps__v1_openapi.json +++ b/openapi/openapitest/testdata/apis__apps__v1_openapi.json @@ -3677,7 +3677,7 @@ "description": "SecurityContext holds pod-level security attributes and common container settings. Optional: Defaults to empty. See type description for default values of each field." }, "serviceAccount": { - "description": "DeprecatedServiceAccount is a depreciated alias for ServiceAccountName. Deprecated: Use serviceAccountName instead.", + "description": "DeprecatedServiceAccount is a deprecated alias for ServiceAccountName. Deprecated: Use serviceAccountName instead.", "type": "string" }, "serviceAccountName": { diff --git a/openapi/openapitest/testdata/apis__batch__v1_openapi.json b/openapi/openapitest/testdata/apis__batch__v1_openapi.json index b43168bb1..a8f96b007 100644 --- a/openapi/openapitest/testdata/apis__batch__v1_openapi.json +++ b/openapi/openapitest/testdata/apis__batch__v1_openapi.json @@ -2851,7 +2851,7 @@ "description": "SecurityContext holds pod-level security attributes and common container settings. Optional: Defaults to empty. See type description for default values of each field." }, "serviceAccount": { - "description": "DeprecatedServiceAccount is a depreciated alias for ServiceAccountName. Deprecated: Use serviceAccountName instead.", + "description": "DeprecatedServiceAccount is a deprecated alias for ServiceAccountName. Deprecated: Use serviceAccountName instead.", "type": "string" }, "serviceAccountName": { From e88f4481f2db40d82ea210a08e2b3792f31776e4 Mon Sep 17 00:00:00 2001 From: Kubernetes Publisher Date: Wed, 21 Feb 2024 01:40:39 -0800 Subject: [PATCH 042/239] Merge pull request #123392 from thockin/depreciate Cleanup: s/depreciated/deprecated/g Kubernetes-commit: 11785bb815d58eb553be3a1fa305464c35d860cc --- go.mod | 8 ++++---- go.sum | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/go.mod b/go.mod index d129ed630..2388b7afe 100644 --- a/go.mod +++ b/go.mod @@ -24,8 +24,8 @@ require ( golang.org/x/term v0.15.0 golang.org/x/time v0.3.0 google.golang.org/protobuf v1.31.0 - k8s.io/api v0.0.0-20240215012102-e929f86ae1d3 - k8s.io/apimachinery v0.0.0-20240215011828-665c1a23c2ec + k8s.io/api v0.0.0-20240221122400-4efc15a7a4b4 + k8s.io/apimachinery v0.0.0-20240221122145-856aea55acea k8s.io/klog/v2 v2.120.1 k8s.io/kube-openapi v0.0.0-20231113174909-778a5567bc1e k8s.io/utils v0.0.0-20230726121419-3b25d923346b @@ -61,6 +61,6 @@ require ( ) replace ( - k8s.io/api => k8s.io/api v0.0.0-20240215012102-e929f86ae1d3 - k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20240215011828-665c1a23c2ec + k8s.io/api => k8s.io/api v0.0.0-20240221122400-4efc15a7a4b4 + k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20240221122145-856aea55acea ) diff --git a/go.sum b/go.sum index c12aef6de..3fb38ce11 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-20240215012102-e929f86ae1d3 h1:jc021XXOSiujuEcQBONY94N/kj4NHHM3h/LyF8vLtKk= -k8s.io/api v0.0.0-20240215012102-e929f86ae1d3/go.mod h1:UGYftZGEVWJmjcFQ0WHZVmn2xla1pekOgF2jxBJGfcA= -k8s.io/apimachinery v0.0.0-20240215011828-665c1a23c2ec h1:xg6PT422JEtM3dA+ecSlDp6nBrl9SHnJJvMEnvwu2uY= -k8s.io/apimachinery v0.0.0-20240215011828-665c1a23c2ec/go.mod h1:8Kbkl+Wq46koELfFfSvx+qgICYK22zw/3Epu/RdY6yQ= +k8s.io/api v0.0.0-20240221122400-4efc15a7a4b4 h1:qCX5T0ocJ1Uai8CWIQ/cAjafWV1cJDy89O0T6NGfGgQ= +k8s.io/api v0.0.0-20240221122400-4efc15a7a4b4/go.mod h1:dQtw3DS5VYIBF9ruCg+iFD137v1EBNZxYIsBT7w6ncg= +k8s.io/apimachinery v0.0.0-20240221122145-856aea55acea h1:noOTXkaeQKCee5NTYUJXa3mKJHpnaqt1BleKeNg6CEo= +k8s.io/apimachinery v0.0.0-20240221122145-856aea55acea/go.mod h1:8Kbkl+Wq46koELfFfSvx+qgICYK22zw/3Epu/RdY6yQ= 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-20231113174909-778a5567bc1e h1:snPmy96t93RredGRjKfMFt+gvxuVAncqSAyBveJtr4Q= From 7eae79e001b196579d98507cd5c8fd6ac2203a87 Mon Sep 17 00:00:00 2001 From: Sean Sullivan Date: Tue, 13 Feb 2024 14:10:40 -0800 Subject: [PATCH 043/239] remote command turn on feature gates Kubernetes-commit: a147693deb2e7f040cf367aae4a7ae5d1cb3e7aa --- tools/remotecommand/fallback.go | 10 +++++----- tools/remotecommand/fallback_test.go | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tools/remotecommand/fallback.go b/tools/remotecommand/fallback.go index 4846cdb55..3efde3c58 100644 --- a/tools/remotecommand/fallback.go +++ b/tools/remotecommand/fallback.go @@ -20,9 +20,9 @@ import ( "context" ) -var _ Executor = &fallbackExecutor{} +var _ Executor = &FallbackExecutor{} -type fallbackExecutor struct { +type FallbackExecutor struct { primary Executor secondary Executor shouldFallback func(error) bool @@ -33,7 +33,7 @@ type fallbackExecutor struct { // websocket "StreamWithContext" call fails. // func NewFallbackExecutor(config *restclient.Config, method string, url *url.URL) (Executor, error) { func NewFallbackExecutor(primary, secondary Executor, shouldFallback func(error) bool) (Executor, error) { - return &fallbackExecutor{ + return &FallbackExecutor{ primary: primary, secondary: secondary, shouldFallback: shouldFallback, @@ -41,14 +41,14 @@ func NewFallbackExecutor(primary, secondary Executor, shouldFallback func(error) } // Stream is deprecated. Please use "StreamWithContext". -func (f *fallbackExecutor) Stream(options StreamOptions) error { +func (f *FallbackExecutor) Stream(options StreamOptions) error { return f.StreamWithContext(context.Background(), options) } // StreamWithContext initially attempts to call "StreamWithContext" using the // primary executor, falling back to calling the secondary executor if the // initial primary call to upgrade to a websocket connection fails. -func (f *fallbackExecutor) StreamWithContext(ctx context.Context, options StreamOptions) error { +func (f *FallbackExecutor) StreamWithContext(ctx context.Context, options StreamOptions) error { err := f.primary.StreamWithContext(ctx, options) if f.shouldFallback(err) { return f.secondary.StreamWithContext(ctx, options) diff --git a/tools/remotecommand/fallback_test.go b/tools/remotecommand/fallback_test.go index 700498570..52e1f7b16 100644 --- a/tools/remotecommand/fallback_test.go +++ b/tools/remotecommand/fallback_test.go @@ -193,8 +193,8 @@ func TestFallbackClient_PrimaryAndSecondaryFail(t *testing.T) { 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") + 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. From 2c68d64279be60689a435fc16bfe0f5e6c9c4ba4 Mon Sep 17 00:00:00 2001 From: Tim Hockin Date: Mon, 26 Feb 2024 23:31:41 -0800 Subject: [PATCH 044/239] Remove old gengo detritus Kubernetes-commit: 812d5fff4011df4693dcdace516feec30ebff8ba --- go.mod | 1 - 1 file changed, 1 deletion(-) diff --git a/go.mod b/go.mod index 6030cbb53..d41c385d0 100644 --- a/go.mod +++ b/go.mod @@ -63,5 +63,4 @@ require ( replace ( k8s.io/api => ../api k8s.io/apimachinery => ../apimachinery - k8s.io/client-go => ../client-go ) From e8b5ff9ea3088fae0f88a5a7e28f9b5be3e7bde3 Mon Sep 17 00:00:00 2001 From: Jordan Liggitt Date: Tue, 27 Feb 2024 18:00:45 -0500 Subject: [PATCH 045/239] Use the websocket protocol header, verify selected protocol Kubernetes-commit: b394aac4ce36457bd37459a58b4c3536d2f43d86 --- transport/websocket/roundtripper.go | 27 ++++++++++++++++++++---- transport/websocket/roundtripper_test.go | 5 +++-- 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/transport/websocket/roundtripper.go b/transport/websocket/roundtripper.go index 010f916bc..624dd5473 100644 --- a/transport/websocket/roundtripper.go +++ b/transport/websocket/roundtripper.go @@ -18,6 +18,7 @@ package websocket import ( "crypto/tls" + "errors" "fmt" "net/http" "net/url" @@ -25,6 +26,7 @@ import ( gwebsocket "github.com/gorilla/websocket" "k8s.io/apimachinery/pkg/util/httpstream" + "k8s.io/apimachinery/pkg/util/httpstream/wsstream" utilnet "k8s.io/apimachinery/pkg/util/net" restclient "k8s.io/client-go/rest" "k8s.io/client-go/transport" @@ -88,8 +90,8 @@ func (rt *RoundTripper) RoundTrip(request *http.Request) (retResp *http.Response }() // set the protocol version directly on the dialer from the header - protocolVersions := request.Header[httpstream.HeaderProtocolVersion] - delete(request.Header, httpstream.HeaderProtocolVersion) + protocolVersions := request.Header[wsstream.WebSocketProtocolHeader] + delete(request.Header, wsstream.WebSocketProtocolHeader) dialer := gwebsocket.Dialer{ Proxy: rt.Proxier, @@ -108,7 +110,23 @@ 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 { - return nil, &httpstream.UpgradeFailureError{Cause: err} + if errors.Is(err, gwebsocket.ErrBadHandshake) { + return nil, &httpstream.UpgradeFailureError{Cause: err} + } + return nil, err + } + + // Ensure we got back a protocol we understand + foundProtocol := false + for _, protocolVersion := range protocolVersions { + if protocolVersion == wsConn.Subprotocol() { + foundProtocol = true + break + } + } + if !foundProtocol { + wsConn.Close() // nolint:errcheck + return nil, &httpstream.UpgradeFailureError{Cause: fmt.Errorf("invalid protocol, expected one of %q, got %q", protocolVersions, wsConn.Subprotocol())} } rt.Conn = wsConn @@ -149,7 +167,8 @@ func RoundTripperFor(config *restclient.Config) (http.RoundTripper, ConnectionHo // a WebSocket connection. Upon success, it returns the negotiated connection. // The round tripper rt must use the WebSocket round tripper wsRt - see RoundTripperFor. func Negotiate(rt http.RoundTripper, connectionInfo ConnectionHolder, req *http.Request, protocols ...string) (*gwebsocket.Conn, error) { - req.Header[httpstream.HeaderProtocolVersion] = protocols + // Plumb protocols to RoundTripper#RoundTrip + req.Header[wsstream.WebSocketProtocolHeader] = protocols resp, err := rt.RoundTrip(req) if err != nil { return nil, err diff --git a/transport/websocket/roundtripper_test.go b/transport/websocket/roundtripper_test.go index 16bfbf570..39baba4b3 100644 --- a/transport/websocket/roundtripper_test.go +++ b/transport/websocket/roundtripper_test.go @@ -54,7 +54,7 @@ func TestWebSocketRoundTripper_RoundTripperSucceeds(t *testing.T) { rt, wsRt, err := RoundTripperFor(&restclient.Config{Host: websocketLocation.Host}) require.NoError(t, err) requestedProtocol := remotecommand.StreamProtocolV5Name - req.Header[httpstream.HeaderProtocolVersion] = []string{requestedProtocol} + req.Header[wsstream.WebSocketProtocolHeader] = []string{requestedProtocol} _, err = rt.RoundTrip(req) require.NoError(t, err) // WebSocket Connection is stored in websocket RoundTripper. @@ -83,11 +83,12 @@ func TestWebSocketRoundTripper_RoundTripperFails(t *testing.T) { require.NoError(t, err) // Requested subprotocol version 1 is not supported by test websocket server. requestedProtocol := remotecommand.StreamProtocolV1Name - req.Header[httpstream.HeaderProtocolVersion] = []string{requestedProtocol} + req.Header[wsstream.WebSocketProtocolHeader] = []string{requestedProtocol} _, 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, httpstream.IsUpgradeFailure(err)) } func TestWebSocketRoundTripper_NegotiateCreatesConnection(t *testing.T) { From 2f00261364cb9e377bd698cab2db0249fe2af867 Mon Sep 17 00:00:00 2001 From: Kubernetes Publisher Date: Tue, 27 Feb 2024 21:01:55 -0800 Subject: [PATCH 046/239] Merge pull request #123281 from seans3/remote-command-websocket-beta RemoteCommand over WebSockets to Beta Kubernetes-commit: f7ca532472f035db2aedc8a1f86639dfd1dc596f --- go.mod | 4 ++-- go.sum | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index a35907366..9f1c17ab3 100644 --- a/go.mod +++ b/go.mod @@ -24,7 +24,7 @@ require ( golang.org/x/term v0.17.0 golang.org/x/time v0.3.0 google.golang.org/protobuf v1.31.0 - k8s.io/api v0.0.0-20240221202343-ffee488e7bd8 + k8s.io/api v0.0.0-20240228104440-d6ea7e8f9bfc k8s.io/apimachinery v0.0.0-20240221202133-0f2e9357997f k8s.io/klog/v2 v2.120.1 k8s.io/kube-openapi v0.0.0-20231113174909-778a5567bc1e @@ -61,6 +61,6 @@ require ( ) replace ( - k8s.io/api => k8s.io/api v0.0.0-20240221202343-ffee488e7bd8 + k8s.io/api => k8s.io/api v0.0.0-20240228104440-d6ea7e8f9bfc k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20240221202133-0f2e9357997f ) diff --git a/go.sum b/go.sum index fcd1355c8..b79510608 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-20240221202343-ffee488e7bd8 h1:K3vOhiu2OcPzv/gdniojRhysSxAyc5iSFtp9nVbS7m4= -k8s.io/api v0.0.0-20240221202343-ffee488e7bd8/go.mod h1:kCYq4mrNBxRaHCZeTveL6//1FveIDm3wxJZeFNKF6b8= +k8s.io/api v0.0.0-20240228104440-d6ea7e8f9bfc h1:7IBpQCcIsPKGiK8R2xVKsFYdcqvt5UIiA4ARPHdlUoQ= +k8s.io/api v0.0.0-20240228104440-d6ea7e8f9bfc/go.mod h1:kCYq4mrNBxRaHCZeTveL6//1FveIDm3wxJZeFNKF6b8= k8s.io/apimachinery v0.0.0-20240221202133-0f2e9357997f h1:IvhurYeUUiUsNbDhVJHvOwhgfpUoobqtGQGat2VxfcQ= k8s.io/apimachinery v0.0.0-20240221202133-0f2e9357997f/go.mod h1:/862Kkwje5hhHGJWPKiaHuov2c6mw6uCXWikV9kOIP4= k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw= From b40bb27cf28c19b3b27ad6996fbe6d6df0813b4d Mon Sep 17 00:00:00 2001 From: Tim Hockin Date: Wed, 28 Feb 2024 16:50:55 -0800 Subject: [PATCH 047/239] Fix up go.mod files after reviews Because of how the previous 100+ commits were done, so changes snuck thru that properly belong in earlier commits but it's not really possible to do that without a lot of effort. We agreed it was OK to "spackle" these cracks with a final commit. Kubernetes-commit: 21715e6bbd19c932576ff268843d8ead3edb05e4 --- go.mod | 1 + 1 file changed, 1 insertion(+) diff --git a/go.mod b/go.mod index d41c385d0..6030cbb53 100644 --- a/go.mod +++ b/go.mod @@ -63,4 +63,5 @@ require ( replace ( k8s.io/api => ../api k8s.io/apimachinery => ../apimachinery + k8s.io/client-go => ../client-go ) From 36a771f98c38384c7fdcfd73487fc79a6dcb5636 Mon Sep 17 00:00:00 2001 From: Jordan Liggitt Date: Thu, 29 Feb 2024 15:10:28 -0500 Subject: [PATCH 048/239] Make websocket heartbeat test timing less flaky Kubernetes-commit: 26484df2108eff8ad6e06dfc960eae3bdfbf4663 --- tools/remotecommand/websocket_test.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/remotecommand/websocket_test.go b/tools/remotecommand/websocket_test.go index 61df2b77a..a6a1baf56 100644 --- a/tools/remotecommand/websocket_test.go +++ b/tools/remotecommand/websocket_test.go @@ -817,6 +817,8 @@ func TestWebSocketClient_BadHandshake(t *testing.T) { // TestWebSocketClient_HeartbeatTimeout tests the heartbeat by forcing a // timeout by setting the ping period greater than the deadline. func TestWebSocketClient_HeartbeatTimeout(t *testing.T) { + blockRequestCtx, unblockRequest := context.WithCancel(context.Background()) + defer unblockRequest() // Create fake WebSocket server which blocks. websocketServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { conns, err := webSocketServerStreams(req, w, streamOptionsFromRequest(req)) @@ -824,8 +826,7 @@ func TestWebSocketClient_HeartbeatTimeout(t *testing.T) { t.Fatalf("error on webSocketServerStreams: %v", err) } defer conns.conn.Close() - // Block server; heartbeat timeout (or test timeout) will fire before this returns. - time.Sleep(1 * time.Second) + <-blockRequestCtx.Done() })) defer websocketServer.Close() // Create websocket client connecting to fake server. @@ -840,8 +841,8 @@ func TestWebSocketClient_HeartbeatTimeout(t *testing.T) { } streamExec := exec.(*wsStreamExecutor) // Ping period is greater than the ping deadline, forcing the timeout to fire. - pingPeriod := 20 * time.Millisecond - pingDeadline := 5 * time.Millisecond + pingPeriod := wait.ForeverTestTimeout // this lets the heartbeat deadline expire without renewing it + pingDeadline := time.Second // this gives setup 1 second to establish streams streamExec.heartbeatPeriod = pingPeriod streamExec.heartbeatDeadline = pingDeadline // Send some random data to the websocket server through STDIN. @@ -859,8 +860,7 @@ func TestWebSocketClient_HeartbeatTimeout(t *testing.T) { }() select { - case <-time.After(pingPeriod * 5): - // Give up after about five ping attempts + case <-time.After(wait.ForeverTestTimeout): t.Fatalf("expected heartbeat timeout, got none.") case err := <-errorChan: // Expecting heartbeat timeout error. From 27b14078659c10a99700812496ac6e3664d192f2 Mon Sep 17 00:00:00 2001 From: Jordan Liggitt Date: Thu, 29 Feb 2024 15:31:55 -0500 Subject: [PATCH 049/239] Keep streams from being set up after closeAllStreamReaders is called Kubernetes-commit: 6c1a935da2df8e6ccf1ea6afcf51cb288f355356 --- tools/remotecommand/websocket.go | 23 ++++++++++++++++++++--- tools/remotecommand/websocket_test.go | 8 ++++++++ 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/tools/remotecommand/websocket.go b/tools/remotecommand/websocket.go index a60986dec..49ef4717c 100644 --- a/tools/remotecommand/websocket.go +++ b/tools/remotecommand/websocket.go @@ -187,6 +187,9 @@ type wsStreamCreator struct { // map of stream id to stream; multiple streams read/write the connection streams map[byte]*stream streamsMu sync.Mutex + // setStreamErr holds the error to return to anyone calling setStreams. + // this is populated in closeAllStreamReaders + setStreamErr error } func newWSStreamCreator(conn *gwebsocket.Conn) *wsStreamCreator { @@ -202,10 +205,14 @@ func (c *wsStreamCreator) getStream(id byte) *stream { return c.streams[id] } -func (c *wsStreamCreator) setStream(id byte, s *stream) { +func (c *wsStreamCreator) setStream(id byte, s *stream) error { c.streamsMu.Lock() defer c.streamsMu.Unlock() + if c.setStreamErr != nil { + return c.setStreamErr + } c.streams[id] = s + return nil } // CreateStream uses id from passed headers to create a stream over "c.conn" connection. @@ -228,7 +235,11 @@ func (c *wsStreamCreator) CreateStream(headers http.Header) (httpstream.Stream, connWriteLock: &c.connWriteLock, id: id, } - c.setStream(id, s) + if err := c.setStream(id, s); err != nil { + _ = s.writePipe.Close() + _ = s.readPipe.Close() + return nil, err + } return s, nil } @@ -312,7 +323,7 @@ func (c *wsStreamCreator) readDemuxLoop(bufferSize int, period time.Duration, de } // closeAllStreamReaders closes readers in all streams. -// This unblocks all stream.Read() calls. +// This unblocks all stream.Read() calls, and keeps any future streams from being created. func (c *wsStreamCreator) closeAllStreamReaders(err error) { c.streamsMu.Lock() defer c.streamsMu.Unlock() @@ -320,6 +331,12 @@ func (c *wsStreamCreator) closeAllStreamReaders(err error) { // Closing writePipe unblocks all readPipe.Read() callers and prevents any future writes. _ = s.writePipe.CloseWithError(err) } + // ensure callers to setStreams receive an error after this point + if err != nil { + c.setStreamErr = err + } else { + c.setStreamErr = fmt.Errorf("closed all streams") + } } type stream struct { diff --git a/tools/remotecommand/websocket_test.go b/tools/remotecommand/websocket_test.go index a6a1baf56..4a333b0b2 100644 --- a/tools/remotecommand/websocket_test.go +++ b/tools/remotecommand/websocket_test.go @@ -1116,6 +1116,14 @@ func TestWebSocketClient_HeartbeatSucceeds(t *testing.T) { wg.Wait() } +func TestLateStreamCreation(t *testing.T) { + c := newWSStreamCreator(nil) + c.closeAllStreamReaders(nil) + if err := c.setStream(0, nil); err == nil { + t.Fatal("expected error adding stream after closeAllStreamReaders") + } +} + func TestWebSocketClient_StreamsAndExpectedErrors(t *testing.T) { // Validate Stream functions. c := newWSStreamCreator(nil) From 1047f6396b27dad30e1ffd26a79a77bff6541f6e Mon Sep 17 00:00:00 2001 From: Kubernetes Publisher Date: Thu, 29 Feb 2024 13:40:48 -0800 Subject: [PATCH 050/239] Merge pull request #123598 from liggitt/remotecommand-cleanup Remotecommand test flake cleanup Kubernetes-commit: 0d50a398df50b2b7c21ed45c5e186906bc548c7a --- go.mod | 4 ++-- go.sum | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 9f1c17ab3..6b199235f 100644 --- a/go.mod +++ b/go.mod @@ -25,7 +25,7 @@ require ( golang.org/x/time v0.3.0 google.golang.org/protobuf v1.31.0 k8s.io/api v0.0.0-20240228104440-d6ea7e8f9bfc - k8s.io/apimachinery v0.0.0-20240221202133-0f2e9357997f + k8s.io/apimachinery v0.0.0-20240229214048-6362b69e393e k8s.io/klog/v2 v2.120.1 k8s.io/kube-openapi v0.0.0-20231113174909-778a5567bc1e k8s.io/utils v0.0.0-20230726121419-3b25d923346b @@ -62,5 +62,5 @@ require ( replace ( k8s.io/api => k8s.io/api v0.0.0-20240228104440-d6ea7e8f9bfc - k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20240221202133-0f2e9357997f + k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20240229214048-6362b69e393e ) diff --git a/go.sum b/go.sum index b79510608..70eaa1f74 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-20240228104440-d6ea7e8f9bfc h1:7IBpQCcIsPKGiK8R2xVKsFYdcqvt5UIiA4ARPHdlUoQ= k8s.io/api v0.0.0-20240228104440-d6ea7e8f9bfc/go.mod h1:kCYq4mrNBxRaHCZeTveL6//1FveIDm3wxJZeFNKF6b8= -k8s.io/apimachinery v0.0.0-20240221202133-0f2e9357997f h1:IvhurYeUUiUsNbDhVJHvOwhgfpUoobqtGQGat2VxfcQ= -k8s.io/apimachinery v0.0.0-20240221202133-0f2e9357997f/go.mod h1:/862Kkwje5hhHGJWPKiaHuov2c6mw6uCXWikV9kOIP4= +k8s.io/apimachinery v0.0.0-20240229214048-6362b69e393e h1:2XgAKNuD1VSLa8SmR/BCQR6MX6xHn1SyB29fBYaBpcI= +k8s.io/apimachinery v0.0.0-20240229214048-6362b69e393e/go.mod h1:/862Kkwje5hhHGJWPKiaHuov2c6mw6uCXWikV9kOIP4= 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-20231113174909-778a5567bc1e h1:snPmy96t93RredGRjKfMFt+gvxuVAncqSAyBveJtr4Q= From 4bf7f9496ed6a7ad1ed34bb8910012be5b3b9e98 Mon Sep 17 00:00:00 2001 From: Jefftree Date: Fri, 19 Jan 2024 16:13:47 -0500 Subject: [PATCH 051/239] Use v2 types with agg discovery Kubernetes-commit: 462dd326c2e98d937a96d49002883000efe4b2d6 --- discovery/aggregated_discovery.go | 124 ++- discovery/aggregated_discovery_test.go | 941 +++++++++++++++++- .../cached/disk/cached_discovery_test.go | 4 +- discovery/cached/memory/memcache_test.go | 5 +- discovery/discovery_client.go | 29 +- discovery/discovery_client_test.go | 683 +++++++++++-- 6 files changed, 1688 insertions(+), 98 deletions(-) diff --git a/discovery/aggregated_discovery.go b/discovery/aggregated_discovery.go index f72c42051..f5eaaedab 100644 --- a/discovery/aggregated_discovery.go +++ b/discovery/aggregated_discovery.go @@ -19,7 +19,8 @@ package discovery import ( "fmt" - apidiscovery "k8s.io/api/apidiscovery/v2beta1" + apidiscovery "k8s.io/api/apidiscovery/v2" + apidiscoveryv2beta1 "k8s.io/api/apidiscovery/v2beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime/schema" ) @@ -154,3 +155,124 @@ func convertAPISubresource(parent metav1.APIResource, in apidiscovery.APISubreso result.Verbs = in.Verbs return result, nil } + +// Please note the functions below will be removed in v1.33. They facilitate conversion +// between the deprecated type apidiscoveryv2beta1.APIGroupDiscoveryList. + +// SplitGroupsAndResourcesV2Beta1 transforms "aggregated" discovery top-level structure into +// the previous "unaggregated" discovery groups and resources. +// Deprecated: Please use SplitGroupsAndResources +func SplitGroupsAndResourcesV2Beta1(aggregatedGroups apidiscoveryv2beta1.APIGroupDiscoveryList) ( + *metav1.APIGroupList, + map[schema.GroupVersion]*metav1.APIResourceList, + map[schema.GroupVersion]error) { + // Aggregated group list will contain the entirety of discovery, including + // groups, versions, and resources. GroupVersions marked "stale" are failed. + groups := []*metav1.APIGroup{} + failedGVs := map[schema.GroupVersion]error{} + resourcesByGV := map[schema.GroupVersion]*metav1.APIResourceList{} + for _, aggGroup := range aggregatedGroups.Items { + group, resources, failed := convertAPIGroupv2beta1(aggGroup) + groups = append(groups, group) + for gv, resourceList := range resources { + resourcesByGV[gv] = resourceList + } + for gv, err := range failed { + failedGVs[gv] = err + } + } + // Transform slice of groups to group list before returning. + groupList := &metav1.APIGroupList{} + groupList.Groups = make([]metav1.APIGroup, 0, len(groups)) + for _, group := range groups { + groupList.Groups = append(groupList.Groups, *group) + } + return groupList, resourcesByGV, failedGVs +} + +// convertAPIGroupv2beta1 tranforms an "aggregated" APIGroupDiscovery to an "legacy" APIGroup, +// also returning the map of APIResourceList for resources within GroupVersions. +func convertAPIGroupv2beta1(g apidiscoveryv2beta1.APIGroupDiscovery) ( + *metav1.APIGroup, + map[schema.GroupVersion]*metav1.APIResourceList, + map[schema.GroupVersion]error) { + // Iterate through versions to convert to group and resources. + group := &metav1.APIGroup{} + gvResources := map[schema.GroupVersion]*metav1.APIResourceList{} + failedGVs := map[schema.GroupVersion]error{} + group.Name = g.ObjectMeta.Name + for _, v := range g.Versions { + gv := schema.GroupVersion{Group: g.Name, Version: v.Version} + if v.Freshness == apidiscoveryv2beta1.DiscoveryFreshnessStale { + failedGVs[gv] = StaleGroupVersionError{gv: gv} + continue + } + version := metav1.GroupVersionForDiscovery{} + version.GroupVersion = gv.String() + version.Version = v.Version + group.Versions = append(group.Versions, version) + // PreferredVersion is first non-stale Version + if group.PreferredVersion == (metav1.GroupVersionForDiscovery{}) { + group.PreferredVersion = version + } + resourceList := &metav1.APIResourceList{} + resourceList.GroupVersion = gv.String() + for _, r := range v.Resources { + resource, err := convertAPIResourcev2beta1(r) + if err == nil { + resourceList.APIResources = append(resourceList.APIResources, resource) + } + // Subresources field in new format get transformed into full APIResources. + // It is possible a partial result with an error was returned to be used + // as the parent resource for the subresource. + for _, subresource := range r.Subresources { + sr, err := convertAPISubresourcev2beta1(resource, subresource) + if err == nil { + resourceList.APIResources = append(resourceList.APIResources, sr) + } + } + } + gvResources[gv] = resourceList + } + return group, gvResources, failedGVs +} + +// convertAPIResource tranforms a APIResourceDiscovery to an APIResource. We are +// resilient to missing GVK, since this resource might be the parent resource +// for a subresource. If the parent is missing a GVK, it is not returned in +// discovery, and the subresource MUST have the GVK. +func convertAPIResourcev2beta1(in apidiscoveryv2beta1.APIResourceDiscovery) (metav1.APIResource, error) { + result := metav1.APIResource{ + Name: in.Resource, + SingularName: in.SingularResource, + Namespaced: in.Scope == apidiscoveryv2beta1.ScopeNamespace, + Verbs: in.Verbs, + ShortNames: in.ShortNames, + Categories: in.Categories, + } + // Can return partial result with error, which can be the parent for a + // subresource. Do not add this result to the returned discovery resources. + if in.ResponseKind == nil || (*in.ResponseKind) == emptyKind { + return result, fmt.Errorf("discovery resource %s missing GVK", in.Resource) + } + result.Group = in.ResponseKind.Group + result.Version = in.ResponseKind.Version + result.Kind = in.ResponseKind.Kind + return result, nil +} + +// convertAPISubresource tranforms a APISubresourceDiscovery to an APIResource. +func convertAPISubresourcev2beta1(parent metav1.APIResource, in apidiscoveryv2beta1.APISubresourceDiscovery) (metav1.APIResource, error) { + result := metav1.APIResource{} + if in.ResponseKind == nil || (*in.ResponseKind) == emptyKind { + return result, fmt.Errorf("subresource %s/%s missing GVK", parent.Name, in.Subresource) + } + result.Name = fmt.Sprintf("%s/%s", parent.Name, in.Subresource) + result.SingularName = parent.SingularName + result.Namespaced = parent.Namespaced + result.Group = in.ResponseKind.Group + result.Version = in.ResponseKind.Version + result.Kind = in.ResponseKind.Kind + result.Verbs = in.Verbs + return result, nil +} diff --git a/discovery/aggregated_discovery_test.go b/discovery/aggregated_discovery_test.go index a5004804c..c9cb43d2d 100644 --- a/discovery/aggregated_discovery_test.go +++ b/discovery/aggregated_discovery_test.go @@ -20,7 +20,8 @@ import ( "testing" "github.com/stretchr/testify/assert" - apidiscovery "k8s.io/api/apidiscovery/v2beta1" + apidiscovery "k8s.io/api/apidiscovery/v2" + apidiscoveryv2beta1 "k8s.io/api/apidiscovery/v2beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime/schema" ) @@ -961,3 +962,941 @@ func TestSplitGroupsAndResources(t *testing.T) { assert.Equal(t, test.expectedGVResources, resourcesByGV) } } + +// Duplicated from test above. Remove after 1.33 +func TestSplitGroupsAndResourcesV2Beta1(t *testing.T) { + tests := []struct { + name string + agg apidiscoveryv2beta1.APIGroupDiscoveryList + expectedGroups metav1.APIGroupList + expectedGVResources map[schema.GroupVersion]*metav1.APIResourceList + expectedFailedGVs map[schema.GroupVersion]error + }{ + { + name: "Aggregated discovery: core/v1 group and pod resource", + agg: apidiscoveryv2beta1.APIGroupDiscoveryList{ + Items: []apidiscoveryv2beta1.APIGroupDiscovery{ + { + ObjectMeta: metav1.ObjectMeta{ + Name: "", + }, + Versions: []apidiscoveryv2beta1.APIVersionDiscovery{ + { + Version: "v1", + Resources: []apidiscoveryv2beta1.APIResourceDiscovery{ + { + Resource: "pods", + ResponseKind: &metav1.GroupVersionKind{ + Group: "", + Version: "v1", + Kind: "Pod", + }, + Scope: apidiscoveryv2beta1.ScopeNamespace, + }, + }, + }, + }, + }, + }, + }, + expectedGroups: metav1.APIGroupList{ + Groups: []metav1.APIGroup{ + { + Name: "", + Versions: []metav1.GroupVersionForDiscovery{ + { + GroupVersion: "v1", + Version: "v1", + }, + }, + PreferredVersion: metav1.GroupVersionForDiscovery{ + GroupVersion: "v1", + Version: "v1", + }, + }, + }, + }, + expectedGVResources: map[schema.GroupVersion]*metav1.APIResourceList{ + {Group: "", Version: "v1"}: { + GroupVersion: "v1", + APIResources: []metav1.APIResource{ + { + Name: "pods", + Namespaced: true, + Group: "", + Version: "v1", + Kind: "Pod", + }, + }, + }, + }, + expectedFailedGVs: map[schema.GroupVersion]error{}, + }, + { + name: "Aggregated discovery: 1 group/1 resources at /api, 1 group/2 versions/1 resources at /apis", + agg: apidiscoveryv2beta1.APIGroupDiscoveryList{ + Items: []apidiscoveryv2beta1.APIGroupDiscovery{ + { + ObjectMeta: metav1.ObjectMeta{ + Name: "apps", + }, + Versions: []apidiscoveryv2beta1.APIVersionDiscovery{ + { + Version: "v2", + Resources: []apidiscoveryv2beta1.APIResourceDiscovery{ + { + Resource: "deployments", + ResponseKind: &metav1.GroupVersionKind{ + Group: "apps", + Version: "v2", + Kind: "Deployment", + }, + Scope: apidiscoveryv2beta1.ScopeNamespace, + }, + }, + }, + { + Version: "v1", + Resources: []apidiscoveryv2beta1.APIResourceDiscovery{ + { + Resource: "deployments", + ResponseKind: &metav1.GroupVersionKind{ + Group: "apps", + Version: "v1", + Kind: "Deployment", + }, + Scope: apidiscoveryv2beta1.ScopeNamespace, + }, + }, + }, + }, + }, + }, + }, + expectedGroups: metav1.APIGroupList{ + Groups: []metav1.APIGroup{ + { + Name: "apps", + Versions: []metav1.GroupVersionForDiscovery{ + { + GroupVersion: "apps/v2", + Version: "v2", + }, + { + GroupVersion: "apps/v1", + Version: "v1", + }, + }, + PreferredVersion: metav1.GroupVersionForDiscovery{ + GroupVersion: "apps/v2", + Version: "v2", + }, + }, + }, + }, + expectedGVResources: map[schema.GroupVersion]*metav1.APIResourceList{ + {Group: "apps", Version: "v1"}: { + GroupVersion: "apps/v1", + APIResources: []metav1.APIResource{ + { + Name: "deployments", + Namespaced: true, + Group: "apps", + Version: "v1", + Kind: "Deployment", + }, + }, + }, + {Group: "apps", Version: "v2"}: { + GroupVersion: "apps/v2", + APIResources: []metav1.APIResource{ + { + Name: "deployments", + Namespaced: true, + Group: "apps", + Version: "v2", + Kind: "Deployment", + }, + }, + }, + }, + expectedFailedGVs: map[schema.GroupVersion]error{}, + }, + { + name: "Aggregated discovery: 1 group/2 resources at /api, 1 group/2 resources at /apis", + agg: apidiscoveryv2beta1.APIGroupDiscoveryList{ + Items: []apidiscoveryv2beta1.APIGroupDiscovery{ + { + Versions: []apidiscoveryv2beta1.APIVersionDiscovery{ + { + Version: "v1", + Resources: []apidiscoveryv2beta1.APIResourceDiscovery{ + { + Resource: "pods", + ResponseKind: &metav1.GroupVersionKind{ + Group: "", + Version: "v1", + Kind: "Pod", + }, + Scope: apidiscoveryv2beta1.ScopeNamespace, + }, + { + Resource: "services", + ResponseKind: &metav1.GroupVersionKind{ + Group: "", + Version: "v1", + Kind: "Service", + }, + Scope: apidiscoveryv2beta1.ScopeNamespace, + }, + }, + }, + }, + }, + { + ObjectMeta: metav1.ObjectMeta{ + Name: "apps", + }, + Versions: []apidiscoveryv2beta1.APIVersionDiscovery{ + { + Version: "v1", + Resources: []apidiscoveryv2beta1.APIResourceDiscovery{ + { + Resource: "deployments", + ResponseKind: &metav1.GroupVersionKind{ + Group: "apps", + Version: "v1", + Kind: "Deployment", + }, + Scope: apidiscoveryv2beta1.ScopeNamespace, + }, + { + Resource: "statefulsets", + ResponseKind: &metav1.GroupVersionKind{ + Group: "apps", + Version: "v1", + Kind: "StatefulSet", + }, + Scope: apidiscoveryv2beta1.ScopeNamespace, + }, + }, + }, + }, + }, + }, + }, + expectedGroups: metav1.APIGroupList{ + Groups: []metav1.APIGroup{ + { + Name: "", + Versions: []metav1.GroupVersionForDiscovery{ + { + GroupVersion: "v1", + Version: "v1", + }, + }, + PreferredVersion: metav1.GroupVersionForDiscovery{ + GroupVersion: "v1", + Version: "v1", + }, + }, + { + Name: "apps", + Versions: []metav1.GroupVersionForDiscovery{ + { + GroupVersion: "apps/v1", + Version: "v1", + }, + }, + PreferredVersion: metav1.GroupVersionForDiscovery{ + GroupVersion: "apps/v1", + Version: "v1", + }, + }, + }, + }, + expectedGVResources: map[schema.GroupVersion]*metav1.APIResourceList{ + {Group: "", Version: "v1"}: { + GroupVersion: "v1", + APIResources: []metav1.APIResource{ + { + Name: "pods", + Namespaced: true, + Group: "", + Version: "v1", + Kind: "Pod", + }, + { + Name: "services", + Namespaced: true, + Group: "", + Version: "v1", + Kind: "Service", + }, + }, + }, + {Group: "apps", Version: "v1"}: { + GroupVersion: "apps/v1", + APIResources: []metav1.APIResource{ + { + Name: "deployments", + Namespaced: true, + Group: "apps", + Version: "v1", + Kind: "Deployment", + }, + { + Name: "statefulsets", + Namespaced: true, + Group: "apps", + Version: "v1", + Kind: "StatefulSet", + }, + }, + }, + }, + expectedFailedGVs: map[schema.GroupVersion]error{}, + }, + { + name: "Aggregated discovery: multiple groups with cluster-scoped resources", + agg: apidiscoveryv2beta1.APIGroupDiscoveryList{ + Items: []apidiscoveryv2beta1.APIGroupDiscovery{ + { + Versions: []apidiscoveryv2beta1.APIVersionDiscovery{ + { + Version: "v1", + Resources: []apidiscoveryv2beta1.APIResourceDiscovery{ + { + Resource: "pods", + ResponseKind: &metav1.GroupVersionKind{ + Group: "", + Version: "v1", + Kind: "Pod", + }, + Scope: apidiscoveryv2beta1.ScopeNamespace, + }, + { + Resource: "namespaces", + ResponseKind: &metav1.GroupVersionKind{ + Group: "", + Version: "v1", + Kind: "Namespace", + }, + Scope: apidiscoveryv2beta1.ScopeCluster, + }, + }, + }, + }, + }, + { + ObjectMeta: metav1.ObjectMeta{ + Name: "rbac.authorization.k8s.io", + }, + Versions: []apidiscoveryv2beta1.APIVersionDiscovery{ + { + Version: "v1", + Resources: []apidiscoveryv2beta1.APIResourceDiscovery{ + { + Resource: "roles", + ResponseKind: &metav1.GroupVersionKind{ + Group: "rbac.authorization.k8s.io", + Version: "v1", + Kind: "Role", + }, + Scope: apidiscoveryv2beta1.ScopeCluster, + }, + { + Resource: "clusterroles", + ResponseKind: &metav1.GroupVersionKind{ + Group: "rbac.authorization.k8s.io", + Version: "v1", + Kind: "ClusterRole", + }, + Scope: apidiscoveryv2beta1.ScopeCluster, + }, + }, + }, + }, + }, + }, + }, + expectedGroups: metav1.APIGroupList{ + Groups: []metav1.APIGroup{ + { + Name: "", + Versions: []metav1.GroupVersionForDiscovery{ + { + GroupVersion: "v1", + Version: "v1", + }, + }, + PreferredVersion: metav1.GroupVersionForDiscovery{ + GroupVersion: "v1", + Version: "v1", + }, + }, + { + Name: "rbac.authorization.k8s.io", + Versions: []metav1.GroupVersionForDiscovery{ + { + GroupVersion: "rbac.authorization.k8s.io/v1", + Version: "v1", + }, + }, + PreferredVersion: metav1.GroupVersionForDiscovery{ + GroupVersion: "rbac.authorization.k8s.io/v1", + Version: "v1", + }, + }, + }, + }, + expectedGVResources: map[schema.GroupVersion]*metav1.APIResourceList{ + {Group: "", Version: "v1"}: { + GroupVersion: "v1", + APIResources: []metav1.APIResource{ + { + Name: "pods", + Namespaced: true, + Group: "", + Version: "v1", + Kind: "Pod", + }, + { + Name: "namespaces", + Namespaced: false, + Group: "", + Version: "v1", + Kind: "Namespace", + }, + }, + }, + {Group: "rbac.authorization.k8s.io", Version: "v1"}: { + GroupVersion: "rbac.authorization.k8s.io/v1", + APIResources: []metav1.APIResource{ + { + Name: "roles", + Namespaced: false, + Group: "rbac.authorization.k8s.io", + Version: "v1", + Kind: "Role", + }, + { + Name: "clusterroles", + Namespaced: false, + Group: "rbac.authorization.k8s.io", + Version: "v1", + Kind: "ClusterRole", + }, + }, + }, + }, + expectedFailedGVs: map[schema.GroupVersion]error{}, + }, + { + name: "Aggregated discovery with single subresource", + agg: apidiscoveryv2beta1.APIGroupDiscoveryList{ + Items: []apidiscoveryv2beta1.APIGroupDiscovery{ + { + ObjectMeta: metav1.ObjectMeta{ + Name: "apps", + }, + Versions: []apidiscoveryv2beta1.APIVersionDiscovery{ + { + Version: "v1", + Resources: []apidiscoveryv2beta1.APIResourceDiscovery{ + { + Resource: "deployments", + ResponseKind: &metav1.GroupVersionKind{ + Group: "apps", + Version: "v1", + Kind: "Deployment", + }, + Scope: apidiscoveryv2beta1.ScopeNamespace, + SingularResource: "deployment", + ShortNames: []string{"deploy"}, + Verbs: []string{"parentverb1", "parentverb2", "parentverb3", "parentverb4"}, + Categories: []string{"all", "testcategory"}, + Subresources: []apidiscoveryv2beta1.APISubresourceDiscovery{ + { + Subresource: "scale", + ResponseKind: &metav1.GroupVersionKind{ + Group: "apps", + Version: "v1", + Kind: "Deployment", + }, + Verbs: []string{"get", "patch", "update"}, + }, + }, + }, + }, + }, + }, + }, + }, + }, + expectedGroups: metav1.APIGroupList{ + Groups: []metav1.APIGroup{ + { + Name: "apps", + Versions: []metav1.GroupVersionForDiscovery{ + { + GroupVersion: "apps/v1", + Version: "v1", + }, + }, + PreferredVersion: metav1.GroupVersionForDiscovery{ + GroupVersion: "apps/v1", + Version: "v1", + }, + }, + }, + }, + expectedGVResources: map[schema.GroupVersion]*metav1.APIResourceList{ + {Group: "apps", Version: "v1"}: { + GroupVersion: "apps/v1", + APIResources: []metav1.APIResource{ + { + Name: "deployments", + SingularName: "deployment", + Namespaced: true, + Group: "apps", + Version: "v1", + Kind: "Deployment", + Verbs: []string{"parentverb1", "parentverb2", "parentverb3", "parentverb4"}, + ShortNames: []string{"deploy"}, + Categories: []string{"all", "testcategory"}, + }, + { + Name: "deployments/scale", + SingularName: "deployment", + Namespaced: true, + Group: "apps", + Version: "v1", + Kind: "Deployment", + Verbs: []string{"get", "patch", "update"}, + }, + }, + }, + }, + expectedFailedGVs: map[schema.GroupVersion]error{}, + }, + { + name: "Aggregated discovery with single subresource and parent missing GVK", + agg: apidiscoveryv2beta1.APIGroupDiscoveryList{ + Items: []apidiscoveryv2beta1.APIGroupDiscovery{ + { + ObjectMeta: metav1.ObjectMeta{ + Name: "external.metrics.k8s.io", + }, + Versions: []apidiscoveryv2beta1.APIVersionDiscovery{ + { + Version: "v1beta1", + Resources: []apidiscoveryv2beta1.APIResourceDiscovery{ + { + // resilient to nil GVK for parent + Resource: "*", + Scope: apidiscoveryv2beta1.ScopeNamespace, + SingularResource: "", + Subresources: []apidiscoveryv2beta1.APISubresourceDiscovery{ + { + Subresource: "other-external-metric", + ResponseKind: &metav1.GroupVersionKind{ + Kind: "MetricValueList", + }, + Verbs: []string{"get"}, + }, + }, + }, + }, + }, + }, + }, + }, + }, + expectedGroups: metav1.APIGroupList{ + Groups: []metav1.APIGroup{ + { + Name: "external.metrics.k8s.io", + Versions: []metav1.GroupVersionForDiscovery{ + { + GroupVersion: "external.metrics.k8s.io/v1beta1", + Version: "v1beta1", + }, + }, + PreferredVersion: metav1.GroupVersionForDiscovery{ + GroupVersion: "external.metrics.k8s.io/v1beta1", + Version: "v1beta1", + }, + }, + }, + }, + expectedGVResources: map[schema.GroupVersion]*metav1.APIResourceList{ + {Group: "external.metrics.k8s.io", Version: "v1beta1"}: { + GroupVersion: "external.metrics.k8s.io/v1beta1", + APIResources: []metav1.APIResource{ + // Since parent GVK was nil, it is NOT returned--only the subresource. + { + Name: "*/other-external-metric", + SingularName: "", + Namespaced: true, + Group: "", + Version: "", + Kind: "MetricValueList", + Verbs: []string{"get"}, + }, + }, + }, + }, + expectedFailedGVs: map[schema.GroupVersion]error{}, + }, + { + name: "Aggregated discovery with single subresource and parent empty GVK", + agg: apidiscoveryv2beta1.APIGroupDiscoveryList{ + Items: []apidiscoveryv2beta1.APIGroupDiscovery{ + { + ObjectMeta: metav1.ObjectMeta{ + Name: "external.metrics.k8s.io", + }, + Versions: []apidiscoveryv2beta1.APIVersionDiscovery{ + { + Version: "v1beta1", + Resources: []apidiscoveryv2beta1.APIResourceDiscovery{ + { + // resilient to empty GVK for parent + Resource: "*", + Scope: apidiscoveryv2beta1.ScopeNamespace, + SingularResource: "", + ResponseKind: &metav1.GroupVersionKind{}, + Subresources: []apidiscoveryv2beta1.APISubresourceDiscovery{ + { + Subresource: "other-external-metric", + ResponseKind: &metav1.GroupVersionKind{ + Kind: "MetricValueList", + }, + Verbs: []string{"get"}, + }, + }, + }, + }, + }, + }, + }, + }, + }, + expectedGroups: metav1.APIGroupList{ + Groups: []metav1.APIGroup{ + { + Name: "external.metrics.k8s.io", + Versions: []metav1.GroupVersionForDiscovery{ + { + GroupVersion: "external.metrics.k8s.io/v1beta1", + Version: "v1beta1", + }, + }, + PreferredVersion: metav1.GroupVersionForDiscovery{ + GroupVersion: "external.metrics.k8s.io/v1beta1", + Version: "v1beta1", + }, + }, + }, + }, + expectedGVResources: map[schema.GroupVersion]*metav1.APIResourceList{ + {Group: "external.metrics.k8s.io", Version: "v1beta1"}: { + GroupVersion: "external.metrics.k8s.io/v1beta1", + APIResources: []metav1.APIResource{ + // Since parent GVK was nil, it is NOT returned--only the subresource. + { + Name: "*/other-external-metric", + SingularName: "", + Namespaced: true, + Group: "", + Version: "", + Kind: "MetricValueList", + Verbs: []string{"get"}, + }, + }, + }, + }, + expectedFailedGVs: map[schema.GroupVersion]error{}, + }, + { + name: "Aggregated discovery with multiple subresources", + agg: apidiscoveryv2beta1.APIGroupDiscoveryList{ + Items: []apidiscoveryv2beta1.APIGroupDiscovery{ + { + ObjectMeta: metav1.ObjectMeta{ + Name: "apps", + }, + Versions: []apidiscoveryv2beta1.APIVersionDiscovery{ + { + Version: "v1", + Resources: []apidiscoveryv2beta1.APIResourceDiscovery{ + { + Resource: "deployments", + ResponseKind: &metav1.GroupVersionKind{ + Group: "apps", + Version: "v1", + Kind: "Deployment", + }, + Scope: apidiscoveryv2beta1.ScopeNamespace, + SingularResource: "deployment", + Subresources: []apidiscoveryv2beta1.APISubresourceDiscovery{ + { + Subresource: "scale", + ResponseKind: &metav1.GroupVersionKind{ + Group: "apps", + Version: "v1", + Kind: "Deployment", + }, + Verbs: []string{"get", "patch", "update"}, + }, + { + Subresource: "status", + ResponseKind: &metav1.GroupVersionKind{ + Group: "apps", + Version: "v1", + Kind: "Deployment", + }, + Verbs: []string{"get", "patch", "update"}, + }, + }, + }, + }, + }, + }, + }, + }, + }, + expectedGroups: metav1.APIGroupList{ + Groups: []metav1.APIGroup{ + { + Name: "apps", + Versions: []metav1.GroupVersionForDiscovery{ + { + GroupVersion: "apps/v1", + Version: "v1", + }, + }, + PreferredVersion: metav1.GroupVersionForDiscovery{ + GroupVersion: "apps/v1", + Version: "v1", + }, + }, + }, + }, + expectedGVResources: map[schema.GroupVersion]*metav1.APIResourceList{ + {Group: "apps", Version: "v1"}: { + GroupVersion: "apps/v1", + APIResources: []metav1.APIResource{ + { + Name: "deployments", + SingularName: "deployment", + Namespaced: true, + Group: "apps", + Version: "v1", + Kind: "Deployment", + }, + { + Name: "deployments/scale", + SingularName: "deployment", + Namespaced: true, + Group: "apps", + Version: "v1", + Kind: "Deployment", + Verbs: []string{"get", "patch", "update"}, + }, + { + Name: "deployments/status", + SingularName: "deployment", + Namespaced: true, + Group: "apps", + Version: "v1", + Kind: "Deployment", + Verbs: []string{"get", "patch", "update"}, + }, + }, + }, + }, + expectedFailedGVs: map[schema.GroupVersion]error{}, + }, + { + name: "Aggregated discovery: single failed GV at /api", + agg: apidiscoveryv2beta1.APIGroupDiscoveryList{ + Items: []apidiscoveryv2beta1.APIGroupDiscovery{ + { + Versions: []apidiscoveryv2beta1.APIVersionDiscovery{ + { + Version: "v1", + Resources: []apidiscoveryv2beta1.APIResourceDiscovery{ + { + Resource: "pods", + ResponseKind: &metav1.GroupVersionKind{ + Group: "", + Version: "v1", + Kind: "Pod", + }, + Scope: apidiscoveryv2beta1.ScopeNamespace, + }, + { + Resource: "services", + ResponseKind: &metav1.GroupVersionKind{ + Group: "", + Version: "v1", + Kind: "Service", + }, + Scope: apidiscoveryv2beta1.ScopeNamespace, + }, + }, + Freshness: apidiscoveryv2beta1.DiscoveryFreshnessStale, + }, + }, + }, + }, + }, + // Single core Group/Version is stale, so no Version within Group. + expectedGroups: metav1.APIGroupList{ + Groups: []metav1.APIGroup{{Name: ""}}, + }, + // Single core Group/Version is stale, so there are no expected resources. + expectedGVResources: map[schema.GroupVersion]*metav1.APIResourceList{}, + expectedFailedGVs: map[schema.GroupVersion]error{ + {Group: "", Version: "v1"}: StaleGroupVersionError{gv: schema.GroupVersion{Group: "", Version: "v1"}}, + }, + }, + { + name: "Aggregated discovery: single failed GV at /apis", + agg: apidiscoveryv2beta1.APIGroupDiscoveryList{ + Items: []apidiscoveryv2beta1.APIGroupDiscovery{ + { + ObjectMeta: metav1.ObjectMeta{ + Name: "apps", + }, + Versions: []apidiscoveryv2beta1.APIVersionDiscovery{ + { + Version: "v1", + Resources: []apidiscoveryv2beta1.APIResourceDiscovery{ + { + Resource: "deployments", + ResponseKind: &metav1.GroupVersionKind{ + Group: "apps", + Version: "v1", + Kind: "Deployment", + }, + Scope: apidiscoveryv2beta1.ScopeNamespace, + }, + { + Resource: "statefulsets", + ResponseKind: &metav1.GroupVersionKind{ + Group: "apps", + Version: "v1", + Kind: "StatefulSets", + }, + Scope: apidiscoveryv2beta1.ScopeNamespace, + }, + }, + Freshness: apidiscoveryv2beta1.DiscoveryFreshnessStale, + }, + }, + }, + }, + }, + // Single apps/v1 Group/Version is stale, so no Version within Group. + expectedGroups: metav1.APIGroupList{ + Groups: []metav1.APIGroup{{Name: "apps"}}, + }, + // Single apps/v1 Group/Version is stale, so there are no expected resources. + expectedGVResources: map[schema.GroupVersion]*metav1.APIResourceList{}, + expectedFailedGVs: map[schema.GroupVersion]error{ + {Group: "apps", Version: "v1"}: StaleGroupVersionError{gv: schema.GroupVersion{Group: "apps", Version: "v1"}}, + }, + }, + { + name: "Aggregated discovery: 1 group/2 versions/1 failed GV at /apis", + agg: apidiscoveryv2beta1.APIGroupDiscoveryList{ + Items: []apidiscoveryv2beta1.APIGroupDiscovery{ + { + ObjectMeta: metav1.ObjectMeta{ + Name: "apps", + }, + Versions: []apidiscoveryv2beta1.APIVersionDiscovery{ + // Stale v2 should report failed GV. + { + Version: "v2", + Resources: []apidiscoveryv2beta1.APIResourceDiscovery{ + { + Resource: "daemonsets", + ResponseKind: &metav1.GroupVersionKind{ + Group: "apps", + Version: "v2", + Kind: "DaemonSets", + }, + Scope: apidiscoveryv2beta1.ScopeNamespace, + }, + }, + Freshness: apidiscoveryv2beta1.DiscoveryFreshnessStale, + }, + { + Version: "v1", + Resources: []apidiscoveryv2beta1.APIResourceDiscovery{ + { + Resource: "deployments", + ResponseKind: &metav1.GroupVersionKind{ + Group: "apps", + Version: "v1", + Kind: "Deployment", + }, + Scope: apidiscoveryv2beta1.ScopeNamespace, + }, + }, + }, + }, + }, + }, + }, + // Only apps/v1 is non-stale expected Group/Version + expectedGroups: metav1.APIGroupList{ + Groups: []metav1.APIGroup{ + { + Name: "apps", + Versions: []metav1.GroupVersionForDiscovery{ + { + GroupVersion: "apps/v1", + Version: "v1", + }, + }, + // PreferredVersion must be apps/v1 + PreferredVersion: metav1.GroupVersionForDiscovery{ + GroupVersion: "apps/v1", + Version: "v1", + }, + }, + }, + }, + // Only apps/v1 resources expected. + expectedGVResources: map[schema.GroupVersion]*metav1.APIResourceList{ + {Group: "apps", Version: "v1"}: { + GroupVersion: "apps/v1", + APIResources: []metav1.APIResource{ + { + Name: "deployments", + Namespaced: true, + Group: "apps", + Version: "v1", + Kind: "Deployment", + }, + }, + }, + }, + expectedFailedGVs: map[schema.GroupVersion]error{ + {Group: "apps", Version: "v2"}: StaleGroupVersionError{gv: schema.GroupVersion{Group: "apps", Version: "v2"}}, + }, + }, + } + + for _, test := range tests { + apiGroups, resourcesByGV, failedGVs := SplitGroupsAndResourcesV2Beta1(test.agg) + assert.Equal(t, test.expectedFailedGVs, failedGVs) + assert.Equal(t, test.expectedGroups, *apiGroups) + assert.Equal(t, test.expectedGVResources, resourcesByGV) + } +} diff --git a/discovery/cached/disk/cached_discovery_test.go b/discovery/cached/disk/cached_discovery_test.go index e6c7a03af..f27f2a433 100644 --- a/discovery/cached/disk/cached_discovery_test.go +++ b/discovery/cached/disk/cached_discovery_test.go @@ -30,7 +30,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - apidiscovery "k8s.io/api/apidiscovery/v2beta1" + apidiscovery "k8s.io/api/apidiscovery/v2" "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" @@ -643,7 +643,7 @@ func TestCachedDiscoveryClientAggregatedServerGroups(t *testing.T) { return } // Content-type is "aggregated" discovery format. - w.Header().Set("Content-Type", discovery.AcceptV2Beta1) + w.Header().Set("Content-Type", discovery.AcceptV2) w.WriteHeader(http.StatusOK) w.Write(output) })) diff --git a/discovery/cached/memory/memcache_test.go b/discovery/cached/memory/memcache_test.go index a86ece331..dbd7b46cd 100644 --- a/discovery/cached/memory/memcache_test.go +++ b/discovery/cached/memory/memcache_test.go @@ -28,7 +28,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - apidiscovery "k8s.io/api/apidiscovery/v2beta1" + apidiscovery "k8s.io/api/apidiscovery/v2" errorsutil "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" @@ -1118,7 +1118,7 @@ func TestAggregatedMemCacheGroupsAndMaybeResources(t *testing.T) { output, err := json.Marshal(agg) require.NoError(t, err) // Content-type is "aggregated" discovery format. - w.Header().Set("Content-Type", discovery.AcceptV2Beta1) + w.Header().Set("Content-Type", discovery.AcceptV2) w.WriteHeader(http.StatusOK) w.Write(output) })) @@ -1161,6 +1161,7 @@ func TestAggregatedMemCacheGroupsAndMaybeResources(t *testing.T) { memClient.Invalidate() assert.False(t, memClient.Fresh()) apiGroupList, _, _, err = memClient.GroupsAndMaybeResources() + require.NoError(t, err) // Test the expected groups are returned for the aggregated format. actualGroupNames = sets.NewString(groupNamesFromList(apiGroupList)...) diff --git a/discovery/discovery_client.go b/discovery/discovery_client.go index df0e0f997..ef14fee5f 100644 --- a/discovery/discovery_client.go +++ b/discovery/discovery_client.go @@ -33,7 +33,8 @@ import ( "github.com/golang/protobuf/proto" openapi_v2 "github.com/google/gnostic-models/openapiv2" - apidiscovery "k8s.io/api/apidiscovery/v2beta1" + apidiscoveryv2 "k8s.io/api/apidiscovery/v2" + apidiscoveryv2beta1 "k8s.io/api/apidiscovery/v2beta1" "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" @@ -64,12 +65,14 @@ const ( // MUST be ordered (g, v, as) for server in "Accept" header (BUT we are resilient // to ordering when comparing returned values in "Content-Type" header). AcceptV2Beta1 = runtime.ContentTypeJSON + ";" + "g=apidiscovery.k8s.io;v=v2beta1;as=APIGroupDiscoveryList" + AcceptV2 = runtime.ContentTypeJSON + ";" + "g=apidiscovery.k8s.io;v=v2;as=APIGroupDiscoveryList" // Prioritize aggregated discovery by placing first in the order of discovery accept types. - acceptDiscoveryFormats = AcceptV2Beta1 + "," + AcceptV1 + acceptDiscoveryFormats = AcceptV2 + "," + AcceptV2Beta1 + "," + AcceptV1 ) // Aggregated discovery content-type GVK. var v2Beta1GVK = schema.GroupVersionKind{Group: "apidiscovery.k8s.io", Version: "v2beta1", Kind: "APIGroupDiscoveryList"} +var v2GVK = schema.GroupVersionKind{Group: "apidiscovery.k8s.io", Version: "v2", Kind: "APIGroupDiscoveryList"} // DiscoveryInterface holds the methods that discover server-supported API groups, // versions and resources. @@ -265,13 +268,20 @@ func (d *DiscoveryClient) downloadLegacy() ( var resourcesByGV map[schema.GroupVersion]*metav1.APIResourceList // Based on the content-type server responded with: aggregated or unaggregated. - if isGVK, _ := ContentTypeIsGVK(responseContentType, v2Beta1GVK); isGVK { - var aggregatedDiscovery apidiscovery.APIGroupDiscoveryList + if isGVK, _ := ContentTypeIsGVK(responseContentType, v2GVK); isGVK { + var aggregatedDiscovery apidiscoveryv2.APIGroupDiscoveryList err = json.Unmarshal(body, &aggregatedDiscovery) if err != nil { return nil, nil, nil, err } apiGroupList, resourcesByGV, failedGVs = SplitGroupsAndResources(aggregatedDiscovery) + } else if isGVK, _ := ContentTypeIsGVK(responseContentType, v2Beta1GVK); isGVK { + var aggregatedDiscovery apidiscoveryv2beta1.APIGroupDiscoveryList + err = json.Unmarshal(body, &aggregatedDiscovery) + if err != nil { + return nil, nil, nil, err + } + apiGroupList, resourcesByGV, failedGVs = SplitGroupsAndResourcesV2Beta1(aggregatedDiscovery) } else { // Default is unaggregated discovery v1. var v metav1.APIVersions @@ -317,13 +327,20 @@ func (d *DiscoveryClient) downloadAPIs() ( failedGVs := map[schema.GroupVersion]error{} var resourcesByGV map[schema.GroupVersion]*metav1.APIResourceList // Based on the content-type server responded with: aggregated or unaggregated. - if isGVK, _ := ContentTypeIsGVK(responseContentType, v2Beta1GVK); isGVK { - var aggregatedDiscovery apidiscovery.APIGroupDiscoveryList + if isGVK, _ := ContentTypeIsGVK(responseContentType, v2GVK); isGVK { + var aggregatedDiscovery apidiscoveryv2.APIGroupDiscoveryList err = json.Unmarshal(body, &aggregatedDiscovery) if err != nil { return nil, nil, nil, err } apiGroupList, resourcesByGV, failedGVs = SplitGroupsAndResources(aggregatedDiscovery) + } else if isGVK, _ := ContentTypeIsGVK(responseContentType, v2Beta1GVK); isGVK { + var aggregatedDiscovery apidiscoveryv2beta1.APIGroupDiscoveryList + err = json.Unmarshal(body, &aggregatedDiscovery) + if err != nil { + return nil, nil, nil, err + } + apiGroupList, resourcesByGV, failedGVs = SplitGroupsAndResourcesV2Beta1(aggregatedDiscovery) } else { // Default is unaggregated discovery v1. err = json.Unmarshal(body, apiGroupList) diff --git a/discovery/discovery_client_test.go b/discovery/discovery_client_test.go index db96ba3bb..87e6c95aa 100644 --- a/discovery/discovery_client_test.go +++ b/discovery/discovery_client_test.go @@ -32,7 +32,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" golangproto "google.golang.org/protobuf/proto" - apidiscovery "k8s.io/api/apidiscovery/v2beta1" + apidiscovery "k8s.io/api/apidiscovery/v2" + apidiscoveryv2beta1 "k8s.io/api/apidiscovery/v2beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" @@ -58,7 +59,8 @@ func TestGetServerVersion(t *testing.T) { } w.Header().Set("Content-Type", "application/json") w.WriteHeader(http.StatusOK) - w.Write(output) + _, err = w.Write(output) + require.NoError(t, err) })) defer server.Close() client := NewDiscoveryClientForConfigOrDie(&restclient.Config{Host: server.URL}) @@ -104,7 +106,8 @@ func TestGetServerGroupsWithV1Server(t *testing.T) { } w.Header().Set("Content-Type", "application/json") w.WriteHeader(http.StatusOK) - w.Write(output) + _, err = w.Write(output) + require.NoError(t, err) })) defer server.Close() client := NewDiscoveryClientForConfigOrDie(&restclient.Config{Host: server.URL}) @@ -144,7 +147,8 @@ func TestDiscoveryToleratesMissingCoreGroup(t *testing.T) { } w.Header().Set("Content-Type", "application/json") w.WriteHeader(http.StatusOK) - w.Write(output) + _, err = w.Write(output) + require.NoError(t, err) })) defer server.Close() client := NewDiscoveryClientForConfigOrDie(&restclient.Config{Host: server.URL}) @@ -180,7 +184,8 @@ func TestDiscoveryFailsWhenNonCoreGroupsMissing(t *testing.T) { } w.Header().Set("Content-Type", "application/json") w.WriteHeader(http.StatusOK) - w.Write(output) + _, err = w.Write(output) + require.NoError(t, err) })) defer server.Close() client := NewDiscoveryClientForConfigOrDie(&restclient.Config{Host: server.URL}) @@ -380,7 +385,8 @@ func TestGetServerResourcesForGroupVersion(t *testing.T) { } w.Header().Set("Content-Type", "application/json") w.WriteHeader(http.StatusOK) - w.Write(output) + _, err = w.Write(output) + require.NoError(t, err) })) defer server.Close() for _, test := range tests { @@ -1294,6 +1300,8 @@ func TestAggregatedServerGroups(t *testing.T) { for _, test := range tests { server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { + var output []byte + var err error var agg *apidiscovery.APIGroupDiscoveryList switch req.URL.Path { case "/api": @@ -1304,13 +1312,14 @@ func TestAggregatedServerGroups(t *testing.T) { w.WriteHeader(http.StatusNotFound) return } - output, err := json.Marshal(agg) + output, err = json.Marshal(agg) require.NoError(t, err) // Content-Type is "aggregated" discovery format. Add extra parameter // to ensure we are resilient to these extra parameters. - w.Header().Set("Content-Type", AcceptV2Beta1+"; charset=utf-8") + w.Header().Set("Content-Type", AcceptV2+"; charset=utf-8") w.WriteHeader(http.StatusOK) - w.Write(output) + _, err = w.Write(output) + require.NoError(t, err) })) defer server.Close() client := NewDiscoveryClientForConfigOrDie(&restclient.Config{Host: server.URL}) @@ -1338,7 +1347,9 @@ func TestAggregatedServerGroupsAndResources(t *testing.T) { tests := []struct { name string corev1 *apidiscovery.APIGroupDiscoveryList + corev1DiscoveryBeta *apidiscoveryv2beta1.APIGroupDiscoveryList apis *apidiscovery.APIGroupDiscoveryList + apisDiscoveryBeta *apidiscoveryv2beta1.APIGroupDiscoveryList expectedGroupNames []string expectedGroupVersions []string expectedGVKs []string @@ -1368,6 +1379,28 @@ func TestAggregatedServerGroupsAndResources(t *testing.T) { }, }, }, + corev1DiscoveryBeta: &apidiscoveryv2beta1.APIGroupDiscoveryList{ + Items: []apidiscoveryv2beta1.APIGroupDiscovery{ + { + Versions: []apidiscoveryv2beta1.APIVersionDiscovery{ + { + Version: "v1", + Resources: []apidiscoveryv2beta1.APIResourceDiscovery{ + { + Resource: "pods", + ResponseKind: &metav1.GroupVersionKind{ + Group: "", + Version: "v1", + Kind: "Pod", + }, + Scope: apidiscoveryv2beta1.ScopeNamespace, + }, + }, + }, + }, + }, + }, + }, apis: &apidiscovery.APIGroupDiscoveryList{ Items: []apidiscovery.APIGroupDiscovery{ { @@ -1393,6 +1426,31 @@ func TestAggregatedServerGroupsAndResources(t *testing.T) { }, }, }, + apisDiscoveryBeta: &apidiscoveryv2beta1.APIGroupDiscoveryList{ + Items: []apidiscoveryv2beta1.APIGroupDiscovery{ + { + ObjectMeta: metav1.ObjectMeta{ + Name: "apps", + }, + Versions: []apidiscoveryv2beta1.APIVersionDiscovery{ + { + Version: "v1", + Resources: []apidiscoveryv2beta1.APIResourceDiscovery{ + { + Resource: "deployments", + ResponseKind: &metav1.GroupVersionKind{ + Group: "apps", + Version: "v1", + Kind: "Deployment", + }, + Scope: apidiscoveryv2beta1.ScopeNamespace, + }, + }, + }, + }, + }, + }, + }, expectedGroupNames: []string{"", "apps"}, expectedGroupVersions: []string{"v1", "apps/v1"}, expectedGVKs: []string{ @@ -1424,6 +1482,28 @@ func TestAggregatedServerGroupsAndResources(t *testing.T) { }, }, }, + corev1DiscoveryBeta: &apidiscoveryv2beta1.APIGroupDiscoveryList{ + Items: []apidiscoveryv2beta1.APIGroupDiscovery{ + { + Versions: []apidiscoveryv2beta1.APIVersionDiscovery{ + { + Version: "v1", + Resources: []apidiscoveryv2beta1.APIResourceDiscovery{ + { + Resource: "pods", + ResponseKind: &metav1.GroupVersionKind{ + Group: "", + Version: "v1", + Kind: "Pod", + }, + Scope: apidiscoveryv2beta1.ScopeNamespace, + }, + }, + }, + }, + }, + }, + }, apis: &apidiscovery.APIGroupDiscoveryList{ Items: []apidiscovery.APIGroupDiscovery{ { @@ -1463,6 +1543,45 @@ func TestAggregatedServerGroupsAndResources(t *testing.T) { }, }, }, + apisDiscoveryBeta: &apidiscoveryv2beta1.APIGroupDiscoveryList{ + Items: []apidiscoveryv2beta1.APIGroupDiscovery{ + { + ObjectMeta: metav1.ObjectMeta{ + Name: "apps", + }, + Versions: []apidiscoveryv2beta1.APIVersionDiscovery{ + { + Version: "v1", + Resources: []apidiscoveryv2beta1.APIResourceDiscovery{ + { + Resource: "deployments", + ResponseKind: &metav1.GroupVersionKind{ + Group: "apps", + Version: "v1", + Kind: "Deployment", + }, + Scope: apidiscoveryv2beta1.ScopeNamespace, + }, + }, + }, + { + Version: "v2", + Resources: []apidiscoveryv2beta1.APIResourceDiscovery{ + { + Resource: "deployments", + ResponseKind: &metav1.GroupVersionKind{ + Group: "apps", + Version: "v2", + Kind: "Deployment", + }, + Scope: apidiscoveryv2beta1.ScopeNamespace, + }, + }, + }, + }, + }, + }, + }, expectedGroupNames: []string{"", "apps"}, expectedGroupVersions: []string{"v1", "apps/v1", "apps/v2"}, expectedGVKs: []string{ @@ -1495,6 +1614,28 @@ func TestAggregatedServerGroupsAndResources(t *testing.T) { }, }, }, + corev1DiscoveryBeta: &apidiscoveryv2beta1.APIGroupDiscoveryList{ + Items: []apidiscoveryv2beta1.APIGroupDiscovery{ + { + Versions: []apidiscoveryv2beta1.APIVersionDiscovery{ + { + Version: "v1", + Resources: []apidiscoveryv2beta1.APIResourceDiscovery{ + { + Resource: "pods", + ResponseKind: &metav1.GroupVersionKind{ + Group: "", + Version: "v1", + Kind: "Pod", + }, + Scope: apidiscoveryv2beta1.ScopeNamespace, + }, + }, + }, + }, + }, + }, + }, apis: &apidiscovery.APIGroupDiscoveryList{ Items: []apidiscovery.APIGroupDiscovery{ { @@ -1535,6 +1676,46 @@ func TestAggregatedServerGroupsAndResources(t *testing.T) { }, }, }, + apisDiscoveryBeta: &apidiscoveryv2beta1.APIGroupDiscoveryList{ + Items: []apidiscoveryv2beta1.APIGroupDiscovery{ + { + ObjectMeta: metav1.ObjectMeta{ + Name: "apps", + }, + Versions: []apidiscoveryv2beta1.APIVersionDiscovery{ + { + Version: "v1", + Resources: []apidiscoveryv2beta1.APIResourceDiscovery{ + { + Resource: "deployments", + ResponseKind: &metav1.GroupVersionKind{ + Group: "apps", + Version: "v1", + Kind: "Deployment", + }, + Scope: apidiscoveryv2beta1.ScopeNamespace, + }, + }, + }, + { + Version: "v2", + Resources: []apidiscoveryv2beta1.APIResourceDiscovery{ + { + Resource: "deployments", + ResponseKind: &metav1.GroupVersionKind{ + Group: "apps", + Version: "v2", + Kind: "Deployment", + }, + Scope: apidiscoveryv2beta1.ScopeNamespace, + }, + }, + Freshness: apidiscoveryv2beta1.DiscoveryFreshnessStale, + }, + }, + }, + }, + }, expectedGroupNames: []string{"", "apps"}, expectedGroupVersions: []string{"v1", "apps/v1"}, expectedGVKs: []string{ @@ -1576,6 +1757,37 @@ func TestAggregatedServerGroupsAndResources(t *testing.T) { }, }, }, + corev1DiscoveryBeta: &apidiscoveryv2beta1.APIGroupDiscoveryList{ + Items: []apidiscoveryv2beta1.APIGroupDiscovery{ + { + Versions: []apidiscoveryv2beta1.APIVersionDiscovery{ + { + Version: "v1", + Resources: []apidiscoveryv2beta1.APIResourceDiscovery{ + { + Resource: "pods", + ResponseKind: &metav1.GroupVersionKind{ + Group: "", + Version: "v1", + Kind: "Pod", + }, + Scope: apidiscoveryv2beta1.ScopeNamespace, + }, + { + Resource: "services", + ResponseKind: &metav1.GroupVersionKind{ + Group: "", + Version: "v1", + Kind: "Service", + }, + Scope: apidiscoveryv2beta1.ScopeNamespace, + }, + }, + }, + }, + }, + }, + }, apis: &apidiscovery.APIGroupDiscoveryList{ Items: []apidiscovery.APIGroupDiscovery{ { @@ -1635,6 +1847,65 @@ func TestAggregatedServerGroupsAndResources(t *testing.T) { }, }, }, + apisDiscoveryBeta: &apidiscoveryv2beta1.APIGroupDiscoveryList{ + Items: []apidiscoveryv2beta1.APIGroupDiscovery{ + { + ObjectMeta: metav1.ObjectMeta{ + Name: "apps", + }, + Versions: []apidiscoveryv2beta1.APIVersionDiscovery{ + // Stale "v2" version not included. + { + Version: "v2", + Resources: []apidiscoveryv2beta1.APIResourceDiscovery{ + { + Resource: "deployments", + ResponseKind: &metav1.GroupVersionKind{ + Group: "apps", + Version: "v2", + Kind: "Deployment", + }, + Scope: apidiscoveryv2beta1.ScopeNamespace, + }, + { + Resource: "statefulsets", + ResponseKind: &metav1.GroupVersionKind{ + Group: "apps", + Version: "v2", + Kind: "StatefulSet", + }, + Scope: apidiscoveryv2beta1.ScopeNamespace, + }, + }, + Freshness: apidiscoveryv2beta1.DiscoveryFreshnessStale, + }, + { + Version: "v1", + Resources: []apidiscoveryv2beta1.APIResourceDiscovery{ + { + Resource: "deployments", + ResponseKind: &metav1.GroupVersionKind{ + Group: "apps", + Version: "v1", + Kind: "Deployment", + }, + Scope: apidiscoveryv2beta1.ScopeNamespace, + }, + { + Resource: "statefulsets", + ResponseKind: &metav1.GroupVersionKind{ + Group: "apps", + Version: "v1", + Kind: "StatefulSet", + }, + Scope: apidiscoveryv2beta1.ScopeNamespace, + }, + }, + }, + }, + }, + }, + }, expectedGroupNames: []string{"", "apps"}, expectedGroupVersions: []string{"v1", "apps/v1"}, expectedGVKs: []string{ @@ -1678,6 +1949,37 @@ func TestAggregatedServerGroupsAndResources(t *testing.T) { }, }, }, + corev1DiscoveryBeta: &apidiscoveryv2beta1.APIGroupDiscoveryList{ + Items: []apidiscoveryv2beta1.APIGroupDiscovery{ + { + Versions: []apidiscoveryv2beta1.APIVersionDiscovery{ + { + Version: "v1", + Resources: []apidiscoveryv2beta1.APIResourceDiscovery{ + { + Resource: "pods", + ResponseKind: &metav1.GroupVersionKind{ + Group: "", + Version: "v1", + Kind: "Pod", + }, + Scope: apidiscoveryv2beta1.ScopeNamespace, + }, + { + Resource: "services", + ResponseKind: &metav1.GroupVersionKind{ + Group: "", + Version: "v1", + Kind: "Service", + }, + Scope: apidiscoveryv2beta1.ScopeNamespace, + }, + }, + }, + }, + }, + }, + }, apis: &apidiscovery.APIGroupDiscoveryList{ Items: []apidiscovery.APIGroupDiscovery{ { @@ -1767,6 +2069,95 @@ func TestAggregatedServerGroupsAndResources(t *testing.T) { }, }, }, + apisDiscoveryBeta: &apidiscoveryv2beta1.APIGroupDiscoveryList{ + Items: []apidiscoveryv2beta1.APIGroupDiscovery{ + { + ObjectMeta: metav1.ObjectMeta{ + Name: "apps", + }, + Versions: []apidiscoveryv2beta1.APIVersionDiscovery{ + { + Version: "v1", + Resources: []apidiscoveryv2beta1.APIResourceDiscovery{ + { + Resource: "deployments", + ResponseKind: &metav1.GroupVersionKind{ + Group: "apps", + Version: "v1", + Kind: "Deployment", + }, + Scope: apidiscoveryv2beta1.ScopeNamespace, + }, + { + Resource: "statefulsets", + ResponseKind: &metav1.GroupVersionKind{ + Group: "apps", + Version: "v1", + Kind: "StatefulSet", + }, + Scope: apidiscoveryv2beta1.ScopeNamespace, + }, + }, + }, + }, + }, + { + ObjectMeta: metav1.ObjectMeta{ + Name: "batch", + }, + Versions: []apidiscoveryv2beta1.APIVersionDiscovery{ + // Stale Group/Version is not included + { + Version: "v1", + Resources: []apidiscoveryv2beta1.APIResourceDiscovery{ + { + Resource: "jobs", + ResponseKind: &metav1.GroupVersionKind{ + Group: "batch", + Version: "v1", + Kind: "Job", + }, + Scope: apidiscoveryv2beta1.ScopeNamespace, + }, + { + Resource: "cronjobs", + ResponseKind: &metav1.GroupVersionKind{ + Group: "batch", + Version: "v1", + Kind: "CronJob", + }, + Scope: apidiscoveryv2beta1.ScopeNamespace, + }, + }, + Freshness: apidiscoveryv2beta1.DiscoveryFreshnessStale, + }, + { + Version: "v1beta1", + Resources: []apidiscoveryv2beta1.APIResourceDiscovery{ + { + Resource: "jobs", + ResponseKind: &metav1.GroupVersionKind{ + Group: "batch", + Version: "v1beta1", + Kind: "Job", + }, + Scope: apidiscoveryv2beta1.ScopeNamespace, + }, + { + Resource: "cronjobs", + ResponseKind: &metav1.GroupVersionKind{ + Group: "batch", + Version: "v1beta1", + Kind: "CronJob", + }, + Scope: apidiscoveryv2beta1.ScopeNamespace, + }, + }, + }, + }, + }, + }, + }, expectedGroupNames: []string{"", "apps", "batch"}, expectedGroupVersions: []string{"v1", "apps/v1", "batch/v1beta1"}, expectedGVKs: []string{ @@ -1780,8 +2171,9 @@ func TestAggregatedServerGroupsAndResources(t *testing.T) { expectedFailedGVs: []string{"batch/v1"}, }, { - name: "Aggregated discovery: /api returns nothing, 2 groups/2 resources at /apis", - corev1: &apidiscovery.APIGroupDiscoveryList{}, + name: "Aggregated discovery: /api returns nothing, 2 groups/2 resources at /apis", + corev1: &apidiscovery.APIGroupDiscoveryList{}, + corev1DiscoveryBeta: &apidiscoveryv2beta1.APIGroupDiscoveryList{}, apis: &apidiscovery.APIGroupDiscoveryList{ Items: []apidiscovery.APIGroupDiscovery{ { @@ -1871,6 +2263,95 @@ func TestAggregatedServerGroupsAndResources(t *testing.T) { }, }, }, + apisDiscoveryBeta: &apidiscoveryv2beta1.APIGroupDiscoveryList{ + Items: []apidiscoveryv2beta1.APIGroupDiscovery{ + { + ObjectMeta: metav1.ObjectMeta{ + Name: "apps", + }, + Versions: []apidiscoveryv2beta1.APIVersionDiscovery{ + { + Version: "v1", + Resources: []apidiscoveryv2beta1.APIResourceDiscovery{ + { + Resource: "deployments", + ResponseKind: &metav1.GroupVersionKind{ + Group: "apps", + Version: "v1", + Kind: "Deployment", + }, + Scope: apidiscoveryv2beta1.ScopeNamespace, + }, + { + Resource: "statefulsets", + ResponseKind: &metav1.GroupVersionKind{ + Group: "apps", + Version: "v1", + Kind: "StatefulSet", + }, + Scope: apidiscoveryv2beta1.ScopeNamespace, + }, + }, + }, + }, + }, + { + ObjectMeta: metav1.ObjectMeta{ + Name: "batch", + }, + Versions: []apidiscoveryv2beta1.APIVersionDiscovery{ + { + Version: "v1", + Resources: []apidiscoveryv2beta1.APIResourceDiscovery{ + { + Resource: "jobs", + ResponseKind: &metav1.GroupVersionKind{ + Group: "batch", + Version: "v1", + Kind: "Job", + }, + Scope: apidiscoveryv2beta1.ScopeNamespace, + }, + { + Resource: "cronjobs", + ResponseKind: &metav1.GroupVersionKind{ + Group: "batch", + Version: "v1", + Kind: "CronJob", + }, + Scope: apidiscoveryv2beta1.ScopeNamespace, + }, + }, + }, + { + // Stale "v1beta1" not included. + Version: "v1beta1", + Resources: []apidiscoveryv2beta1.APIResourceDiscovery{ + { + Resource: "jobs", + ResponseKind: &metav1.GroupVersionKind{ + Group: "batch", + Version: "v1beta1", + Kind: "Job", + }, + Scope: apidiscoveryv2beta1.ScopeNamespace, + }, + { + Resource: "cronjobs", + ResponseKind: &metav1.GroupVersionKind{ + Group: "batch", + Version: "v1beta1", + Kind: "CronJob", + }, + Scope: apidiscoveryv2beta1.ScopeNamespace, + }, + }, + Freshness: apidiscoveryv2beta1.DiscoveryFreshnessStale, + }, + }, + }, + }, + }, expectedGroupNames: []string{"apps", "batch"}, expectedGroupVersions: []string{"apps/v1", "batch/v1"}, expectedGVKs: []string{ @@ -1883,61 +2364,84 @@ func TestAggregatedServerGroupsAndResources(t *testing.T) { }, } + // Ensure that client can parse both V2Beta1 and V2 types from server + serverAccepts := []string{AcceptV2Beta1, AcceptV2} for _, test := range tests { - server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { - var agg *apidiscovery.APIGroupDiscoveryList - switch req.URL.Path { - case "/api": - agg = test.corev1 - case "/apis": - agg = test.apis - default: - w.WriteHeader(http.StatusNotFound) - return + for _, accept := range serverAccepts { + server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { + var output []byte + var err error + if accept == AcceptV2 { + var agg *apidiscovery.APIGroupDiscoveryList + switch req.URL.Path { + case "/api": + agg = test.corev1 + case "/apis": + agg = test.apis + default: + w.WriteHeader(http.StatusNotFound) + return + } + output, err = json.Marshal(agg) + require.NoError(t, err) + } else { + var agg *apidiscoveryv2beta1.APIGroupDiscoveryList + switch req.URL.Path { + case "/api": + agg = test.corev1DiscoveryBeta + case "/apis": + agg = test.apisDiscoveryBeta + default: + w.WriteHeader(http.StatusNotFound) + return + } + output, err = json.Marshal(&agg) + require.NoError(t, err) + } + // Content-Type is "aggregated" discovery format. Add extra parameter + // to ensure we are resilient to these extra parameters. + w.Header().Set("Content-Type", accept+"; charset=utf-8") + w.WriteHeader(http.StatusOK) + _, err = w.Write(output) + require.NoError(t, err) + + })) + defer server.Close() + client := NewDiscoveryClientForConfigOrDie(&restclient.Config{Host: server.URL}) + apiGroups, resources, err := client.ServerGroupsAndResources() + if len(test.expectedFailedGVs) > 0 { + require.Error(t, err) + expectedFailedGVs := sets.NewString(test.expectedFailedGVs...) + actualFailedGVs := sets.NewString(failedGroupVersions(err)...) + assert.True(t, expectedFailedGVs.Equal(actualFailedGVs), + "%s: Expected Failed GVs (%s), got (%s)", test.name, expectedFailedGVs, actualFailedGVs) + } else { + require.NoError(t, err) } - output, err := json.Marshal(agg) - require.NoError(t, err) - // Content-type is "aggregated" discovery format. Add extra parameter - // to ensure we are resilient to these extra parameters. - w.Header().Set("Content-Type", AcceptV2Beta1+"; charset=utf-8") - w.WriteHeader(http.StatusOK) - w.Write(output) - })) - defer server.Close() - client := NewDiscoveryClientForConfigOrDie(&restclient.Config{Host: server.URL}) - apiGroups, resources, err := client.ServerGroupsAndResources() - if len(test.expectedFailedGVs) > 0 { - require.Error(t, err) - expectedFailedGVs := sets.NewString(test.expectedFailedGVs...) - actualFailedGVs := sets.NewString(failedGroupVersions(err)...) - assert.True(t, expectedFailedGVs.Equal(actualFailedGVs), - "%s: Expected Failed GVs (%s), got (%s)", test.name, expectedFailedGVs, actualFailedGVs) - } else { - require.NoError(t, err) - } - // Test the expected groups are returned for the aggregated format. - expectedGroupNames := sets.NewString(test.expectedGroupNames...) - actualGroupNames := sets.NewString(groupNames(apiGroups)...) - assert.True(t, expectedGroupNames.Equal(actualGroupNames), - "%s: Expected GVKs (%s), got (%s)", test.name, expectedGroupNames.List(), actualGroupNames.List()) - // If the core V1 group is returned from /api, it should be the first group. - if expectedGroupNames.Has("") { - assert.True(t, len(apiGroups) > 0) - actualFirstGroup := apiGroups[0] - assert.True(t, len(actualFirstGroup.Versions) > 0) - actualFirstGroupVersion := actualFirstGroup.Versions[0].GroupVersion - assert.Equal(t, "v1", actualFirstGroupVersion) + // Test the expected groups are returned for the aggregated format. + expectedGroupNames := sets.NewString(test.expectedGroupNames...) + actualGroupNames := sets.NewString(groupNames(apiGroups)...) + assert.True(t, expectedGroupNames.Equal(actualGroupNames), + "%s: Expected GVKs (%s), got (%s)", test.name, expectedGroupNames.List(), actualGroupNames.List()) + // If the core V1 group is returned from /api, it should be the first group. + if expectedGroupNames.Has("") { + assert.True(t, len(apiGroups) > 0) + actualFirstGroup := apiGroups[0] + assert.True(t, len(actualFirstGroup.Versions) > 0) + actualFirstGroupVersion := actualFirstGroup.Versions[0].GroupVersion + assert.Equal(t, "v1", actualFirstGroupVersion) + } + // Test the expected group/versions are returned from the aggregated discovery. + expectedGroupVersions := sets.NewString(test.expectedGroupVersions...) + actualGroupVersions := sets.NewString(groupVersions(resources)...) + assert.True(t, expectedGroupVersions.Equal(actualGroupVersions), + "%s: Expected GroupVersions(%s), got (%s)", test.name, expectedGroupVersions.List(), actualGroupVersions.List()) + // Test the expected GVKs are returned from the aggregated discovery. + expectedGVKs := sets.NewString(test.expectedGVKs...) + actualGVKs := sets.NewString(groupVersionKinds(resources)...) + assert.True(t, expectedGVKs.Equal(actualGVKs), + "%s: Expected GVKs (%s), got (%s)", test.name, expectedGVKs.List(), actualGVKs.List()) } - // Test the expected group/versions are returned from the aggregated discovery. - expectedGroupVersions := sets.NewString(test.expectedGroupVersions...) - actualGroupVersions := sets.NewString(groupVersions(resources)...) - assert.True(t, expectedGroupVersions.Equal(actualGroupVersions), - "%s: Expected GroupVersions(%s), got (%s)", test.name, expectedGroupVersions.List(), actualGroupVersions.List()) - // Test the expected GVKs are returned from the aggregated discovery. - expectedGVKs := sets.NewString(test.expectedGVKs...) - actualGVKs := sets.NewString(groupVersionKinds(resources)...) - assert.True(t, expectedGVKs.Equal(actualGVKs), - "%s: Expected GVKs (%s), got (%s)", test.name, expectedGVKs.List(), actualGVKs.List()) } } @@ -2023,8 +2527,10 @@ func TestAggregatedServerGroupsAndResourcesWithErrors(t *testing.T) { for _, test := range tests { server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { - var agg *apidiscovery.APIGroupDiscoveryList + var output []byte + var err error var status int + var agg *apidiscovery.APIGroupDiscoveryList switch req.URL.Path { case "/api": agg = test.corev1 @@ -2036,15 +2542,17 @@ func TestAggregatedServerGroupsAndResourcesWithErrors(t *testing.T) { w.WriteHeader(http.StatusNotFound) return } - output, err := json.Marshal(agg) + output, err = json.Marshal(agg) require.NoError(t, err) - // Content-type is "aggregated" discovery format. Add extra parameter + // Content-Type is "aggregated" discovery format. Add extra parameter // to ensure we are resilient to these extra parameters. - w.Header().Set("Content-Type", AcceptV2Beta1+"; charset=utf-8") + w.Header().Set("Content-Type", AcceptV2+"; charset=utf-8") w.WriteHeader(status) - w.Write(output) + _, err = w.Write(output) + require.NoError(t, err) })) defer server.Close() + client := NewDiscoveryClientForConfigOrDie(&restclient.Config{Host: server.URL}) apiGroups, resources, err := client.ServerGroupsAndResources() if test.expectedErr { @@ -2635,6 +3143,8 @@ func TestAggregatedServerPreferredResources(t *testing.T) { for _, test := range tests { server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { + var output []byte + var err error var agg *apidiscovery.APIGroupDiscoveryList switch req.URL.Path { case "/api": @@ -2645,13 +3155,14 @@ func TestAggregatedServerPreferredResources(t *testing.T) { w.WriteHeader(http.StatusNotFound) return } - output, err := json.Marshal(agg) + output, err = json.Marshal(agg) require.NoError(t, err) - // Content-type is "aggregated" discovery format. Add extra parameter + // Content-Type is "aggregated" discovery format. Add extra parameter // to ensure we are resilient to these extra parameters. - w.Header().Set("Content-Type", AcceptV2Beta1+"; charset=utf-8") + w.Header().Set("Content-Type", AcceptV2+"; charset=utf-8") w.WriteHeader(http.StatusOK) - w.Write(output) + _, err = w.Write(output) + require.NoError(t, err) })) defer server.Close() client := NewDiscoveryClientForConfigOrDie(&restclient.Config{Host: server.URL}) @@ -2674,7 +3185,7 @@ func TestAggregatedServerPreferredResources(t *testing.T) { } func TestDiscoveryContentTypeVersion(t *testing.T) { - v2beta1 := schema.GroupVersionKind{Group: "apidiscovery.k8s.io", Version: "v2beta1", Kind: "APIGroupDiscoveryList"} + v2 := schema.GroupVersionKind{Group: "apidiscovery.k8s.io", Version: "v2", Kind: "APIGroupDiscoveryList"} tests := []struct { contentType string gvk schema.GroupVersionKind @@ -2682,59 +3193,59 @@ func TestDiscoveryContentTypeVersion(t *testing.T) { expectErr bool }{ { - contentType: "application/json; g=apidiscovery.k8s.io;v=v2beta1;as=APIGroupDiscoveryList", - gvk: v2beta1, + contentType: "application/json; g=apidiscovery.k8s.io;v=v2;as=APIGroupDiscoveryList", + gvk: v2, match: true, expectErr: false, }, { // content-type parameters are not in correct order, but comparison ignores order. - contentType: "application/json; v=v2beta1;as=APIGroupDiscoveryList;g=apidiscovery.k8s.io", - gvk: v2beta1, + contentType: "application/json; v=v2;as=APIGroupDiscoveryList;g=apidiscovery.k8s.io", + gvk: v2, match: true, expectErr: false, }, { // content-type parameters are not in correct order, but comparison ignores order. - contentType: "application/json; as=APIGroupDiscoveryList;g=apidiscovery.k8s.io;v=v2beta1", - gvk: v2beta1, + contentType: "application/json; as=APIGroupDiscoveryList;g=apidiscovery.k8s.io;v=v2", + gvk: v2, match: true, expectErr: false, }, { // Ignores extra parameter "charset=utf-8" - contentType: "application/json; g=apidiscovery.k8s.io;v=v2beta1;as=APIGroupDiscoveryList;charset=utf-8", - gvk: v2beta1, + contentType: "application/json; g=apidiscovery.k8s.io;v=v2;as=APIGroupDiscoveryList;charset=utf-8", + gvk: v2, match: true, expectErr: false, }, { contentType: "application/json", - gvk: v2beta1, + gvk: v2, match: false, expectErr: false, }, { contentType: "application/json; charset=UTF-8", - gvk: v2beta1, + gvk: v2, match: false, expectErr: false, }, { contentType: "text/json", - gvk: v2beta1, + gvk: v2, match: false, expectErr: false, }, { contentType: "text/html", - gvk: v2beta1, + gvk: v2, match: false, expectErr: false, }, { contentType: "", - gvk: v2beta1, + gvk: v2, match: false, expectErr: true, }, From 61be9f118e8917651bfa938200abcf430a3827a2 Mon Sep 17 00:00:00 2001 From: Mike Spreitzer Date: Fri, 26 Jan 2024 13:28:06 -0500 Subject: [PATCH 052/239] Add DeletionHandlingObjectToName Signed-off-by: Mike Spreitzer Kubernetes-commit: d60a25b2db52d7e180b0962e23cc06e71f36fb29 --- tools/cache/controller.go | 10 ++++++++++ tools/cache/controller_test.go | 28 ++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/tools/cache/controller.go b/tools/cache/controller.go index 8a1104bde..ee19a5af9 100644 --- a/tools/cache/controller.go +++ b/tools/cache/controller.go @@ -336,6 +336,16 @@ func DeletionHandlingMetaNamespaceKeyFunc(obj interface{}) (string, error) { return MetaNamespaceKeyFunc(obj) } +// DeletionHandlingObjectToName checks for +// DeletedFinalStateUnknown objects before calling +// ObjectToName. +func DeletionHandlingObjectToName(obj interface{}) (ObjectName, error) { + if d, ok := obj.(DeletedFinalStateUnknown); ok { + return ParseObjectName(d.Key) + } + return ObjectToName(obj) +} + // 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 diff --git a/tools/cache/controller_test.go b/tools/cache/controller_test.go index 8dff7679c..405858115 100644 --- a/tools/cache/controller_test.go +++ b/tools/cache/controller_test.go @@ -574,3 +574,31 @@ func TestTransformingInformer(t *testing.T) { close(stopCh) } + +func TestDeletionHandlingObjectToName(t *testing.T) { + cm := &v1.ConfigMap{ + ObjectMeta: metav1.ObjectMeta{ + Name: "testname", + Namespace: "testnamespace", + }, + } + stringKey, err := MetaNamespaceKeyFunc(cm) + if err != nil { + t.Error(err) + } + deleted := DeletedFinalStateUnknown{ + Key: stringKey, + Obj: cm, + } + expected, err := ObjectToName(cm) + if err != nil { + t.Error(err) + } + actual, err := DeletionHandlingObjectToName(deleted) + if err != nil { + t.Error(err) + } + if expected != actual { + t.Errorf("Expected %#v, got %#v", expected, actual) + } +} From 4ceeb096c424b6aad523c2bfaafdae988607788c Mon Sep 17 00:00:00 2001 From: cici37 Date: Thu, 1 Feb 2024 01:00:24 +0000 Subject: [PATCH 053/239] Auto updates Kubernetes-commit: 5d83282823d5ee728d610befb389e3732b4503c3 --- .../v1/auditannotation.go | 48 ++++ .../v1/expressionwarning.go | 48 ++++ .../v1/matchresources.go | 90 ++++++ .../v1/namedrulewithoperations.go | 94 +++++++ .../admissionregistration/v1/paramkind.go | 48 ++++ .../admissionregistration/v1/paramref.go | 71 +++++ .../admissionregistration/v1/typechecking.go | 44 +++ .../v1/validatingadmissionpolicy.go | 256 +++++++++++++++++ .../v1/validatingadmissionpolicybinding.go | 247 +++++++++++++++++ .../validatingadmissionpolicybindingspec.go | 72 +++++ .../v1/validatingadmissionpolicyspec.go | 117 ++++++++ .../v1/validatingadmissionpolicystatus.go | 66 +++++ .../admissionregistration/v1/validation.go | 70 +++++ .../admissionregistration/v1/variable.go | 48 ++++ applyconfigurations/internal/internal.go | 260 ++++++++++++++++++ applyconfigurations/utils.go | 28 ++ .../admissionregistration/v1/interface.go | 14 + .../v1/validatingadmissionpolicy.go | 89 ++++++ .../v1/validatingadmissionpolicybinding.go | 89 ++++++ informers/generic.go | 4 + .../v1/admissionregistration_client.go | 10 + .../fake/fake_admissionregistration_client.go | 8 + .../v1/fake/fake_validatingadmissionpolicy.go | 178 ++++++++++++ .../fake_validatingadmissionpolicybinding.go | 145 ++++++++++ .../v1/generated_expansion.go | 4 + .../v1/validatingadmissionpolicy.go | 243 ++++++++++++++++ .../v1/validatingadmissionpolicybinding.go | 197 +++++++++++++ .../v1/expansion_generated.go | 8 + .../v1/validatingadmissionpolicy.go | 68 +++++ .../v1/validatingadmissionpolicybinding.go | 68 +++++ 30 files changed, 2732 insertions(+) create mode 100644 applyconfigurations/admissionregistration/v1/auditannotation.go create mode 100644 applyconfigurations/admissionregistration/v1/expressionwarning.go create mode 100644 applyconfigurations/admissionregistration/v1/matchresources.go create mode 100644 applyconfigurations/admissionregistration/v1/namedrulewithoperations.go create mode 100644 applyconfigurations/admissionregistration/v1/paramkind.go create mode 100644 applyconfigurations/admissionregistration/v1/paramref.go create mode 100644 applyconfigurations/admissionregistration/v1/typechecking.go create mode 100644 applyconfigurations/admissionregistration/v1/validatingadmissionpolicy.go create mode 100644 applyconfigurations/admissionregistration/v1/validatingadmissionpolicybinding.go create mode 100644 applyconfigurations/admissionregistration/v1/validatingadmissionpolicybindingspec.go create mode 100644 applyconfigurations/admissionregistration/v1/validatingadmissionpolicyspec.go create mode 100644 applyconfigurations/admissionregistration/v1/validatingadmissionpolicystatus.go create mode 100644 applyconfigurations/admissionregistration/v1/validation.go create mode 100644 applyconfigurations/admissionregistration/v1/variable.go create mode 100644 informers/admissionregistration/v1/validatingadmissionpolicy.go create mode 100644 informers/admissionregistration/v1/validatingadmissionpolicybinding.go create mode 100644 kubernetes/typed/admissionregistration/v1/fake/fake_validatingadmissionpolicy.go create mode 100644 kubernetes/typed/admissionregistration/v1/fake/fake_validatingadmissionpolicybinding.go create mode 100644 kubernetes/typed/admissionregistration/v1/validatingadmissionpolicy.go create mode 100644 kubernetes/typed/admissionregistration/v1/validatingadmissionpolicybinding.go create mode 100644 listers/admissionregistration/v1/validatingadmissionpolicy.go create mode 100644 listers/admissionregistration/v1/validatingadmissionpolicybinding.go diff --git a/applyconfigurations/admissionregistration/v1/auditannotation.go b/applyconfigurations/admissionregistration/v1/auditannotation.go new file mode 100644 index 000000000..64422c1df --- /dev/null +++ b/applyconfigurations/admissionregistration/v1/auditannotation.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 v1 + +// AuditAnnotationApplyConfiguration represents an 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 +// apply. +func AuditAnnotation() *AuditAnnotationApplyConfiguration { + return &AuditAnnotationApplyConfiguration{} +} + +// WithKey sets the Key field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Key field is set to the value of the last call. +func (b *AuditAnnotationApplyConfiguration) WithKey(value string) *AuditAnnotationApplyConfiguration { + b.Key = &value + return b +} + +// WithValueExpression sets the ValueExpression field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ValueExpression field is set to the value of the last call. +func (b *AuditAnnotationApplyConfiguration) WithValueExpression(value string) *AuditAnnotationApplyConfiguration { + b.ValueExpression = &value + return b +} diff --git a/applyconfigurations/admissionregistration/v1/expressionwarning.go b/applyconfigurations/admissionregistration/v1/expressionwarning.go new file mode 100644 index 000000000..38b7475cc --- /dev/null +++ b/applyconfigurations/admissionregistration/v1/expressionwarning.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 v1 + +// ExpressionWarningApplyConfiguration represents an 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 +// apply. +func ExpressionWarning() *ExpressionWarningApplyConfiguration { + return &ExpressionWarningApplyConfiguration{} +} + +// WithFieldRef sets the FieldRef field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the FieldRef field is set to the value of the last call. +func (b *ExpressionWarningApplyConfiguration) WithFieldRef(value string) *ExpressionWarningApplyConfiguration { + b.FieldRef = &value + return b +} + +// WithWarning sets the Warning field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Warning field is set to the value of the last call. +func (b *ExpressionWarningApplyConfiguration) WithWarning(value string) *ExpressionWarningApplyConfiguration { + b.Warning = &value + return b +} diff --git a/applyconfigurations/admissionregistration/v1/matchresources.go b/applyconfigurations/admissionregistration/v1/matchresources.go new file mode 100644 index 000000000..d8e982894 --- /dev/null +++ b/applyconfigurations/admissionregistration/v1/matchresources.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 applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + apiadmissionregistrationv1 "k8s.io/api/admissionregistration/v1" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// MatchResourcesApplyConfiguration represents an declarative configuration of the MatchResources type for use +// with apply. +type MatchResourcesApplyConfiguration struct { + NamespaceSelector *v1.LabelSelectorApplyConfiguration `json:"namespaceSelector,omitempty"` + ObjectSelector *v1.LabelSelectorApplyConfiguration `json:"objectSelector,omitempty"` + ResourceRules []NamedRuleWithOperationsApplyConfiguration `json:"resourceRules,omitempty"` + ExcludeResourceRules []NamedRuleWithOperationsApplyConfiguration `json:"excludeResourceRules,omitempty"` + MatchPolicy *apiadmissionregistrationv1.MatchPolicyType `json:"matchPolicy,omitempty"` +} + +// MatchResourcesApplyConfiguration constructs an declarative configuration of the MatchResources type for use with +// apply. +func MatchResources() *MatchResourcesApplyConfiguration { + return &MatchResourcesApplyConfiguration{} +} + +// WithNamespaceSelector sets the NamespaceSelector field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NamespaceSelector field is set to the value of the last call. +func (b *MatchResourcesApplyConfiguration) WithNamespaceSelector(value *v1.LabelSelectorApplyConfiguration) *MatchResourcesApplyConfiguration { + b.NamespaceSelector = value + return b +} + +// WithObjectSelector sets the ObjectSelector field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ObjectSelector field is set to the value of the last call. +func (b *MatchResourcesApplyConfiguration) WithObjectSelector(value *v1.LabelSelectorApplyConfiguration) *MatchResourcesApplyConfiguration { + b.ObjectSelector = value + return b +} + +// WithResourceRules adds the given value to the ResourceRules 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 ResourceRules field. +func (b *MatchResourcesApplyConfiguration) WithResourceRules(values ...*NamedRuleWithOperationsApplyConfiguration) *MatchResourcesApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithResourceRules") + } + b.ResourceRules = append(b.ResourceRules, *values[i]) + } + return b +} + +// WithExcludeResourceRules adds the given value to the ExcludeResourceRules 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 ExcludeResourceRules field. +func (b *MatchResourcesApplyConfiguration) WithExcludeResourceRules(values ...*NamedRuleWithOperationsApplyConfiguration) *MatchResourcesApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithExcludeResourceRules") + } + b.ExcludeResourceRules = append(b.ExcludeResourceRules, *values[i]) + } + return b +} + +// WithMatchPolicy sets the MatchPolicy field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MatchPolicy field is set to the value of the last call. +func (b *MatchResourcesApplyConfiguration) WithMatchPolicy(value apiadmissionregistrationv1.MatchPolicyType) *MatchResourcesApplyConfiguration { + b.MatchPolicy = &value + return b +} diff --git a/applyconfigurations/admissionregistration/v1/namedrulewithoperations.go b/applyconfigurations/admissionregistration/v1/namedrulewithoperations.go new file mode 100644 index 000000000..be8d5206c --- /dev/null +++ b/applyconfigurations/admissionregistration/v1/namedrulewithoperations.go @@ -0,0 +1,94 @@ +/* +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 ( + admissionregistrationv1 "k8s.io/api/admissionregistration/v1" +) + +// NamedRuleWithOperationsApplyConfiguration represents an 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 +// apply. +func NamedRuleWithOperations() *NamedRuleWithOperationsApplyConfiguration { + return &NamedRuleWithOperationsApplyConfiguration{} +} + +// WithResourceNames adds the given value to the ResourceNames 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 ResourceNames field. +func (b *NamedRuleWithOperationsApplyConfiguration) WithResourceNames(values ...string) *NamedRuleWithOperationsApplyConfiguration { + for i := range values { + b.ResourceNames = append(b.ResourceNames, values[i]) + } + return b +} + +// WithOperations adds the given value to the Operations 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 Operations field. +func (b *NamedRuleWithOperationsApplyConfiguration) WithOperations(values ...admissionregistrationv1.OperationType) *NamedRuleWithOperationsApplyConfiguration { + for i := range values { + b.Operations = append(b.Operations, values[i]) + } + return b +} + +// WithAPIGroups adds the given value to the APIGroups 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 APIGroups field. +func (b *NamedRuleWithOperationsApplyConfiguration) WithAPIGroups(values ...string) *NamedRuleWithOperationsApplyConfiguration { + for i := range values { + b.APIGroups = append(b.APIGroups, values[i]) + } + return b +} + +// WithAPIVersions adds the given value to the APIVersions 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 APIVersions field. +func (b *NamedRuleWithOperationsApplyConfiguration) WithAPIVersions(values ...string) *NamedRuleWithOperationsApplyConfiguration { + for i := range values { + b.APIVersions = append(b.APIVersions, values[i]) + } + 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 *NamedRuleWithOperationsApplyConfiguration) WithResources(values ...string) *NamedRuleWithOperationsApplyConfiguration { + for i := range values { + b.Resources = append(b.Resources, values[i]) + } + return b +} + +// WithScope sets the Scope field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Scope field is set to the value of the last call. +func (b *NamedRuleWithOperationsApplyConfiguration) WithScope(value admissionregistrationv1.ScopeType) *NamedRuleWithOperationsApplyConfiguration { + b.Scope = &value + return b +} diff --git a/applyconfigurations/admissionregistration/v1/paramkind.go b/applyconfigurations/admissionregistration/v1/paramkind.go new file mode 100644 index 000000000..b77a30cf9 --- /dev/null +++ b/applyconfigurations/admissionregistration/v1/paramkind.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 v1 + +// ParamKindApplyConfiguration represents an 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 +// apply. +func ParamKind() *ParamKindApplyConfiguration { + return &ParamKindApplyConfiguration{} +} + +// 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 *ParamKindApplyConfiguration) WithAPIVersion(value string) *ParamKindApplyConfiguration { + b.APIVersion = &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 *ParamKindApplyConfiguration) WithKind(value string) *ParamKindApplyConfiguration { + b.Kind = &value + return b +} diff --git a/applyconfigurations/admissionregistration/v1/paramref.go b/applyconfigurations/admissionregistration/v1/paramref.go new file mode 100644 index 000000000..b52becda5 --- /dev/null +++ b/applyconfigurations/admissionregistration/v1/paramref.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 v1 + +import ( + admissionregistrationv1 "k8s.io/api/admissionregistration/v1" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// ParamRefApplyConfiguration represents an declarative configuration of the ParamRef type for use +// with apply. +type ParamRefApplyConfiguration struct { + Name *string `json:"name,omitempty"` + Namespace *string `json:"namespace,omitempty"` + Selector *v1.LabelSelectorApplyConfiguration `json:"selector,omitempty"` + ParameterNotFoundAction *admissionregistrationv1.ParameterNotFoundActionType `json:"parameterNotFoundAction,omitempty"` +} + +// ParamRefApplyConfiguration constructs an declarative configuration of the ParamRef type for use with +// apply. +func ParamRef() *ParamRefApplyConfiguration { + return &ParamRefApplyConfiguration{} +} + +// 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 *ParamRefApplyConfiguration) WithName(value string) *ParamRefApplyConfiguration { + 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 *ParamRefApplyConfiguration) WithNamespace(value string) *ParamRefApplyConfiguration { + b.Namespace = &value + return b +} + +// 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 *ParamRefApplyConfiguration) WithSelector(value *v1.LabelSelectorApplyConfiguration) *ParamRefApplyConfiguration { + b.Selector = value + return b +} + +// WithParameterNotFoundAction sets the ParameterNotFoundAction field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ParameterNotFoundAction field is set to the value of the last call. +func (b *ParamRefApplyConfiguration) WithParameterNotFoundAction(value admissionregistrationv1.ParameterNotFoundActionType) *ParamRefApplyConfiguration { + b.ParameterNotFoundAction = &value + return b +} diff --git a/applyconfigurations/admissionregistration/v1/typechecking.go b/applyconfigurations/admissionregistration/v1/typechecking.go new file mode 100644 index 000000000..8621ce71e --- /dev/null +++ b/applyconfigurations/admissionregistration/v1/typechecking.go @@ -0,0 +1,44 @@ +/* +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 + +// TypeCheckingApplyConfiguration represents an 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 +// apply. +func TypeChecking() *TypeCheckingApplyConfiguration { + return &TypeCheckingApplyConfiguration{} +} + +// WithExpressionWarnings adds the given value to the ExpressionWarnings 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 ExpressionWarnings field. +func (b *TypeCheckingApplyConfiguration) WithExpressionWarnings(values ...*ExpressionWarningApplyConfiguration) *TypeCheckingApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithExpressionWarnings") + } + b.ExpressionWarnings = append(b.ExpressionWarnings, *values[i]) + } + return b +} diff --git a/applyconfigurations/admissionregistration/v1/validatingadmissionpolicy.go b/applyconfigurations/admissionregistration/v1/validatingadmissionpolicy.go new file mode 100644 index 000000000..fc96a8bdc --- /dev/null +++ b/applyconfigurations/admissionregistration/v1/validatingadmissionpolicy.go @@ -0,0 +1,256 @@ +/* +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 ( + apiadmissionregistrationv1 "k8s.io/api/admissionregistration/v1" + 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" +) + +// ValidatingAdmissionPolicyApplyConfiguration represents an declarative configuration of the ValidatingAdmissionPolicy type for use +// with apply. +type ValidatingAdmissionPolicyApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *ValidatingAdmissionPolicySpecApplyConfiguration `json:"spec,omitempty"` + Status *ValidatingAdmissionPolicyStatusApplyConfiguration `json:"status,omitempty"` +} + +// ValidatingAdmissionPolicy constructs an declarative configuration of the ValidatingAdmissionPolicy type for use with +// apply. +func ValidatingAdmissionPolicy(name string) *ValidatingAdmissionPolicyApplyConfiguration { + b := &ValidatingAdmissionPolicyApplyConfiguration{} + b.WithName(name) + b.WithKind("ValidatingAdmissionPolicy") + b.WithAPIVersion("admissionregistration.k8s.io/v1") + return b +} + +// ExtractValidatingAdmissionPolicy extracts the applied configuration owned by fieldManager from +// validatingAdmissionPolicy. If no managedFields are found in validatingAdmissionPolicy for fieldManager, a +// ValidatingAdmissionPolicyApplyConfiguration 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. +// validatingAdmissionPolicy must be a unmodified ValidatingAdmissionPolicy API object that was retrieved from the Kubernetes API. +// ExtractValidatingAdmissionPolicy 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 ExtractValidatingAdmissionPolicy(validatingAdmissionPolicy *apiadmissionregistrationv1.ValidatingAdmissionPolicy, fieldManager string) (*ValidatingAdmissionPolicyApplyConfiguration, error) { + return extractValidatingAdmissionPolicy(validatingAdmissionPolicy, fieldManager, "") +} + +// ExtractValidatingAdmissionPolicyStatus is the same as ExtractValidatingAdmissionPolicy except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractValidatingAdmissionPolicyStatus(validatingAdmissionPolicy *apiadmissionregistrationv1.ValidatingAdmissionPolicy, fieldManager string) (*ValidatingAdmissionPolicyApplyConfiguration, error) { + return extractValidatingAdmissionPolicy(validatingAdmissionPolicy, fieldManager, "status") +} + +func extractValidatingAdmissionPolicy(validatingAdmissionPolicy *apiadmissionregistrationv1.ValidatingAdmissionPolicy, fieldManager string, subresource string) (*ValidatingAdmissionPolicyApplyConfiguration, error) { + b := &ValidatingAdmissionPolicyApplyConfiguration{} + err := managedfields.ExtractInto(validatingAdmissionPolicy, internal.Parser().Type("io.k8s.api.admissionregistration.v1.ValidatingAdmissionPolicy"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(validatingAdmissionPolicy.Name) + + b.WithKind("ValidatingAdmissionPolicy") + b.WithAPIVersion("admissionregistration.k8s.io/v1") + 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 *ValidatingAdmissionPolicyApplyConfiguration) WithKind(value string) *ValidatingAdmissionPolicyApplyConfiguration { + 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 *ValidatingAdmissionPolicyApplyConfiguration) WithAPIVersion(value string) *ValidatingAdmissionPolicyApplyConfiguration { + 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 *ValidatingAdmissionPolicyApplyConfiguration) WithName(value string) *ValidatingAdmissionPolicyApplyConfiguration { + 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 *ValidatingAdmissionPolicyApplyConfiguration) WithGenerateName(value string) *ValidatingAdmissionPolicyApplyConfiguration { + 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 *ValidatingAdmissionPolicyApplyConfiguration) WithNamespace(value string) *ValidatingAdmissionPolicyApplyConfiguration { + 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 *ValidatingAdmissionPolicyApplyConfiguration) WithUID(value types.UID) *ValidatingAdmissionPolicyApplyConfiguration { + 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 *ValidatingAdmissionPolicyApplyConfiguration) WithResourceVersion(value string) *ValidatingAdmissionPolicyApplyConfiguration { + 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 *ValidatingAdmissionPolicyApplyConfiguration) WithGeneration(value int64) *ValidatingAdmissionPolicyApplyConfiguration { + 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 *ValidatingAdmissionPolicyApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ValidatingAdmissionPolicyApplyConfiguration { + 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 *ValidatingAdmissionPolicyApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ValidatingAdmissionPolicyApplyConfiguration { + 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 *ValidatingAdmissionPolicyApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ValidatingAdmissionPolicyApplyConfiguration { + 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 *ValidatingAdmissionPolicyApplyConfiguration) WithLabels(entries map[string]string) *ValidatingAdmissionPolicyApplyConfiguration { + 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 *ValidatingAdmissionPolicyApplyConfiguration) WithAnnotations(entries map[string]string) *ValidatingAdmissionPolicyApplyConfiguration { + 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 *ValidatingAdmissionPolicyApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ValidatingAdmissionPolicyApplyConfiguration { + 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 *ValidatingAdmissionPolicyApplyConfiguration) WithFinalizers(values ...string) *ValidatingAdmissionPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *ValidatingAdmissionPolicyApplyConfiguration) 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 *ValidatingAdmissionPolicyApplyConfiguration) WithSpec(value *ValidatingAdmissionPolicySpecApplyConfiguration) *ValidatingAdmissionPolicyApplyConfiguration { + 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 *ValidatingAdmissionPolicyApplyConfiguration) WithStatus(value *ValidatingAdmissionPolicyStatusApplyConfiguration) *ValidatingAdmissionPolicyApplyConfiguration { + b.Status = value + return b +} diff --git a/applyconfigurations/admissionregistration/v1/validatingadmissionpolicybinding.go b/applyconfigurations/admissionregistration/v1/validatingadmissionpolicybinding.go new file mode 100644 index 000000000..5bc41a0f5 --- /dev/null +++ b/applyconfigurations/admissionregistration/v1/validatingadmissionpolicybinding.go @@ -0,0 +1,247 @@ +/* +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 ( + apiadmissionregistrationv1 "k8s.io/api/admissionregistration/v1" + 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" +) + +// ValidatingAdmissionPolicyBindingApplyConfiguration represents an declarative configuration of the ValidatingAdmissionPolicyBinding type for use +// with apply. +type ValidatingAdmissionPolicyBindingApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *ValidatingAdmissionPolicyBindingSpecApplyConfiguration `json:"spec,omitempty"` +} + +// ValidatingAdmissionPolicyBinding constructs an declarative configuration of the ValidatingAdmissionPolicyBinding type for use with +// apply. +func ValidatingAdmissionPolicyBinding(name string) *ValidatingAdmissionPolicyBindingApplyConfiguration { + b := &ValidatingAdmissionPolicyBindingApplyConfiguration{} + b.WithName(name) + b.WithKind("ValidatingAdmissionPolicyBinding") + b.WithAPIVersion("admissionregistration.k8s.io/v1") + return b +} + +// ExtractValidatingAdmissionPolicyBinding extracts the applied configuration owned by fieldManager from +// validatingAdmissionPolicyBinding. If no managedFields are found in validatingAdmissionPolicyBinding for fieldManager, a +// ValidatingAdmissionPolicyBindingApplyConfiguration 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. +// validatingAdmissionPolicyBinding must be a unmodified ValidatingAdmissionPolicyBinding API object that was retrieved from the Kubernetes API. +// ExtractValidatingAdmissionPolicyBinding 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 ExtractValidatingAdmissionPolicyBinding(validatingAdmissionPolicyBinding *apiadmissionregistrationv1.ValidatingAdmissionPolicyBinding, fieldManager string) (*ValidatingAdmissionPolicyBindingApplyConfiguration, error) { + return extractValidatingAdmissionPolicyBinding(validatingAdmissionPolicyBinding, fieldManager, "") +} + +// ExtractValidatingAdmissionPolicyBindingStatus is the same as ExtractValidatingAdmissionPolicyBinding except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractValidatingAdmissionPolicyBindingStatus(validatingAdmissionPolicyBinding *apiadmissionregistrationv1.ValidatingAdmissionPolicyBinding, fieldManager string) (*ValidatingAdmissionPolicyBindingApplyConfiguration, error) { + return extractValidatingAdmissionPolicyBinding(validatingAdmissionPolicyBinding, fieldManager, "status") +} + +func extractValidatingAdmissionPolicyBinding(validatingAdmissionPolicyBinding *apiadmissionregistrationv1.ValidatingAdmissionPolicyBinding, fieldManager string, subresource string) (*ValidatingAdmissionPolicyBindingApplyConfiguration, error) { + b := &ValidatingAdmissionPolicyBindingApplyConfiguration{} + err := managedfields.ExtractInto(validatingAdmissionPolicyBinding, internal.Parser().Type("io.k8s.api.admissionregistration.v1.ValidatingAdmissionPolicyBinding"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(validatingAdmissionPolicyBinding.Name) + + b.WithKind("ValidatingAdmissionPolicyBinding") + b.WithAPIVersion("admissionregistration.k8s.io/v1") + 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 *ValidatingAdmissionPolicyBindingApplyConfiguration) WithKind(value string) *ValidatingAdmissionPolicyBindingApplyConfiguration { + 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 *ValidatingAdmissionPolicyBindingApplyConfiguration) WithAPIVersion(value string) *ValidatingAdmissionPolicyBindingApplyConfiguration { + 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 *ValidatingAdmissionPolicyBindingApplyConfiguration) WithName(value string) *ValidatingAdmissionPolicyBindingApplyConfiguration { + 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 *ValidatingAdmissionPolicyBindingApplyConfiguration) WithGenerateName(value string) *ValidatingAdmissionPolicyBindingApplyConfiguration { + 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 *ValidatingAdmissionPolicyBindingApplyConfiguration) WithNamespace(value string) *ValidatingAdmissionPolicyBindingApplyConfiguration { + 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 *ValidatingAdmissionPolicyBindingApplyConfiguration) WithUID(value types.UID) *ValidatingAdmissionPolicyBindingApplyConfiguration { + 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 *ValidatingAdmissionPolicyBindingApplyConfiguration) WithResourceVersion(value string) *ValidatingAdmissionPolicyBindingApplyConfiguration { + 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 *ValidatingAdmissionPolicyBindingApplyConfiguration) WithGeneration(value int64) *ValidatingAdmissionPolicyBindingApplyConfiguration { + 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 *ValidatingAdmissionPolicyBindingApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ValidatingAdmissionPolicyBindingApplyConfiguration { + 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 *ValidatingAdmissionPolicyBindingApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ValidatingAdmissionPolicyBindingApplyConfiguration { + 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 *ValidatingAdmissionPolicyBindingApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ValidatingAdmissionPolicyBindingApplyConfiguration { + 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 *ValidatingAdmissionPolicyBindingApplyConfiguration) WithLabels(entries map[string]string) *ValidatingAdmissionPolicyBindingApplyConfiguration { + 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 *ValidatingAdmissionPolicyBindingApplyConfiguration) WithAnnotations(entries map[string]string) *ValidatingAdmissionPolicyBindingApplyConfiguration { + 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 *ValidatingAdmissionPolicyBindingApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ValidatingAdmissionPolicyBindingApplyConfiguration { + 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 *ValidatingAdmissionPolicyBindingApplyConfiguration) WithFinalizers(values ...string) *ValidatingAdmissionPolicyBindingApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) 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 *ValidatingAdmissionPolicyBindingApplyConfiguration) WithSpec(value *ValidatingAdmissionPolicyBindingSpecApplyConfiguration) *ValidatingAdmissionPolicyBindingApplyConfiguration { + b.Spec = value + return b +} diff --git a/applyconfigurations/admissionregistration/v1/validatingadmissionpolicybindingspec.go b/applyconfigurations/admissionregistration/v1/validatingadmissionpolicybindingspec.go new file mode 100644 index 000000000..da6ecbe37 --- /dev/null +++ b/applyconfigurations/admissionregistration/v1/validatingadmissionpolicybindingspec.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 v1 + +import ( + admissionregistrationv1 "k8s.io/api/admissionregistration/v1" +) + +// ValidatingAdmissionPolicyBindingSpecApplyConfiguration represents an declarative configuration of the ValidatingAdmissionPolicyBindingSpec type for use +// with apply. +type ValidatingAdmissionPolicyBindingSpecApplyConfiguration struct { + PolicyName *string `json:"policyName,omitempty"` + ParamRef *ParamRefApplyConfiguration `json:"paramRef,omitempty"` + MatchResources *MatchResourcesApplyConfiguration `json:"matchResources,omitempty"` + ValidationActions []admissionregistrationv1.ValidationAction `json:"validationActions,omitempty"` +} + +// ValidatingAdmissionPolicyBindingSpecApplyConfiguration constructs an declarative configuration of the ValidatingAdmissionPolicyBindingSpec type for use with +// apply. +func ValidatingAdmissionPolicyBindingSpec() *ValidatingAdmissionPolicyBindingSpecApplyConfiguration { + return &ValidatingAdmissionPolicyBindingSpecApplyConfiguration{} +} + +// WithPolicyName sets the PolicyName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PolicyName field is set to the value of the last call. +func (b *ValidatingAdmissionPolicyBindingSpecApplyConfiguration) WithPolicyName(value string) *ValidatingAdmissionPolicyBindingSpecApplyConfiguration { + b.PolicyName = &value + return b +} + +// WithParamRef sets the ParamRef field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ParamRef field is set to the value of the last call. +func (b *ValidatingAdmissionPolicyBindingSpecApplyConfiguration) WithParamRef(value *ParamRefApplyConfiguration) *ValidatingAdmissionPolicyBindingSpecApplyConfiguration { + b.ParamRef = value + return b +} + +// WithMatchResources sets the MatchResources field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MatchResources field is set to the value of the last call. +func (b *ValidatingAdmissionPolicyBindingSpecApplyConfiguration) WithMatchResources(value *MatchResourcesApplyConfiguration) *ValidatingAdmissionPolicyBindingSpecApplyConfiguration { + b.MatchResources = value + return b +} + +// WithValidationActions adds the given value to the ValidationActions 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 ValidationActions field. +func (b *ValidatingAdmissionPolicyBindingSpecApplyConfiguration) WithValidationActions(values ...admissionregistrationv1.ValidationAction) *ValidatingAdmissionPolicyBindingSpecApplyConfiguration { + for i := range values { + b.ValidationActions = append(b.ValidationActions, values[i]) + } + return b +} diff --git a/applyconfigurations/admissionregistration/v1/validatingadmissionpolicyspec.go b/applyconfigurations/admissionregistration/v1/validatingadmissionpolicyspec.go new file mode 100644 index 000000000..eb930b9b1 --- /dev/null +++ b/applyconfigurations/admissionregistration/v1/validatingadmissionpolicyspec.go @@ -0,0 +1,117 @@ +/* +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 ( + admissionregistrationv1 "k8s.io/api/admissionregistration/v1" +) + +// ValidatingAdmissionPolicySpecApplyConfiguration represents an declarative configuration of the ValidatingAdmissionPolicySpec type for use +// with apply. +type ValidatingAdmissionPolicySpecApplyConfiguration struct { + ParamKind *ParamKindApplyConfiguration `json:"paramKind,omitempty"` + MatchConstraints *MatchResourcesApplyConfiguration `json:"matchConstraints,omitempty"` + Validations []ValidationApplyConfiguration `json:"validations,omitempty"` + FailurePolicy *admissionregistrationv1.FailurePolicyType `json:"failurePolicy,omitempty"` + AuditAnnotations []AuditAnnotationApplyConfiguration `json:"auditAnnotations,omitempty"` + MatchConditions []MatchConditionApplyConfiguration `json:"matchConditions,omitempty"` + Variables []VariableApplyConfiguration `json:"variables,omitempty"` +} + +// ValidatingAdmissionPolicySpecApplyConfiguration constructs an declarative configuration of the ValidatingAdmissionPolicySpec type for use with +// apply. +func ValidatingAdmissionPolicySpec() *ValidatingAdmissionPolicySpecApplyConfiguration { + return &ValidatingAdmissionPolicySpecApplyConfiguration{} +} + +// WithParamKind sets the ParamKind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ParamKind field is set to the value of the last call. +func (b *ValidatingAdmissionPolicySpecApplyConfiguration) WithParamKind(value *ParamKindApplyConfiguration) *ValidatingAdmissionPolicySpecApplyConfiguration { + b.ParamKind = value + return b +} + +// WithMatchConstraints sets the MatchConstraints field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MatchConstraints field is set to the value of the last call. +func (b *ValidatingAdmissionPolicySpecApplyConfiguration) WithMatchConstraints(value *MatchResourcesApplyConfiguration) *ValidatingAdmissionPolicySpecApplyConfiguration { + b.MatchConstraints = value + return b +} + +// WithValidations adds the given value to the Validations 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 Validations field. +func (b *ValidatingAdmissionPolicySpecApplyConfiguration) WithValidations(values ...*ValidationApplyConfiguration) *ValidatingAdmissionPolicySpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithValidations") + } + b.Validations = append(b.Validations, *values[i]) + } + return b +} + +// WithFailurePolicy sets the FailurePolicy field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the FailurePolicy field is set to the value of the last call. +func (b *ValidatingAdmissionPolicySpecApplyConfiguration) WithFailurePolicy(value admissionregistrationv1.FailurePolicyType) *ValidatingAdmissionPolicySpecApplyConfiguration { + b.FailurePolicy = &value + return b +} + +// WithAuditAnnotations adds the given value to the AuditAnnotations 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 AuditAnnotations field. +func (b *ValidatingAdmissionPolicySpecApplyConfiguration) WithAuditAnnotations(values ...*AuditAnnotationApplyConfiguration) *ValidatingAdmissionPolicySpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithAuditAnnotations") + } + b.AuditAnnotations = append(b.AuditAnnotations, *values[i]) + } + return b +} + +// WithMatchConditions adds the given value to the MatchConditions 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 MatchConditions field. +func (b *ValidatingAdmissionPolicySpecApplyConfiguration) WithMatchConditions(values ...*MatchConditionApplyConfiguration) *ValidatingAdmissionPolicySpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithMatchConditions") + } + b.MatchConditions = append(b.MatchConditions, *values[i]) + } + return b +} + +// WithVariables adds the given value to the Variables 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 Variables field. +func (b *ValidatingAdmissionPolicySpecApplyConfiguration) WithVariables(values ...*VariableApplyConfiguration) *ValidatingAdmissionPolicySpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithVariables") + } + b.Variables = append(b.Variables, *values[i]) + } + return b +} diff --git a/applyconfigurations/admissionregistration/v1/validatingadmissionpolicystatus.go b/applyconfigurations/admissionregistration/v1/validatingadmissionpolicystatus.go new file mode 100644 index 000000000..25cd67f08 --- /dev/null +++ b/applyconfigurations/admissionregistration/v1/validatingadmissionpolicystatus.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 v1 + +import ( + metav1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// ValidatingAdmissionPolicyStatusApplyConfiguration represents an declarative configuration of the ValidatingAdmissionPolicyStatus type for use +// with apply. +type ValidatingAdmissionPolicyStatusApplyConfiguration struct { + ObservedGeneration *int64 `json:"observedGeneration,omitempty"` + TypeChecking *TypeCheckingApplyConfiguration `json:"typeChecking,omitempty"` + Conditions []metav1.ConditionApplyConfiguration `json:"conditions,omitempty"` +} + +// ValidatingAdmissionPolicyStatusApplyConfiguration constructs an declarative configuration of the ValidatingAdmissionPolicyStatus type for use with +// apply. +func ValidatingAdmissionPolicyStatus() *ValidatingAdmissionPolicyStatusApplyConfiguration { + return &ValidatingAdmissionPolicyStatusApplyConfiguration{} +} + +// WithObservedGeneration sets the ObservedGeneration field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ObservedGeneration field is set to the value of the last call. +func (b *ValidatingAdmissionPolicyStatusApplyConfiguration) WithObservedGeneration(value int64) *ValidatingAdmissionPolicyStatusApplyConfiguration { + b.ObservedGeneration = &value + return b +} + +// WithTypeChecking sets the TypeChecking field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TypeChecking field is set to the value of the last call. +func (b *ValidatingAdmissionPolicyStatusApplyConfiguration) WithTypeChecking(value *TypeCheckingApplyConfiguration) *ValidatingAdmissionPolicyStatusApplyConfiguration { + b.TypeChecking = value + return b +} + +// WithConditions adds the given value to the Conditions field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Conditions field. +func (b *ValidatingAdmissionPolicyStatusApplyConfiguration) WithConditions(values ...*metav1.ConditionApplyConfiguration) *ValidatingAdmissionPolicyStatusApplyConfiguration { + 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/admissionregistration/v1/validation.go b/applyconfigurations/admissionregistration/v1/validation.go new file mode 100644 index 000000000..ac29d1436 --- /dev/null +++ b/applyconfigurations/admissionregistration/v1/validation.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 applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// ValidationApplyConfiguration represents an declarative configuration of the Validation type for use +// with apply. +type ValidationApplyConfiguration struct { + Expression *string `json:"expression,omitempty"` + Message *string `json:"message,omitempty"` + Reason *v1.StatusReason `json:"reason,omitempty"` + MessageExpression *string `json:"messageExpression,omitempty"` +} + +// ValidationApplyConfiguration constructs an declarative configuration of the Validation type for use with +// apply. +func Validation() *ValidationApplyConfiguration { + return &ValidationApplyConfiguration{} +} + +// 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 Expression field is set to the value of the last call. +func (b *ValidationApplyConfiguration) WithExpression(value string) *ValidationApplyConfiguration { + b.Expression = &value + return b +} + +// WithMessage sets the Message field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Message field is set to the value of the last call. +func (b *ValidationApplyConfiguration) WithMessage(value string) *ValidationApplyConfiguration { + b.Message = &value + return b +} + +// WithReason sets the Reason field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Reason field is set to the value of the last call. +func (b *ValidationApplyConfiguration) WithReason(value v1.StatusReason) *ValidationApplyConfiguration { + b.Reason = &value + return b +} + +// WithMessageExpression sets the MessageExpression field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MessageExpression field is set to the value of the last call. +func (b *ValidationApplyConfiguration) WithMessageExpression(value string) *ValidationApplyConfiguration { + b.MessageExpression = &value + return b +} diff --git a/applyconfigurations/admissionregistration/v1/variable.go b/applyconfigurations/admissionregistration/v1/variable.go new file mode 100644 index 000000000..d55f29a38 --- /dev/null +++ b/applyconfigurations/admissionregistration/v1/variable.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 v1 + +// VariableApplyConfiguration represents an 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 +// apply. +func Variable() *VariableApplyConfiguration { + return &VariableApplyConfiguration{} +} + +// 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 *VariableApplyConfiguration) WithName(value string) *VariableApplyConfiguration { + b.Name = &value + return b +} + +// 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 Expression field is set to the value of the last call. +func (b *VariableApplyConfiguration) WithExpression(value string) *VariableApplyConfiguration { + b.Expression = &value + return b +} diff --git a/applyconfigurations/internal/internal.go b/applyconfigurations/internal/internal.go index 99c14e941..a22406d3e 100644 --- a/applyconfigurations/internal/internal.go +++ b/applyconfigurations/internal/internal.go @@ -39,6 +39,28 @@ func Parser() *typed.Parser { var parserOnce sync.Once var parser *typed.Parser var schemaYAML = typed.YAMLObject(`types: +- name: io.k8s.api.admissionregistration.v1.AuditAnnotation + map: + fields: + - name: key + type: + scalar: string + default: "" + - name: valueExpression + type: + scalar: string + default: "" +- name: io.k8s.api.admissionregistration.v1.ExpressionWarning + map: + fields: + - name: fieldRef + type: + scalar: string + default: "" + - name: warning + type: + scalar: string + default: "" - name: io.k8s.api.admissionregistration.v1.MatchCondition map: fields: @@ -50,6 +72,31 @@ var schemaYAML = typed.YAMLObject(`types: type: scalar: string default: "" +- name: io.k8s.api.admissionregistration.v1.MatchResources + map: + fields: + - name: excludeResourceRules + type: + list: + elementType: + namedType: io.k8s.api.admissionregistration.v1.NamedRuleWithOperations + elementRelationship: atomic + - name: matchPolicy + type: + scalar: string + - name: namespaceSelector + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector + - name: objectSelector + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector + - name: resourceRules + type: + list: + elementType: + namedType: io.k8s.api.admissionregistration.v1.NamedRuleWithOperations + elementRelationship: atomic + elementRelationship: atomic - name: io.k8s.api.admissionregistration.v1.MutatingWebhook map: fields: @@ -123,6 +170,69 @@ var schemaYAML = typed.YAMLObject(`types: elementRelationship: associative keys: - name +- name: io.k8s.api.admissionregistration.v1.NamedRuleWithOperations + map: + fields: + - name: apiGroups + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: apiVersions + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: operations + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: resourceNames + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: resources + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: scope + type: + scalar: string + elementRelationship: atomic +- name: io.k8s.api.admissionregistration.v1.ParamKind + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + elementRelationship: atomic +- name: io.k8s.api.admissionregistration.v1.ParamRef + map: + fields: + - name: name + type: + scalar: string + - name: namespace + type: + scalar: string + - name: parameterNotFoundAction + type: + scalar: string + - name: selector + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector + elementRelationship: atomic - name: io.k8s.api.admissionregistration.v1.RuleWithOperations map: fields: @@ -170,6 +280,128 @@ var schemaYAML = typed.YAMLObject(`types: - name: port type: scalar: numeric +- name: io.k8s.api.admissionregistration.v1.TypeChecking + map: + fields: + - name: expressionWarnings + type: + list: + elementType: + namedType: io.k8s.api.admissionregistration.v1.ExpressionWarning + elementRelationship: atomic +- name: io.k8s.api.admissionregistration.v1.ValidatingAdmissionPolicy + 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.admissionregistration.v1.ValidatingAdmissionPolicySpec + default: {} + - name: status + type: + namedType: io.k8s.api.admissionregistration.v1.ValidatingAdmissionPolicyStatus + default: {} +- name: io.k8s.api.admissionregistration.v1.ValidatingAdmissionPolicyBinding + 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.admissionregistration.v1.ValidatingAdmissionPolicyBindingSpec + default: {} +- name: io.k8s.api.admissionregistration.v1.ValidatingAdmissionPolicyBindingSpec + map: + fields: + - name: matchResources + type: + namedType: io.k8s.api.admissionregistration.v1.MatchResources + - name: paramRef + type: + namedType: io.k8s.api.admissionregistration.v1.ParamRef + - name: policyName + type: + scalar: string + - name: validationActions + type: + list: + elementType: + scalar: string + elementRelationship: associative +- name: io.k8s.api.admissionregistration.v1.ValidatingAdmissionPolicySpec + map: + fields: + - name: auditAnnotations + type: + list: + elementType: + namedType: io.k8s.api.admissionregistration.v1.AuditAnnotation + elementRelationship: atomic + - name: failurePolicy + type: + scalar: string + - name: matchConditions + type: + list: + elementType: + namedType: io.k8s.api.admissionregistration.v1.MatchCondition + elementRelationship: associative + keys: + - name + - name: matchConstraints + type: + namedType: io.k8s.api.admissionregistration.v1.MatchResources + - name: paramKind + type: + namedType: io.k8s.api.admissionregistration.v1.ParamKind + - name: validations + type: + list: + elementType: + namedType: io.k8s.api.admissionregistration.v1.Validation + elementRelationship: atomic + - name: variables + type: + list: + elementType: + namedType: io.k8s.api.admissionregistration.v1.Variable + elementRelationship: associative + keys: + - name +- name: io.k8s.api.admissionregistration.v1.ValidatingAdmissionPolicyStatus + map: + fields: + - name: conditions + type: + list: + elementType: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Condition + elementRelationship: associative + keys: + - type + - name: observedGeneration + type: + scalar: numeric + - name: typeChecking + type: + namedType: io.k8s.api.admissionregistration.v1.TypeChecking - name: io.k8s.api.admissionregistration.v1.ValidatingWebhook map: fields: @@ -240,6 +472,34 @@ var schemaYAML = typed.YAMLObject(`types: elementRelationship: associative keys: - name +- name: io.k8s.api.admissionregistration.v1.Validation + map: + fields: + - name: expression + type: + scalar: string + default: "" + - name: message + type: + scalar: string + - name: messageExpression + type: + scalar: string + - name: reason + type: + scalar: string +- name: io.k8s.api.admissionregistration.v1.Variable + map: + fields: + - name: expression + type: + scalar: string + default: "" + - name: name + type: + scalar: string + default: "" + elementRelationship: atomic - name: io.k8s.api.admissionregistration.v1.WebhookClientConfig map: fields: diff --git a/applyconfigurations/utils.go b/applyconfigurations/utils.go index 014e0161e..d3ec5e7df 100644 --- a/applyconfigurations/utils.go +++ b/applyconfigurations/utils.go @@ -123,22 +123,50 @@ import ( func ForKind(kind schema.GroupVersionKind) interface{} { switch kind { // Group=admissionregistration.k8s.io, Version=v1 + case v1.SchemeGroupVersion.WithKind("AuditAnnotation"): + return &admissionregistrationv1.AuditAnnotationApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("ExpressionWarning"): + return &admissionregistrationv1.ExpressionWarningApplyConfiguration{} case v1.SchemeGroupVersion.WithKind("MatchCondition"): return &admissionregistrationv1.MatchConditionApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("MatchResources"): + return &admissionregistrationv1.MatchResourcesApplyConfiguration{} case v1.SchemeGroupVersion.WithKind("MutatingWebhook"): return &admissionregistrationv1.MutatingWebhookApplyConfiguration{} case v1.SchemeGroupVersion.WithKind("MutatingWebhookConfiguration"): return &admissionregistrationv1.MutatingWebhookConfigurationApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("NamedRuleWithOperations"): + return &admissionregistrationv1.NamedRuleWithOperationsApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("ParamKind"): + return &admissionregistrationv1.ParamKindApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("ParamRef"): + return &admissionregistrationv1.ParamRefApplyConfiguration{} case v1.SchemeGroupVersion.WithKind("Rule"): return &admissionregistrationv1.RuleApplyConfiguration{} case v1.SchemeGroupVersion.WithKind("RuleWithOperations"): return &admissionregistrationv1.RuleWithOperationsApplyConfiguration{} case v1.SchemeGroupVersion.WithKind("ServiceReference"): return &admissionregistrationv1.ServiceReferenceApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("TypeChecking"): + return &admissionregistrationv1.TypeCheckingApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("ValidatingAdmissionPolicy"): + return &admissionregistrationv1.ValidatingAdmissionPolicyApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("ValidatingAdmissionPolicyBinding"): + return &admissionregistrationv1.ValidatingAdmissionPolicyBindingApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("ValidatingAdmissionPolicyBindingSpec"): + return &admissionregistrationv1.ValidatingAdmissionPolicyBindingSpecApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("ValidatingAdmissionPolicySpec"): + return &admissionregistrationv1.ValidatingAdmissionPolicySpecApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("ValidatingAdmissionPolicyStatus"): + return &admissionregistrationv1.ValidatingAdmissionPolicyStatusApplyConfiguration{} case v1.SchemeGroupVersion.WithKind("ValidatingWebhook"): return &admissionregistrationv1.ValidatingWebhookApplyConfiguration{} case v1.SchemeGroupVersion.WithKind("ValidatingWebhookConfiguration"): return &admissionregistrationv1.ValidatingWebhookConfigurationApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("Validation"): + return &admissionregistrationv1.ValidationApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("Variable"): + return &admissionregistrationv1.VariableApplyConfiguration{} case v1.SchemeGroupVersion.WithKind("WebhookClientConfig"): return &admissionregistrationv1.WebhookClientConfigApplyConfiguration{} diff --git a/informers/admissionregistration/v1/interface.go b/informers/admissionregistration/v1/interface.go index 1ecae9ecf..08769d3cc 100644 --- a/informers/admissionregistration/v1/interface.go +++ b/informers/admissionregistration/v1/interface.go @@ -26,6 +26,10 @@ import ( type Interface interface { // MutatingWebhookConfigurations returns a MutatingWebhookConfigurationInformer. MutatingWebhookConfigurations() MutatingWebhookConfigurationInformer + // ValidatingAdmissionPolicies returns a ValidatingAdmissionPolicyInformer. + ValidatingAdmissionPolicies() ValidatingAdmissionPolicyInformer + // ValidatingAdmissionPolicyBindings returns a ValidatingAdmissionPolicyBindingInformer. + ValidatingAdmissionPolicyBindings() ValidatingAdmissionPolicyBindingInformer // ValidatingWebhookConfigurations returns a ValidatingWebhookConfigurationInformer. ValidatingWebhookConfigurations() ValidatingWebhookConfigurationInformer } @@ -46,6 +50,16 @@ func (v *version) MutatingWebhookConfigurations() MutatingWebhookConfigurationIn return &mutatingWebhookConfigurationInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } +// ValidatingAdmissionPolicies returns a ValidatingAdmissionPolicyInformer. +func (v *version) ValidatingAdmissionPolicies() ValidatingAdmissionPolicyInformer { + return &validatingAdmissionPolicyInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// ValidatingAdmissionPolicyBindings returns a ValidatingAdmissionPolicyBindingInformer. +func (v *version) ValidatingAdmissionPolicyBindings() ValidatingAdmissionPolicyBindingInformer { + return &validatingAdmissionPolicyBindingInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + // ValidatingWebhookConfigurations returns a ValidatingWebhookConfigurationInformer. func (v *version) ValidatingWebhookConfigurations() ValidatingWebhookConfigurationInformer { return &validatingWebhookConfigurationInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} diff --git a/informers/admissionregistration/v1/validatingadmissionpolicy.go b/informers/admissionregistration/v1/validatingadmissionpolicy.go new file mode 100644 index 000000000..eaf9414e2 --- /dev/null +++ b/informers/admissionregistration/v1/validatingadmissionpolicy.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 v1 + +import ( + "context" + time "time" + + admissionregistrationv1 "k8s.io/api/admissionregistration/v1" + metav1 "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" + v1 "k8s.io/client-go/listers/admissionregistration/v1" + cache "k8s.io/client-go/tools/cache" +) + +// ValidatingAdmissionPolicyInformer provides access to a shared informer and lister for +// ValidatingAdmissionPolicies. +type ValidatingAdmissionPolicyInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.ValidatingAdmissionPolicyLister +} + +type validatingAdmissionPolicyInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewValidatingAdmissionPolicyInformer constructs a new informer for ValidatingAdmissionPolicy 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 NewValidatingAdmissionPolicyInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredValidatingAdmissionPolicyInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredValidatingAdmissionPolicyInformer constructs a new informer for ValidatingAdmissionPolicy 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 NewFilteredValidatingAdmissionPolicyInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AdmissionregistrationV1().ValidatingAdmissionPolicies().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AdmissionregistrationV1().ValidatingAdmissionPolicies().Watch(context.TODO(), options) + }, + }, + &admissionregistrationv1.ValidatingAdmissionPolicy{}, + resyncPeriod, + indexers, + ) +} + +func (f *validatingAdmissionPolicyInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredValidatingAdmissionPolicyInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *validatingAdmissionPolicyInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&admissionregistrationv1.ValidatingAdmissionPolicy{}, f.defaultInformer) +} + +func (f *validatingAdmissionPolicyInformer) Lister() v1.ValidatingAdmissionPolicyLister { + return v1.NewValidatingAdmissionPolicyLister(f.Informer().GetIndexer()) +} diff --git a/informers/admissionregistration/v1/validatingadmissionpolicybinding.go b/informers/admissionregistration/v1/validatingadmissionpolicybinding.go new file mode 100644 index 000000000..8cd61bf28 --- /dev/null +++ b/informers/admissionregistration/v1/validatingadmissionpolicybinding.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 v1 + +import ( + "context" + time "time" + + admissionregistrationv1 "k8s.io/api/admissionregistration/v1" + metav1 "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" + v1 "k8s.io/client-go/listers/admissionregistration/v1" + cache "k8s.io/client-go/tools/cache" +) + +// ValidatingAdmissionPolicyBindingInformer provides access to a shared informer and lister for +// ValidatingAdmissionPolicyBindings. +type ValidatingAdmissionPolicyBindingInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.ValidatingAdmissionPolicyBindingLister +} + +type validatingAdmissionPolicyBindingInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewValidatingAdmissionPolicyBindingInformer constructs a new informer for ValidatingAdmissionPolicyBinding 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 NewValidatingAdmissionPolicyBindingInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredValidatingAdmissionPolicyBindingInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredValidatingAdmissionPolicyBindingInformer constructs a new informer for ValidatingAdmissionPolicyBinding 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 NewFilteredValidatingAdmissionPolicyBindingInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AdmissionregistrationV1().ValidatingAdmissionPolicyBindings().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AdmissionregistrationV1().ValidatingAdmissionPolicyBindings().Watch(context.TODO(), options) + }, + }, + &admissionregistrationv1.ValidatingAdmissionPolicyBinding{}, + resyncPeriod, + indexers, + ) +} + +func (f *validatingAdmissionPolicyBindingInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredValidatingAdmissionPolicyBindingInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *validatingAdmissionPolicyBindingInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&admissionregistrationv1.ValidatingAdmissionPolicyBinding{}, f.defaultInformer) +} + +func (f *validatingAdmissionPolicyBindingInformer) Lister() v1.ValidatingAdmissionPolicyBindingLister { + return v1.NewValidatingAdmissionPolicyBindingLister(f.Informer().GetIndexer()) +} diff --git a/informers/generic.go b/informers/generic.go index 680768815..1e76cefd1 100644 --- a/informers/generic.go +++ b/informers/generic.go @@ -100,6 +100,10 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource // Group=admissionregistration.k8s.io, Version=v1 case v1.SchemeGroupVersion.WithResource("mutatingwebhookconfigurations"): return &genericInformer{resource: resource.GroupResource(), informer: f.Admissionregistration().V1().MutatingWebhookConfigurations().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("validatingadmissionpolicies"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Admissionregistration().V1().ValidatingAdmissionPolicies().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("validatingadmissionpolicybindings"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Admissionregistration().V1().ValidatingAdmissionPolicyBindings().Informer()}, nil case v1.SchemeGroupVersion.WithResource("validatingwebhookconfigurations"): return &genericInformer{resource: resource.GroupResource(), informer: f.Admissionregistration().V1().ValidatingWebhookConfigurations().Informer()}, nil diff --git a/kubernetes/typed/admissionregistration/v1/admissionregistration_client.go b/kubernetes/typed/admissionregistration/v1/admissionregistration_client.go index 10848bed1..a81b2b682 100644 --- a/kubernetes/typed/admissionregistration/v1/admissionregistration_client.go +++ b/kubernetes/typed/admissionregistration/v1/admissionregistration_client.go @@ -29,6 +29,8 @@ import ( type AdmissionregistrationV1Interface interface { RESTClient() rest.Interface MutatingWebhookConfigurationsGetter + ValidatingAdmissionPoliciesGetter + ValidatingAdmissionPolicyBindingsGetter ValidatingWebhookConfigurationsGetter } @@ -41,6 +43,14 @@ func (c *AdmissionregistrationV1Client) MutatingWebhookConfigurations() Mutating return newMutatingWebhookConfigurations(c) } +func (c *AdmissionregistrationV1Client) ValidatingAdmissionPolicies() ValidatingAdmissionPolicyInterface { + return newValidatingAdmissionPolicies(c) +} + +func (c *AdmissionregistrationV1Client) ValidatingAdmissionPolicyBindings() ValidatingAdmissionPolicyBindingInterface { + return newValidatingAdmissionPolicyBindings(c) +} + func (c *AdmissionregistrationV1Client) ValidatingWebhookConfigurations() ValidatingWebhookConfigurationInterface { return newValidatingWebhookConfigurations(c) } diff --git a/kubernetes/typed/admissionregistration/v1/fake/fake_admissionregistration_client.go b/kubernetes/typed/admissionregistration/v1/fake/fake_admissionregistration_client.go index a5a570ad1..b7487c2fb 100644 --- a/kubernetes/typed/admissionregistration/v1/fake/fake_admissionregistration_client.go +++ b/kubernetes/typed/admissionregistration/v1/fake/fake_admissionregistration_client.go @@ -32,6 +32,14 @@ func (c *FakeAdmissionregistrationV1) MutatingWebhookConfigurations() v1.Mutatin return &FakeMutatingWebhookConfigurations{c} } +func (c *FakeAdmissionregistrationV1) ValidatingAdmissionPolicies() v1.ValidatingAdmissionPolicyInterface { + return &FakeValidatingAdmissionPolicies{c} +} + +func (c *FakeAdmissionregistrationV1) ValidatingAdmissionPolicyBindings() v1.ValidatingAdmissionPolicyBindingInterface { + return &FakeValidatingAdmissionPolicyBindings{c} +} + func (c *FakeAdmissionregistrationV1) ValidatingWebhookConfigurations() v1.ValidatingWebhookConfigurationInterface { return &FakeValidatingWebhookConfigurations{c} } diff --git a/kubernetes/typed/admissionregistration/v1/fake/fake_validatingadmissionpolicy.go b/kubernetes/typed/admissionregistration/v1/fake/fake_validatingadmissionpolicy.go new file mode 100644 index 000000000..c947e6572 --- /dev/null +++ b/kubernetes/typed/admissionregistration/v1/fake/fake_validatingadmissionpolicy.go @@ -0,0 +1,178 @@ +/* +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" + + v1 "k8s.io/api/admissionregistration/v1" + metav1 "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" + admissionregistrationv1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1" + testing "k8s.io/client-go/testing" +) + +// FakeValidatingAdmissionPolicies implements ValidatingAdmissionPolicyInterface +type FakeValidatingAdmissionPolicies struct { + Fake *FakeAdmissionregistrationV1 +} + +var validatingadmissionpoliciesResource = v1.SchemeGroupVersion.WithResource("validatingadmissionpolicies") + +var validatingadmissionpoliciesKind = v1.SchemeGroupVersion.WithKind("ValidatingAdmissionPolicy") + +// 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) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(validatingadmissionpoliciesResource, name), &v1.ValidatingAdmissionPolicy{}) + if obj == nil { + return nil, 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) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(validatingadmissionpoliciesResource, validatingadmissionpoliciesKind, opts), &v1.ValidatingAdmissionPolicyList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1.ValidatingAdmissionPolicyList{ListMeta: obj.(*v1.ValidatingAdmissionPolicyList).ListMeta} + for _, item := range obj.(*v1.ValidatingAdmissionPolicyList).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 validatingAdmissionPolicies. +func (c *FakeValidatingAdmissionPolicies) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(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) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(validatingadmissionpoliciesResource, validatingAdmissionPolicy), &v1.ValidatingAdmissionPolicy{}) + if obj == nil { + return nil, 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) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(validatingadmissionpoliciesResource, validatingAdmissionPolicy), &v1.ValidatingAdmissionPolicy{}) + if obj == nil { + return nil, 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) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateSubresourceAction(validatingadmissionpoliciesResource, "status", validatingAdmissionPolicy), &v1.ValidatingAdmissionPolicy{}) + if obj == nil { + return nil, err + } + return obj.(*v1.ValidatingAdmissionPolicy), err +} + +// Delete takes name of the validatingAdmissionPolicy and deletes it. Returns an error if one occurs. +func (c *FakeValidatingAdmissionPolicies) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteActionWithOptions(validatingadmissionpoliciesResource, name, opts), &v1.ValidatingAdmissionPolicy{}) + return err +} + +// 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) + + _, err := c.Fake.Invokes(action, &v1.ValidatingAdmissionPolicyList{}) + return err +} + +// 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) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(validatingadmissionpoliciesResource, name, pt, data, subresources...), &v1.ValidatingAdmissionPolicy{}) + if obj == nil { + return nil, err + } + return obj.(*v1.ValidatingAdmissionPolicy), err +} + +// Apply takes the given apply declarative configuration, applies it and returns the applied validatingAdmissionPolicy. +func (c *FakeValidatingAdmissionPolicies) 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") + } + 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") + } + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(validatingadmissionpoliciesResource, *name, types.ApplyPatchType, data), &v1.ValidatingAdmissionPolicy{}) + if obj == nil { + return nil, err + } + return obj.(*v1.ValidatingAdmissionPolicy), 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 *FakeValidatingAdmissionPolicies) 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") + } + 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") + } + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(validatingadmissionpoliciesResource, *name, types.ApplyPatchType, data, "status"), &v1.ValidatingAdmissionPolicy{}) + if obj == nil { + return nil, 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 new file mode 100644 index 000000000..9ace73593 --- /dev/null +++ b/kubernetes/typed/admissionregistration/v1/fake/fake_validatingadmissionpolicybinding.go @@ -0,0 +1,145 @@ +/* +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" + + v1 "k8s.io/api/admissionregistration/v1" + metav1 "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" + admissionregistrationv1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1" + testing "k8s.io/client-go/testing" +) + +// FakeValidatingAdmissionPolicyBindings implements ValidatingAdmissionPolicyBindingInterface +type FakeValidatingAdmissionPolicyBindings struct { + Fake *FakeAdmissionregistrationV1 +} + +var validatingadmissionpolicybindingsResource = v1.SchemeGroupVersion.WithResource("validatingadmissionpolicybindings") + +var validatingadmissionpolicybindingsKind = v1.SchemeGroupVersion.WithKind("ValidatingAdmissionPolicyBinding") + +// 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) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(validatingadmissionpolicybindingsResource, name), &v1.ValidatingAdmissionPolicyBinding{}) + if obj == nil { + return nil, 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) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(validatingadmissionpolicybindingsResource, validatingadmissionpolicybindingsKind, opts), &v1.ValidatingAdmissionPolicyBindingList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1.ValidatingAdmissionPolicyBindingList{ListMeta: obj.(*v1.ValidatingAdmissionPolicyBindingList).ListMeta} + for _, item := range obj.(*v1.ValidatingAdmissionPolicyBindingList).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 validatingAdmissionPolicyBindings. +func (c *FakeValidatingAdmissionPolicyBindings) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(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) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(validatingadmissionpolicybindingsResource, validatingAdmissionPolicyBinding), &v1.ValidatingAdmissionPolicyBinding{}) + if obj == nil { + return nil, 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) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(validatingadmissionpolicybindingsResource, validatingAdmissionPolicyBinding), &v1.ValidatingAdmissionPolicyBinding{}) + if obj == nil { + return nil, err + } + return obj.(*v1.ValidatingAdmissionPolicyBinding), err +} + +// Delete takes name of the validatingAdmissionPolicyBinding and deletes it. Returns an error if one occurs. +func (c *FakeValidatingAdmissionPolicyBindings) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteActionWithOptions(validatingadmissionpolicybindingsResource, name, opts), &v1.ValidatingAdmissionPolicyBinding{}) + return err +} + +// 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) + + _, err := c.Fake.Invokes(action, &v1.ValidatingAdmissionPolicyBindingList{}) + return err +} + +// 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) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(validatingadmissionpolicybindingsResource, name, pt, data, subresources...), &v1.ValidatingAdmissionPolicyBinding{}) + if obj == nil { + return nil, err + } + return obj.(*v1.ValidatingAdmissionPolicyBinding), err +} + +// Apply takes the given apply declarative configuration, applies it and returns the applied validatingAdmissionPolicyBinding. +func (c *FakeValidatingAdmissionPolicyBindings) 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") + } + 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") + } + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(validatingadmissionpolicybindingsResource, *name, types.ApplyPatchType, data), &v1.ValidatingAdmissionPolicyBinding{}) + if obj == nil { + return nil, err + } + return obj.(*v1.ValidatingAdmissionPolicyBinding), err +} diff --git a/kubernetes/typed/admissionregistration/v1/generated_expansion.go b/kubernetes/typed/admissionregistration/v1/generated_expansion.go index a5b062e37..d81e1c87f 100644 --- a/kubernetes/typed/admissionregistration/v1/generated_expansion.go +++ b/kubernetes/typed/admissionregistration/v1/generated_expansion.go @@ -20,4 +20,8 @@ package v1 type MutatingWebhookConfigurationExpansion interface{} +type ValidatingAdmissionPolicyExpansion interface{} + +type ValidatingAdmissionPolicyBindingExpansion interface{} + type ValidatingWebhookConfigurationExpansion interface{} diff --git a/kubernetes/typed/admissionregistration/v1/validatingadmissionpolicy.go b/kubernetes/typed/admissionregistration/v1/validatingadmissionpolicy.go new file mode 100644 index 000000000..0b0b05acd --- /dev/null +++ b/kubernetes/typed/admissionregistration/v1/validatingadmissionpolicy.go @@ -0,0 +1,243 @@ +/* +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 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" + scheme "k8s.io/client-go/kubernetes/scheme" + rest "k8s.io/client-go/rest" +) + +// ValidatingAdmissionPoliciesGetter has a method to return a ValidatingAdmissionPolicyInterface. +// A group's client should implement this interface. +type ValidatingAdmissionPoliciesGetter interface { + ValidatingAdmissionPolicies() ValidatingAdmissionPolicyInterface +} + +// ValidatingAdmissionPolicyInterface has methods to work with ValidatingAdmissionPolicy resources. +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) + 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 + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ValidatingAdmissionPolicy, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ValidatingAdmissionPolicyList, error) + 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) + 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 +} + +// newValidatingAdmissionPolicies returns a ValidatingAdmissionPolicies +func newValidatingAdmissionPolicies(c *AdmissionregistrationV1Client) *validatingAdmissionPolicies { + return &validatingAdmissionPolicies{ + client: c.RESTClient(), + } +} + +// 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) (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 +} + +// 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 new file mode 100644 index 000000000..83a8ef163 --- /dev/null +++ b/kubernetes/typed/admissionregistration/v1/validatingadmissionpolicybinding.go @@ -0,0 +1,197 @@ +/* +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 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" + scheme "k8s.io/client-go/kubernetes/scheme" + rest "k8s.io/client-go/rest" +) + +// ValidatingAdmissionPolicyBindingsGetter has a method to return a ValidatingAdmissionPolicyBindingInterface. +// A group's client should implement this interface. +type ValidatingAdmissionPolicyBindingsGetter interface { + ValidatingAdmissionPolicyBindings() ValidatingAdmissionPolicyBindingInterface +} + +// ValidatingAdmissionPolicyBindingInterface has methods to work with ValidatingAdmissionPolicyBinding resources. +type ValidatingAdmissionPolicyBindingInterface interface { + Create(ctx context.Context, validatingAdmissionPolicyBinding *v1.ValidatingAdmissionPolicyBinding, opts metav1.CreateOptions) (*v1.ValidatingAdmissionPolicyBinding, error) + Update(ctx context.Context, validatingAdmissionPolicyBinding *v1.ValidatingAdmissionPolicyBinding, opts metav1.UpdateOptions) (*v1.ValidatingAdmissionPolicyBinding, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ValidatingAdmissionPolicyBinding, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ValidatingAdmissionPolicyBindingList, error) + 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.ValidatingAdmissionPolicyBinding, err error) + Apply(ctx context.Context, validatingAdmissionPolicyBinding *admissionregistrationv1.ValidatingAdmissionPolicyBindingApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ValidatingAdmissionPolicyBinding, err error) + ValidatingAdmissionPolicyBindingExpansion +} + +// validatingAdmissionPolicyBindings implements ValidatingAdmissionPolicyBindingInterface +type validatingAdmissionPolicyBindings struct { + client rest.Interface +} + +// newValidatingAdmissionPolicyBindings returns a ValidatingAdmissionPolicyBindings +func newValidatingAdmissionPolicyBindings(c *AdmissionregistrationV1Client) *validatingAdmissionPolicyBindings { + return &validatingAdmissionPolicyBindings{ + client: c.RESTClient(), + } +} + +// 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) (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 +} + +// 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/listers/admissionregistration/v1/expansion_generated.go b/listers/admissionregistration/v1/expansion_generated.go index e121ae41a..9002ad6ea 100644 --- a/listers/admissionregistration/v1/expansion_generated.go +++ b/listers/admissionregistration/v1/expansion_generated.go @@ -22,6 +22,14 @@ package v1 // MutatingWebhookConfigurationLister. type MutatingWebhookConfigurationListerExpansion interface{} +// ValidatingAdmissionPolicyListerExpansion allows custom methods to be added to +// ValidatingAdmissionPolicyLister. +type ValidatingAdmissionPolicyListerExpansion interface{} + +// ValidatingAdmissionPolicyBindingListerExpansion allows custom methods to be added to +// ValidatingAdmissionPolicyBindingLister. +type ValidatingAdmissionPolicyBindingListerExpansion interface{} + // ValidatingWebhookConfigurationListerExpansion allows custom methods to be added to // ValidatingWebhookConfigurationLister. type ValidatingWebhookConfigurationListerExpansion interface{} diff --git a/listers/admissionregistration/v1/validatingadmissionpolicy.go b/listers/admissionregistration/v1/validatingadmissionpolicy.go new file mode 100644 index 000000000..fff072f4c --- /dev/null +++ b/listers/admissionregistration/v1/validatingadmissionpolicy.go @@ -0,0 +1,68 @@ +/* +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 v1 + +import ( + v1 "k8s.io/api/admissionregistration/v1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ValidatingAdmissionPolicyLister helps list ValidatingAdmissionPolicies. +// All objects returned here must be treated as read-only. +type ValidatingAdmissionPolicyLister interface { + // List lists all ValidatingAdmissionPolicies in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.ValidatingAdmissionPolicy, err error) + // Get retrieves the ValidatingAdmissionPolicy from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.ValidatingAdmissionPolicy, error) + ValidatingAdmissionPolicyListerExpansion +} + +// validatingAdmissionPolicyLister implements the ValidatingAdmissionPolicyLister interface. +type validatingAdmissionPolicyLister struct { + indexer cache.Indexer +} + +// 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 +} diff --git a/listers/admissionregistration/v1/validatingadmissionpolicybinding.go b/listers/admissionregistration/v1/validatingadmissionpolicybinding.go new file mode 100644 index 000000000..07856981e --- /dev/null +++ b/listers/admissionregistration/v1/validatingadmissionpolicybinding.go @@ -0,0 +1,68 @@ +/* +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 v1 + +import ( + v1 "k8s.io/api/admissionregistration/v1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ValidatingAdmissionPolicyBindingLister helps list ValidatingAdmissionPolicyBindings. +// All objects returned here must be treated as read-only. +type ValidatingAdmissionPolicyBindingLister interface { + // List lists all ValidatingAdmissionPolicyBindings in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.ValidatingAdmissionPolicyBinding, err error) + // Get retrieves the ValidatingAdmissionPolicyBinding from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.ValidatingAdmissionPolicyBinding, error) + ValidatingAdmissionPolicyBindingListerExpansion +} + +// validatingAdmissionPolicyBindingLister implements the ValidatingAdmissionPolicyBindingLister interface. +type validatingAdmissionPolicyBindingLister struct { + indexer cache.Indexer +} + +// 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 +} From c3231901f2fe87979dc982079fad806ed474134f Mon Sep 17 00:00:00 2001 From: Patrick Ohly Date: Wed, 14 Feb 2024 14:38:42 +0100 Subject: [PATCH 054/239] dra api: add structured parameters NodeResourceSlice will be used by kubelet to publish resource information on behalf of DRA drivers on the node. NodeName and DriverName in NodeResourceSlice must be immutable. This simplifies tracking the different objects because what they are for cannot change after creation. The new field in ResourceClass tells scheduler and autoscaler that they are expected to handle allocation. ResourceClaimParameters and ResourceClassParameters are new types for telling in-tree components how to handle claims. Kubernetes-commit: 39bbcedbcae84bf716923b3f9464968ca70b42e7 --- applyconfigurations/internal/internal.go | 141 +++++++++ .../v1alpha2/driverallocationresult.go | 45 +++ .../resource/v1alpha2/driverrequests.go | 66 +++++ .../resource/v1alpha2/noderesourceslice.go | 257 ++++++++++++++++ .../v1alpha2/resourceclaimparameters.go | 272 +++++++++++++++++ .../resource/v1alpha2/resourceclass.go | 9 + .../v1alpha2/resourceclassparameters.go | 277 ++++++++++++++++++ .../resource/v1alpha2/resourcefilter.go | 44 +++ .../resource/v1alpha2/resourcehandle.go | 13 +- .../resource/v1alpha2/resourcerequest.go | 45 +++ .../v1alpha2/structuredresourcehandle.go | 75 +++++ .../resource/v1alpha2/vendorparameters.go | 52 ++++ applyconfigurations/utils.go | 18 ++ informers/generic.go | 6 + informers/resource/v1alpha2/interface.go | 21 ++ .../resource/v1alpha2/noderesourceslice.go | 89 ++++++ .../v1alpha2/resourceclaimparameters.go | 90 ++++++ .../v1alpha2/resourceclassparameters.go | 90 ++++++ .../v1alpha2/fake/fake_noderesourceslice.go | 145 +++++++++ .../v1alpha2/fake/fake_resource_client.go | 12 + .../fake/fake_resourceclaimparameters.go | 154 ++++++++++ .../fake/fake_resourceclassparameters.go | 154 ++++++++++ .../resource/v1alpha2/generated_expansion.go | 6 + .../resource/v1alpha2/noderesourceslice.go | 197 +++++++++++++ .../resource/v1alpha2/resource_client.go | 15 + .../v1alpha2/resourceclaimparameters.go | 208 +++++++++++++ .../v1alpha2/resourceclassparameters.go | 208 +++++++++++++ .../resource/v1alpha2/expansion_generated.go | 20 ++ .../resource/v1alpha2/noderesourceslice.go | 68 +++++ .../v1alpha2/resourceclaimparameters.go | 99 +++++++ .../v1alpha2/resourceclassparameters.go | 99 +++++++ 31 files changed, 2993 insertions(+), 2 deletions(-) create mode 100644 applyconfigurations/resource/v1alpha2/driverallocationresult.go create mode 100644 applyconfigurations/resource/v1alpha2/driverrequests.go create mode 100644 applyconfigurations/resource/v1alpha2/noderesourceslice.go create mode 100644 applyconfigurations/resource/v1alpha2/resourceclaimparameters.go create mode 100644 applyconfigurations/resource/v1alpha2/resourceclassparameters.go create mode 100644 applyconfigurations/resource/v1alpha2/resourcefilter.go create mode 100644 applyconfigurations/resource/v1alpha2/resourcerequest.go create mode 100644 applyconfigurations/resource/v1alpha2/structuredresourcehandle.go create mode 100644 applyconfigurations/resource/v1alpha2/vendorparameters.go create mode 100644 informers/resource/v1alpha2/noderesourceslice.go create mode 100644 informers/resource/v1alpha2/resourceclaimparameters.go create mode 100644 informers/resource/v1alpha2/resourceclassparameters.go create mode 100644 kubernetes/typed/resource/v1alpha2/fake/fake_noderesourceslice.go create mode 100644 kubernetes/typed/resource/v1alpha2/fake/fake_resourceclaimparameters.go create mode 100644 kubernetes/typed/resource/v1alpha2/fake/fake_resourceclassparameters.go create mode 100644 kubernetes/typed/resource/v1alpha2/noderesourceslice.go create mode 100644 kubernetes/typed/resource/v1alpha2/resourceclaimparameters.go create mode 100644 kubernetes/typed/resource/v1alpha2/resourceclassparameters.go create mode 100644 listers/resource/v1alpha2/noderesourceslice.go create mode 100644 listers/resource/v1alpha2/resourceclaimparameters.go create mode 100644 listers/resource/v1alpha2/resourceclassparameters.go diff --git a/applyconfigurations/internal/internal.go b/applyconfigurations/internal/internal.go index 58fef57d2..622628d2d 100644 --- a/applyconfigurations/internal/internal.go +++ b/applyconfigurations/internal/internal.go @@ -11966,6 +11966,48 @@ var schemaYAML = typed.YAMLObject(`types: - name: shareable type: scalar: boolean +- name: io.k8s.api.resource.v1alpha2.DriverAllocationResult + map: + fields: + - name: vendorRequestParameters + type: + namedType: __untyped_atomic_ +- name: io.k8s.api.resource.v1alpha2.DriverRequests + map: + fields: + - name: driverName + type: + scalar: string + - name: requests + type: + list: + elementType: + namedType: io.k8s.api.resource.v1alpha2.ResourceRequest + elementRelationship: atomic + - name: vendorParameters + type: + namedType: __untyped_atomic_ +- name: io.k8s.api.resource.v1alpha2.NodeResourceSlice + 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: nodeName + type: + scalar: string + default: "" - name: io.k8s.api.resource.v1alpha2.PodSchedulingContext map: fields: @@ -12049,6 +12091,31 @@ var schemaYAML = typed.YAMLObject(`types: type: scalar: string default: "" +- name: io.k8s.api.resource.v1alpha2.ResourceClaimParameters + map: + fields: + - name: apiVersion + type: + scalar: string + - name: driverRequests + type: + list: + elementType: + namedType: io.k8s.api.resource.v1alpha2.DriverRequests + elementRelationship: atomic + - name: generatedFrom + type: + namedType: io.k8s.api.resource.v1alpha2.ResourceClaimParametersReference + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: shareable + type: + scalar: boolean - name: io.k8s.api.resource.v1alpha2.ResourceClaimParametersReference map: fields: @@ -12156,9 +12223,40 @@ var schemaYAML = typed.YAMLObject(`types: - name: parametersRef type: namedType: io.k8s.api.resource.v1alpha2.ResourceClassParametersReference + - name: structuredParameters + type: + scalar: boolean - name: suitableNodes type: namedType: io.k8s.api.core.v1.NodeSelector +- name: io.k8s.api.resource.v1alpha2.ResourceClassParameters + map: + fields: + - name: apiVersion + type: + scalar: string + - name: filters + type: + list: + elementType: + namedType: io.k8s.api.resource.v1alpha2.ResourceFilter + elementRelationship: atomic + - name: generatedFrom + type: + namedType: io.k8s.api.resource.v1alpha2.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.v1alpha2.VendorParameters + elementRelationship: atomic - name: io.k8s.api.resource.v1alpha2.ResourceClassParametersReference map: fields: @@ -12176,6 +12274,12 @@ var schemaYAML = typed.YAMLObject(`types: - name: namespace type: scalar: string +- name: io.k8s.api.resource.v1alpha2.ResourceFilter + map: + fields: + - name: driverName + type: + scalar: string - name: io.k8s.api.resource.v1alpha2.ResourceHandle map: fields: @@ -12185,6 +12289,43 @@ var schemaYAML = typed.YAMLObject(`types: - name: driverName type: scalar: string + - name: structuredData + type: + namedType: io.k8s.api.resource.v1alpha2.StructuredResourceHandle +- name: io.k8s.api.resource.v1alpha2.ResourceRequest + map: + fields: + - name: vendorParameters + type: + namedType: __untyped_atomic_ +- name: io.k8s.api.resource.v1alpha2.StructuredResourceHandle + map: + fields: + - name: nodeName + type: + scalar: string + default: "" + - name: results + type: + list: + elementType: + namedType: io.k8s.api.resource.v1alpha2.DriverAllocationResult + elementRelationship: atomic + - name: vendorClaimParameters + type: + namedType: __untyped_atomic_ + - name: vendorClassParameters + type: + namedType: __untyped_atomic_ +- name: io.k8s.api.resource.v1alpha2.VendorParameters + map: + fields: + - name: driverName + type: + scalar: string + - name: parameters + type: + namedType: __untyped_atomic_ - name: io.k8s.api.scheduling.v1.PriorityClass map: fields: diff --git a/applyconfigurations/resource/v1alpha2/driverallocationresult.go b/applyconfigurations/resource/v1alpha2/driverallocationresult.go new file mode 100644 index 000000000..3b0403cca --- /dev/null +++ b/applyconfigurations/resource/v1alpha2/driverallocationresult.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 applyconfiguration-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + v1alpha2 "k8s.io/api/resource/v1alpha2" + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// DriverAllocationResultApplyConfiguration represents an declarative configuration of the DriverAllocationResult type for use +// with apply. +type DriverAllocationResultApplyConfiguration struct { + VendorRequestParameters *runtime.RawExtension `json:"vendorRequestParameters,omitempty"` + v1alpha2.AllocationResultModel `json:",inline"` +} + +// DriverAllocationResultApplyConfiguration constructs an 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 +} diff --git a/applyconfigurations/resource/v1alpha2/driverrequests.go b/applyconfigurations/resource/v1alpha2/driverrequests.go new file mode 100644 index 000000000..805291578 --- /dev/null +++ b/applyconfigurations/resource/v1alpha2/driverrequests.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 v1alpha2 + +import ( + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// DriverRequestsApplyConfiguration represents an 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 an 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/v1alpha2/noderesourceslice.go b/applyconfigurations/resource/v1alpha2/noderesourceslice.go new file mode 100644 index 000000000..a20245489 --- /dev/null +++ b/applyconfigurations/resource/v1alpha2/noderesourceslice.go @@ -0,0 +1,257 @@ +/* +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 v1alpha2 + +import ( + v1alpha2 "k8s.io/api/resource/v1alpha2" + 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" +) + +// NodeResourceSliceApplyConfiguration represents an declarative configuration of the NodeResourceSlice type for use +// with apply. +type NodeResourceSliceApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + NodeName *string `json:"nodeName,omitempty"` + DriverName *string `json:"driverName,omitempty"` + v1alpha2.NodeResourceModel `json:",inline"` +} + +// NodeResourceSlice constructs an declarative configuration of the NodeResourceSlice type for use with +// apply. +func NodeResourceSlice(name string) *NodeResourceSliceApplyConfiguration { + b := &NodeResourceSliceApplyConfiguration{} + b.WithName(name) + b.WithKind("NodeResourceSlice") + b.WithAPIVersion("resource.k8s.io/v1alpha2") + return b +} + +// ExtractNodeResourceSlice extracts the applied configuration owned by fieldManager from +// nodeResourceSlice. If no managedFields are found in nodeResourceSlice for fieldManager, a +// NodeResourceSliceApplyConfiguration 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. +// nodeResourceSlice must be a unmodified NodeResourceSlice API object that was retrieved from the Kubernetes API. +// ExtractNodeResourceSlice 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 ExtractNodeResourceSlice(nodeResourceSlice *v1alpha2.NodeResourceSlice, fieldManager string) (*NodeResourceSliceApplyConfiguration, error) { + return extractNodeResourceSlice(nodeResourceSlice, fieldManager, "") +} + +// ExtractNodeResourceSliceStatus is the same as ExtractNodeResourceSlice except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractNodeResourceSliceStatus(nodeResourceSlice *v1alpha2.NodeResourceSlice, fieldManager string) (*NodeResourceSliceApplyConfiguration, error) { + return extractNodeResourceSlice(nodeResourceSlice, fieldManager, "status") +} + +func extractNodeResourceSlice(nodeResourceSlice *v1alpha2.NodeResourceSlice, fieldManager string, subresource string) (*NodeResourceSliceApplyConfiguration, error) { + b := &NodeResourceSliceApplyConfiguration{} + err := managedfields.ExtractInto(nodeResourceSlice, internal.Parser().Type("io.k8s.api.resource.v1alpha2.NodeResourceSlice"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(nodeResourceSlice.Name) + + b.WithKind("NodeResourceSlice") + b.WithAPIVersion("resource.k8s.io/v1alpha2") + 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 *NodeResourceSliceApplyConfiguration) WithKind(value string) *NodeResourceSliceApplyConfiguration { + 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 *NodeResourceSliceApplyConfiguration) WithAPIVersion(value string) *NodeResourceSliceApplyConfiguration { + 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 *NodeResourceSliceApplyConfiguration) WithName(value string) *NodeResourceSliceApplyConfiguration { + 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 *NodeResourceSliceApplyConfiguration) WithGenerateName(value string) *NodeResourceSliceApplyConfiguration { + 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 *NodeResourceSliceApplyConfiguration) WithNamespace(value string) *NodeResourceSliceApplyConfiguration { + 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 *NodeResourceSliceApplyConfiguration) WithUID(value types.UID) *NodeResourceSliceApplyConfiguration { + 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 *NodeResourceSliceApplyConfiguration) WithResourceVersion(value string) *NodeResourceSliceApplyConfiguration { + 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 *NodeResourceSliceApplyConfiguration) WithGeneration(value int64) *NodeResourceSliceApplyConfiguration { + 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 *NodeResourceSliceApplyConfiguration) WithCreationTimestamp(value metav1.Time) *NodeResourceSliceApplyConfiguration { + 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 *NodeResourceSliceApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *NodeResourceSliceApplyConfiguration { + 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 *NodeResourceSliceApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *NodeResourceSliceApplyConfiguration { + 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 *NodeResourceSliceApplyConfiguration) WithLabels(entries map[string]string) *NodeResourceSliceApplyConfiguration { + 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 *NodeResourceSliceApplyConfiguration) WithAnnotations(entries map[string]string) *NodeResourceSliceApplyConfiguration { + 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 *NodeResourceSliceApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *NodeResourceSliceApplyConfiguration { + 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 *NodeResourceSliceApplyConfiguration) WithFinalizers(values ...string) *NodeResourceSliceApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *NodeResourceSliceApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// 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 *NodeResourceSliceApplyConfiguration) WithNodeName(value string) *NodeResourceSliceApplyConfiguration { + 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 *NodeResourceSliceApplyConfiguration) WithDriverName(value string) *NodeResourceSliceApplyConfiguration { + b.DriverName = &value + return b +} diff --git a/applyconfigurations/resource/v1alpha2/resourceclaimparameters.go b/applyconfigurations/resource/v1alpha2/resourceclaimparameters.go new file mode 100644 index 000000000..ea13570e3 --- /dev/null +++ b/applyconfigurations/resource/v1alpha2/resourceclaimparameters.go @@ -0,0 +1,272 @@ +/* +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 v1alpha2 + +import ( + resourcev1alpha2 "k8s.io/api/resource/v1alpha2" + 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" +) + +// ResourceClaimParametersApplyConfiguration represents an declarative configuration of the ResourceClaimParameters type for use +// with apply. +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"` +} + +// ResourceClaimParameters constructs an declarative configuration of the ResourceClaimParameters type for use with +// apply. +func ResourceClaimParameters(name, namespace string) *ResourceClaimParametersApplyConfiguration { + b := &ResourceClaimParametersApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("ResourceClaimParameters") + b.WithAPIVersion("resource.k8s.io/v1alpha2") + 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), +// 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. +// 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) { + 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) { + return extractResourceClaimParameters(resourceClaimParameters, fieldManager, "status") +} + +func extractResourceClaimParameters(resourceClaimParameters *resourcev1alpha2.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) + if err != nil { + return nil, err + } + b.WithName(resourceClaimParameters.Name) + b.WithNamespace(resourceClaimParameters.Namespace) + + b.WithKind("ResourceClaimParameters") + b.WithAPIVersion("resource.k8s.io/v1alpha2") + 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 *ResourceClaimParametersApplyConfiguration) WithKind(value string) *ResourceClaimParametersApplyConfiguration { + 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 *ResourceClaimParametersApplyConfiguration) WithAPIVersion(value string) *ResourceClaimParametersApplyConfiguration { + 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 *ResourceClaimParametersApplyConfiguration) WithName(value string) *ResourceClaimParametersApplyConfiguration { + 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 *ResourceClaimParametersApplyConfiguration) WithGenerateName(value string) *ResourceClaimParametersApplyConfiguration { + 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 *ResourceClaimParametersApplyConfiguration) WithNamespace(value string) *ResourceClaimParametersApplyConfiguration { + 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 *ResourceClaimParametersApplyConfiguration) WithUID(value types.UID) *ResourceClaimParametersApplyConfiguration { + 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 *ResourceClaimParametersApplyConfiguration) WithResourceVersion(value string) *ResourceClaimParametersApplyConfiguration { + 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 *ResourceClaimParametersApplyConfiguration) WithGeneration(value int64) *ResourceClaimParametersApplyConfiguration { + 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 *ResourceClaimParametersApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ResourceClaimParametersApplyConfiguration { + 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 *ResourceClaimParametersApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ResourceClaimParametersApplyConfiguration { + 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 *ResourceClaimParametersApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ResourceClaimParametersApplyConfiguration { + 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 *ResourceClaimParametersApplyConfiguration) WithLabels(entries map[string]string) *ResourceClaimParametersApplyConfiguration { + 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 *ResourceClaimParametersApplyConfiguration) WithAnnotations(entries map[string]string) *ResourceClaimParametersApplyConfiguration { + 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 *ResourceClaimParametersApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ResourceClaimParametersApplyConfiguration { + 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 *ResourceClaimParametersApplyConfiguration) WithFinalizers(values ...string) *ResourceClaimParametersApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *ResourceClaimParametersApplyConfiguration) 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 *ResourceClaimParametersApplyConfiguration) WithGeneratedFrom(value *ResourceClaimParametersReferenceApplyConfiguration) *ResourceClaimParametersApplyConfiguration { + b.GeneratedFrom = 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 *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. +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]) + } + return b +} diff --git a/applyconfigurations/resource/v1alpha2/resourceclass.go b/applyconfigurations/resource/v1alpha2/resourceclass.go index 724c9e88e..364fda9d0 100644 --- a/applyconfigurations/resource/v1alpha2/resourceclass.go +++ b/applyconfigurations/resource/v1alpha2/resourceclass.go @@ -36,6 +36,7 @@ type ResourceClassApplyConfiguration struct { DriverName *string `json:"driverName,omitempty"` ParametersRef *ResourceClassParametersReferenceApplyConfiguration `json:"parametersRef,omitempty"` SuitableNodes *corev1.NodeSelectorApplyConfiguration `json:"suitableNodes,omitempty"` + StructuredParameters *bool `json:"structuredParameters,omitempty"` } // ResourceClass constructs an declarative configuration of the ResourceClass type for use with @@ -264,3 +265,11 @@ func (b *ResourceClassApplyConfiguration) WithSuitableNodes(value *corev1.NodeSe 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 +} diff --git a/applyconfigurations/resource/v1alpha2/resourceclassparameters.go b/applyconfigurations/resource/v1alpha2/resourceclassparameters.go new file mode 100644 index 000000000..028d0d612 --- /dev/null +++ b/applyconfigurations/resource/v1alpha2/resourceclassparameters.go @@ -0,0 +1,277 @@ +/* +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 v1alpha2 + +import ( + resourcev1alpha2 "k8s.io/api/resource/v1alpha2" + 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 an 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 an 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/v1alpha2") + 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 *resourcev1alpha2.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) { + return extractResourceClassParameters(resourceClassParameters, fieldManager, "status") +} + +func extractResourceClassParameters(resourceClassParameters *resourcev1alpha2.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) + if err != nil { + return nil, err + } + b.WithName(resourceClassParameters.Name) + b.WithNamespace(resourceClassParameters.Namespace) + + b.WithKind("ResourceClassParameters") + b.WithAPIVersion("resource.k8s.io/v1alpha2") + 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 +} diff --git a/applyconfigurations/resource/v1alpha2/resourcefilter.go b/applyconfigurations/resource/v1alpha2/resourcefilter.go new file mode 100644 index 000000000..2fd4ef89f --- /dev/null +++ b/applyconfigurations/resource/v1alpha2/resourcefilter.go @@ -0,0 +1,44 @@ +/* +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 v1alpha2 + +import ( + v1alpha2 "k8s.io/api/resource/v1alpha2" +) + +// ResourceFilterApplyConfiguration represents an declarative configuration of the ResourceFilter type for use +// with apply. +type ResourceFilterApplyConfiguration struct { + DriverName *string `json:"driverName,omitempty"` + v1alpha2.ResourceFilterModel `json:",inline"` +} + +// ResourceFilterApplyConfiguration constructs an 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 +} diff --git a/applyconfigurations/resource/v1alpha2/resourcehandle.go b/applyconfigurations/resource/v1alpha2/resourcehandle.go index 028cbaa1a..b4f3da735 100644 --- a/applyconfigurations/resource/v1alpha2/resourcehandle.go +++ b/applyconfigurations/resource/v1alpha2/resourcehandle.go @@ -21,8 +21,9 @@ package v1alpha2 // ResourceHandleApplyConfiguration represents an declarative configuration of the ResourceHandle type for use // with apply. type ResourceHandleApplyConfiguration struct { - DriverName *string `json:"driverName,omitempty"` - Data *string `json:"data,omitempty"` + DriverName *string `json:"driverName,omitempty"` + Data *string `json:"data,omitempty"` + StructuredData *StructuredResourceHandleApplyConfiguration `json:"structuredData,omitempty"` } // ResourceHandleApplyConfiguration constructs an declarative configuration of the ResourceHandle type for use with @@ -46,3 +47,11 @@ func (b *ResourceHandleApplyConfiguration) WithData(value string) *ResourceHandl 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/v1alpha2/resourcerequest.go b/applyconfigurations/resource/v1alpha2/resourcerequest.go new file mode 100644 index 000000000..971eace5b --- /dev/null +++ b/applyconfigurations/resource/v1alpha2/resourcerequest.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 applyconfiguration-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + v1alpha2 "k8s.io/api/resource/v1alpha2" + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// ResourceRequestApplyConfiguration represents an declarative configuration of the ResourceRequest type for use +// with apply. +type ResourceRequestApplyConfiguration struct { + VendorParameters *runtime.RawExtension `json:"vendorParameters,omitempty"` + v1alpha2.ResourceRequestModel `json:",inline"` +} + +// ResourceRequestApplyConfiguration constructs an 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 +} diff --git a/applyconfigurations/resource/v1alpha2/structuredresourcehandle.go b/applyconfigurations/resource/v1alpha2/structuredresourcehandle.go new file mode 100644 index 000000000..e6efcbfef --- /dev/null +++ b/applyconfigurations/resource/v1alpha2/structuredresourcehandle.go @@ -0,0 +1,75 @@ +/* +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 v1alpha2 + +import ( + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// StructuredResourceHandleApplyConfiguration represents an 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 an 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/resource/v1alpha2/vendorparameters.go b/applyconfigurations/resource/v1alpha2/vendorparameters.go new file mode 100644 index 000000000..f7a8ff9ec --- /dev/null +++ b/applyconfigurations/resource/v1alpha2/vendorparameters.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 v1alpha2 + +import ( + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// VendorParametersApplyConfiguration represents an 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 +// apply. +func VendorParameters() *VendorParametersApplyConfiguration { + return &VendorParametersApplyConfiguration{} +} + +// 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 *VendorParametersApplyConfiguration) WithDriverName(value string) *VendorParametersApplyConfiguration { + b.DriverName = &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 { + b.Parameters = &value + return b +} diff --git a/applyconfigurations/utils.go b/applyconfigurations/utils.go index 2394bb1bd..59188c6ec 100644 --- a/applyconfigurations/utils.go +++ b/applyconfigurations/utils.go @@ -1527,6 +1527,12 @@ func ForKind(kind schema.GroupVersionKind) interface{} { // Group=resource.k8s.io, Version=v1alpha2 case v1alpha2.SchemeGroupVersion.WithKind("AllocationResult"): return &resourcev1alpha2.AllocationResultApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("DriverAllocationResult"): + return &resourcev1alpha2.DriverAllocationResultApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("DriverRequests"): + return &resourcev1alpha2.DriverRequestsApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("NodeResourceSlice"): + return &resourcev1alpha2.NodeResourceSliceApplyConfiguration{} case v1alpha2.SchemeGroupVersion.WithKind("PodSchedulingContext"): return &resourcev1alpha2.PodSchedulingContextApplyConfiguration{} case v1alpha2.SchemeGroupVersion.WithKind("PodSchedulingContextSpec"): @@ -1537,6 +1543,8 @@ func ForKind(kind schema.GroupVersionKind) interface{} { 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"): @@ -1551,10 +1559,20 @@ func ForKind(kind schema.GroupVersionKind) interface{} { 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("ResourceHandle"): return &resourcev1alpha2.ResourceHandleApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("ResourceRequest"): + return &resourcev1alpha2.ResourceRequestApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("StructuredResourceHandle"): + return &resourcev1alpha2.StructuredResourceHandleApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("VendorParameters"): + return &resourcev1alpha2.VendorParametersApplyConfiguration{} // Group=scheduling.k8s.io, Version=v1 case schedulingv1.SchemeGroupVersion.WithKind("PriorityClass"): diff --git a/informers/generic.go b/informers/generic.go index 1e76cefd1..37e928e8d 100644 --- a/informers/generic.go +++ b/informers/generic.go @@ -362,14 +362,20 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource return &genericInformer{resource: resource.GroupResource(), informer: f.Rbac().V1beta1().RoleBindings().Informer()}, nil // Group=resource.k8s.io, Version=v1alpha2 + case v1alpha2.SchemeGroupVersion.WithResource("noderesourceslices"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Resource().V1alpha2().NodeResourceSlices().Informer()}, nil 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 // Group=scheduling.k8s.io, Version=v1 case schedulingv1.SchemeGroupVersion.WithResource("priorityclasses"): diff --git a/informers/resource/v1alpha2/interface.go b/informers/resource/v1alpha2/interface.go index 23f817c62..29d4a7c66 100644 --- a/informers/resource/v1alpha2/interface.go +++ b/informers/resource/v1alpha2/interface.go @@ -24,14 +24,20 @@ import ( // Interface provides access to all the informers in this group version. type Interface interface { + // NodeResourceSlices returns a NodeResourceSliceInformer. + NodeResourceSlices() NodeResourceSliceInformer // 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 } type version struct { @@ -45,6 +51,11 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } +// NodeResourceSlices returns a NodeResourceSliceInformer. +func (v *version) NodeResourceSlices() NodeResourceSliceInformer { + return &nodeResourceSliceInformer{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} @@ -55,6 +66,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} @@ -64,3 +80,8 @@ func (v *version) ResourceClaimTemplates() ResourceClaimTemplateInformer { 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} +} diff --git a/informers/resource/v1alpha2/noderesourceslice.go b/informers/resource/v1alpha2/noderesourceslice.go new file mode 100644 index 000000000..e4e6197d1 --- /dev/null +++ b/informers/resource/v1alpha2/noderesourceslice.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 v1alpha2 + +import ( + "context" + time "time" + + resourcev1alpha2 "k8s.io/api/resource/v1alpha2" + 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" + cache "k8s.io/client-go/tools/cache" +) + +// NodeResourceSliceInformer provides access to a shared informer and lister for +// NodeResourceSlices. +type NodeResourceSliceInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1alpha2.NodeResourceSliceLister +} + +type nodeResourceSliceInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewNodeResourceSliceInformer constructs a new informer for NodeResourceSlice 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 NewNodeResourceSliceInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredNodeResourceSliceInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredNodeResourceSliceInformer constructs a new informer for NodeResourceSlice 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 NewFilteredNodeResourceSliceInformer(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.ResourceV1alpha2().NodeResourceSlices().List(context.TODO(), options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ResourceV1alpha2().NodeResourceSlices().Watch(context.TODO(), options) + }, + }, + &resourcev1alpha2.NodeResourceSlice{}, + resyncPeriod, + indexers, + ) +} + +func (f *nodeResourceSliceInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredNodeResourceSliceInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *nodeResourceSliceInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&resourcev1alpha2.NodeResourceSlice{}, f.defaultInformer) +} + +func (f *nodeResourceSliceInformer) Lister() v1alpha2.NodeResourceSliceLister { + return v1alpha2.NewNodeResourceSliceLister(f.Informer().GetIndexer()) +} diff --git a/informers/resource/v1alpha2/resourceclaimparameters.go b/informers/resource/v1alpha2/resourceclaimparameters.go new file mode 100644 index 000000000..3064ac9f5 --- /dev/null +++ b/informers/resource/v1alpha2/resourceclaimparameters.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 v1alpha2 + +import ( + "context" + time "time" + + resourcev1alpha2 "k8s.io/api/resource/v1alpha2" + 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" + 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() v1alpha2.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.ResourceV1alpha2().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) + }, + }, + &resourcev1alpha2.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(&resourcev1alpha2.ResourceClaimParameters{}, f.defaultInformer) +} + +func (f *resourceClaimParametersInformer) Lister() v1alpha2.ResourceClaimParametersLister { + return v1alpha2.NewResourceClaimParametersLister(f.Informer().GetIndexer()) +} diff --git a/informers/resource/v1alpha2/resourceclassparameters.go b/informers/resource/v1alpha2/resourceclassparameters.go new file mode 100644 index 000000000..71fbefe16 --- /dev/null +++ b/informers/resource/v1alpha2/resourceclassparameters.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 v1alpha2 + +import ( + "context" + time "time" + + resourcev1alpha2 "k8s.io/api/resource/v1alpha2" + 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" + 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() v1alpha2.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.ResourceV1alpha2().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) + }, + }, + &resourcev1alpha2.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(&resourcev1alpha2.ResourceClassParameters{}, f.defaultInformer) +} + +func (f *resourceClassParametersInformer) Lister() v1alpha2.ResourceClassParametersLister { + return v1alpha2.NewResourceClassParametersLister(f.Informer().GetIndexer()) +} diff --git a/kubernetes/typed/resource/v1alpha2/fake/fake_noderesourceslice.go b/kubernetes/typed/resource/v1alpha2/fake/fake_noderesourceslice.go new file mode 100644 index 000000000..13ec45b6f --- /dev/null +++ b/kubernetes/typed/resource/v1alpha2/fake/fake_noderesourceslice.go @@ -0,0 +1,145 @@ +/* +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" + + v1alpha2 "k8s.io/api/resource/v1alpha2" + 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" + testing "k8s.io/client-go/testing" +) + +// FakeNodeResourceSlices implements NodeResourceSliceInterface +type FakeNodeResourceSlices struct { + Fake *FakeResourceV1alpha2 +} + +var noderesourceslicesResource = v1alpha2.SchemeGroupVersion.WithResource("noderesourceslices") + +var noderesourceslicesKind = v1alpha2.SchemeGroupVersion.WithKind("NodeResourceSlice") + +// Get takes name of the nodeResourceSlice, and returns the corresponding nodeResourceSlice object, and an error if there is any. +func (c *FakeNodeResourceSlices) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.NodeResourceSlice, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(noderesourceslicesResource, name), &v1alpha2.NodeResourceSlice{}) + if obj == nil { + return nil, err + } + return obj.(*v1alpha2.NodeResourceSlice), err +} + +// List takes label and field selectors, and returns the list of NodeResourceSlices that match those selectors. +func (c *FakeNodeResourceSlices) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.NodeResourceSliceList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(noderesourceslicesResource, noderesourceslicesKind, opts), &v1alpha2.NodeResourceSliceList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1alpha2.NodeResourceSliceList{ListMeta: obj.(*v1alpha2.NodeResourceSliceList).ListMeta} + for _, item := range obj.(*v1alpha2.NodeResourceSliceList).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 nodeResourceSlices. +func (c *FakeNodeResourceSlices) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(noderesourceslicesResource, opts)) +} + +// Create takes the representation of a nodeResourceSlice and creates it. Returns the server's representation of the nodeResourceSlice, and an error, if there is any. +func (c *FakeNodeResourceSlices) Create(ctx context.Context, nodeResourceSlice *v1alpha2.NodeResourceSlice, opts v1.CreateOptions) (result *v1alpha2.NodeResourceSlice, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(noderesourceslicesResource, nodeResourceSlice), &v1alpha2.NodeResourceSlice{}) + if obj == nil { + return nil, err + } + return obj.(*v1alpha2.NodeResourceSlice), err +} + +// Update takes the representation of a nodeResourceSlice and updates it. Returns the server's representation of the nodeResourceSlice, and an error, if there is any. +func (c *FakeNodeResourceSlices) Update(ctx context.Context, nodeResourceSlice *v1alpha2.NodeResourceSlice, opts v1.UpdateOptions) (result *v1alpha2.NodeResourceSlice, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(noderesourceslicesResource, nodeResourceSlice), &v1alpha2.NodeResourceSlice{}) + if obj == nil { + return nil, err + } + return obj.(*v1alpha2.NodeResourceSlice), err +} + +// Delete takes name of the nodeResourceSlice and deletes it. Returns an error if one occurs. +func (c *FakeNodeResourceSlices) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteActionWithOptions(noderesourceslicesResource, name, opts), &v1alpha2.NodeResourceSlice{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeNodeResourceSlices) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(noderesourceslicesResource, listOpts) + + _, err := c.Fake.Invokes(action, &v1alpha2.NodeResourceSliceList{}) + return err +} + +// Patch applies the patch and returns the patched nodeResourceSlice. +func (c *FakeNodeResourceSlices) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.NodeResourceSlice, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(noderesourceslicesResource, name, pt, data, subresources...), &v1alpha2.NodeResourceSlice{}) + if obj == nil { + return nil, err + } + return obj.(*v1alpha2.NodeResourceSlice), err +} + +// Apply takes the given apply declarative configuration, applies it and returns the applied nodeResourceSlice. +func (c *FakeNodeResourceSlices) Apply(ctx context.Context, nodeResourceSlice *resourcev1alpha2.NodeResourceSliceApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.NodeResourceSlice, err error) { + if nodeResourceSlice == nil { + return nil, fmt.Errorf("nodeResourceSlice provided to Apply must not be nil") + } + data, err := json.Marshal(nodeResourceSlice) + if err != nil { + return nil, err + } + name := nodeResourceSlice.Name + if name == nil { + return nil, fmt.Errorf("nodeResourceSlice.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(noderesourceslicesResource, *name, types.ApplyPatchType, data), &v1alpha2.NodeResourceSlice{}) + if obj == nil { + return nil, err + } + return obj.(*v1alpha2.NodeResourceSlice), err +} diff --git a/kubernetes/typed/resource/v1alpha2/fake/fake_resource_client.go b/kubernetes/typed/resource/v1alpha2/fake/fake_resource_client.go index 205387732..c26af9ecd 100644 --- a/kubernetes/typed/resource/v1alpha2/fake/fake_resource_client.go +++ b/kubernetes/typed/resource/v1alpha2/fake/fake_resource_client.go @@ -28,6 +28,10 @@ type FakeResourceV1alpha2 struct { *testing.Fake } +func (c *FakeResourceV1alpha2) NodeResourceSlices() v1alpha2.NodeResourceSliceInterface { + return &FakeNodeResourceSlices{c} +} + func (c *FakeResourceV1alpha2) PodSchedulingContexts(namespace string) v1alpha2.PodSchedulingContextInterface { return &FakePodSchedulingContexts{c, namespace} } @@ -36,6 +40,10 @@ func (c *FakeResourceV1alpha2) ResourceClaims(namespace string) v1alpha2.Resourc return &FakeResourceClaims{c, namespace} } +func (c *FakeResourceV1alpha2) ResourceClaimParameters(namespace string) v1alpha2.ResourceClaimParametersInterface { + return &FakeResourceClaimParameters{c, namespace} +} + func (c *FakeResourceV1alpha2) ResourceClaimTemplates(namespace string) v1alpha2.ResourceClaimTemplateInterface { return &FakeResourceClaimTemplates{c, namespace} } @@ -44,6 +52,10 @@ func (c *FakeResourceV1alpha2) ResourceClasses() v1alpha2.ResourceClassInterface return &FakeResourceClasses{c} } +func (c *FakeResourceV1alpha2) ResourceClassParameters(namespace string) v1alpha2.ResourceClassParametersInterface { + return &FakeResourceClassParameters{c, namespace} +} + // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *FakeResourceV1alpha2) RESTClient() rest.Interface { diff --git a/kubernetes/typed/resource/v1alpha2/fake/fake_resourceclaimparameters.go b/kubernetes/typed/resource/v1alpha2/fake/fake_resourceclaimparameters.go new file mode 100644 index 000000000..da32b5cae --- /dev/null +++ b/kubernetes/typed/resource/v1alpha2/fake/fake_resourceclaimparameters.go @@ -0,0 +1,154 @@ +/* +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" + + v1alpha2 "k8s.io/api/resource/v1alpha2" + 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" + testing "k8s.io/client-go/testing" +) + +// FakeResourceClaimParameters implements ResourceClaimParametersInterface +type FakeResourceClaimParameters struct { + Fake *FakeResourceV1alpha2 + ns string +} + +var resourceclaimparametersResource = v1alpha2.SchemeGroupVersion.WithResource("resourceclaimparameters") + +var resourceclaimparametersKind = v1alpha2.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) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(resourceclaimparametersResource, c.ns, name), &v1alpha2.ResourceClaimParameters{}) + + if obj == nil { + return nil, 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) { + obj, err := c.Fake. + Invokes(testing.NewListAction(resourceclaimparametersResource, resourceclaimparametersKind, c.ns, opts), &v1alpha2.ResourceClaimParametersList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1alpha2.ResourceClaimParametersList{ListMeta: obj.(*v1alpha2.ResourceClaimParametersList).ListMeta} + for _, item := range obj.(*v1alpha2.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.NewWatchAction(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 *v1alpha2.ResourceClaimParameters, opts v1.CreateOptions) (result *v1alpha2.ResourceClaimParameters, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(resourceclaimparametersResource, c.ns, resourceClaimParameters), &v1alpha2.ResourceClaimParameters{}) + + if obj == nil { + return nil, 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) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(resourceclaimparametersResource, c.ns, resourceClaimParameters), &v1alpha2.ResourceClaimParameters{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha2.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{}) + + return err +} + +// 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) + + _, err := c.Fake.Invokes(action, &v1alpha2.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) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(resourceclaimparametersResource, c.ns, name, pt, data, subresources...), &v1alpha2.ResourceClaimParameters{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha2.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) { + 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") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(resourceclaimparametersResource, c.ns, *name, types.ApplyPatchType, data), &v1alpha2.ResourceClaimParameters{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha2.ResourceClaimParameters), err +} diff --git a/kubernetes/typed/resource/v1alpha2/fake/fake_resourceclassparameters.go b/kubernetes/typed/resource/v1alpha2/fake/fake_resourceclassparameters.go new file mode 100644 index 000000000..c11762963 --- /dev/null +++ b/kubernetes/typed/resource/v1alpha2/fake/fake_resourceclassparameters.go @@ -0,0 +1,154 @@ +/* +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" + + v1alpha2 "k8s.io/api/resource/v1alpha2" + 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" + testing "k8s.io/client-go/testing" +) + +// FakeResourceClassParameters implements ResourceClassParametersInterface +type FakeResourceClassParameters struct { + Fake *FakeResourceV1alpha2 + ns string +} + +var resourceclassparametersResource = v1alpha2.SchemeGroupVersion.WithResource("resourceclassparameters") + +var resourceclassparametersKind = v1alpha2.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) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(resourceclassparametersResource, c.ns, name), &v1alpha2.ResourceClassParameters{}) + + if obj == nil { + return nil, 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) { + obj, err := c.Fake. + Invokes(testing.NewListAction(resourceclassparametersResource, resourceclassparametersKind, c.ns, opts), &v1alpha2.ResourceClassParametersList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1alpha2.ResourceClassParametersList{ListMeta: obj.(*v1alpha2.ResourceClassParametersList).ListMeta} + for _, item := range obj.(*v1alpha2.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.NewWatchAction(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 *v1alpha2.ResourceClassParameters, opts v1.CreateOptions) (result *v1alpha2.ResourceClassParameters, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(resourceclassparametersResource, c.ns, resourceClassParameters), &v1alpha2.ResourceClassParameters{}) + + if obj == nil { + return nil, 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) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(resourceclassparametersResource, c.ns, resourceClassParameters), &v1alpha2.ResourceClassParameters{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha2.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{}) + + return err +} + +// 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) + + _, err := c.Fake.Invokes(action, &v1alpha2.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) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(resourceclassparametersResource, c.ns, name, pt, data, subresources...), &v1alpha2.ResourceClassParameters{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha2.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) { + 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") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(resourceclassparametersResource, c.ns, *name, types.ApplyPatchType, data), &v1alpha2.ResourceClassParameters{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha2.ResourceClassParameters), err +} diff --git a/kubernetes/typed/resource/v1alpha2/generated_expansion.go b/kubernetes/typed/resource/v1alpha2/generated_expansion.go index 2c02e9ce7..abb4d7004 100644 --- a/kubernetes/typed/resource/v1alpha2/generated_expansion.go +++ b/kubernetes/typed/resource/v1alpha2/generated_expansion.go @@ -18,10 +18,16 @@ limitations under the License. package v1alpha2 +type NodeResourceSliceExpansion interface{} + type PodSchedulingContextExpansion interface{} type ResourceClaimExpansion interface{} +type ResourceClaimParametersExpansion interface{} + type ResourceClaimTemplateExpansion interface{} type ResourceClassExpansion interface{} + +type ResourceClassParametersExpansion interface{} diff --git a/kubernetes/typed/resource/v1alpha2/noderesourceslice.go b/kubernetes/typed/resource/v1alpha2/noderesourceslice.go new file mode 100644 index 000000000..491f63e7c --- /dev/null +++ b/kubernetes/typed/resource/v1alpha2/noderesourceslice.go @@ -0,0 +1,197 @@ +/* +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 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" + scheme "k8s.io/client-go/kubernetes/scheme" + rest "k8s.io/client-go/rest" +) + +// NodeResourceSlicesGetter has a method to return a NodeResourceSliceInterface. +// A group's client should implement this interface. +type NodeResourceSlicesGetter interface { + NodeResourceSlices() NodeResourceSliceInterface +} + +// NodeResourceSliceInterface has methods to work with NodeResourceSlice resources. +type NodeResourceSliceInterface interface { + Create(ctx context.Context, nodeResourceSlice *v1alpha2.NodeResourceSlice, opts v1.CreateOptions) (*v1alpha2.NodeResourceSlice, error) + Update(ctx context.Context, nodeResourceSlice *v1alpha2.NodeResourceSlice, opts v1.UpdateOptions) (*v1alpha2.NodeResourceSlice, 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.NodeResourceSlice, error) + List(ctx context.Context, opts v1.ListOptions) (*v1alpha2.NodeResourceSliceList, 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.NodeResourceSlice, err error) + Apply(ctx context.Context, nodeResourceSlice *resourcev1alpha2.NodeResourceSliceApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.NodeResourceSlice, err error) + NodeResourceSliceExpansion +} + +// nodeResourceSlices implements NodeResourceSliceInterface +type nodeResourceSlices struct { + client rest.Interface +} + +// newNodeResourceSlices returns a NodeResourceSlices +func newNodeResourceSlices(c *ResourceV1alpha2Client) *nodeResourceSlices { + return &nodeResourceSlices{ + client: c.RESTClient(), + } +} + +// Get takes name of the nodeResourceSlice, and returns the corresponding nodeResourceSlice object, and an error if there is any. +func (c *nodeResourceSlices) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.NodeResourceSlice, err error) { + result = &v1alpha2.NodeResourceSlice{} + err = c.client.Get(). + Resource("noderesourceslices"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of NodeResourceSlices that match those selectors. +func (c *nodeResourceSlices) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.NodeResourceSliceList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1alpha2.NodeResourceSliceList{} + err = c.client.Get(). + Resource("noderesourceslices"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested nodeResourceSlices. +func (c *nodeResourceSlices) 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("noderesourceslices"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a nodeResourceSlice and creates it. Returns the server's representation of the nodeResourceSlice, and an error, if there is any. +func (c *nodeResourceSlices) Create(ctx context.Context, nodeResourceSlice *v1alpha2.NodeResourceSlice, opts v1.CreateOptions) (result *v1alpha2.NodeResourceSlice, err error) { + result = &v1alpha2.NodeResourceSlice{} + err = c.client.Post(). + Resource("noderesourceslices"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(nodeResourceSlice). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a nodeResourceSlice and updates it. Returns the server's representation of the nodeResourceSlice, and an error, if there is any. +func (c *nodeResourceSlices) Update(ctx context.Context, nodeResourceSlice *v1alpha2.NodeResourceSlice, opts v1.UpdateOptions) (result *v1alpha2.NodeResourceSlice, err error) { + result = &v1alpha2.NodeResourceSlice{} + err = c.client.Put(). + Resource("noderesourceslices"). + Name(nodeResourceSlice.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(nodeResourceSlice). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the nodeResourceSlice and deletes it. Returns an error if one occurs. +func (c *nodeResourceSlices) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Resource("noderesourceslices"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *nodeResourceSlices) 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("noderesourceslices"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched nodeResourceSlice. +func (c *nodeResourceSlices) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.NodeResourceSlice, err error) { + result = &v1alpha2.NodeResourceSlice{} + err = c.client.Patch(pt). + Resource("noderesourceslices"). + 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 nodeResourceSlice. +func (c *nodeResourceSlices) Apply(ctx context.Context, nodeResourceSlice *resourcev1alpha2.NodeResourceSliceApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.NodeResourceSlice, err error) { + if nodeResourceSlice == nil { + return nil, fmt.Errorf("nodeResourceSlice provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(nodeResourceSlice) + if err != nil { + return nil, err + } + name := nodeResourceSlice.Name + if name == nil { + return nil, fmt.Errorf("nodeResourceSlice.Name must be provided to Apply") + } + result = &v1alpha2.NodeResourceSlice{} + err = c.client.Patch(types.ApplyPatchType). + Resource("noderesourceslices"). + Name(*name). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/kubernetes/typed/resource/v1alpha2/resource_client.go b/kubernetes/typed/resource/v1alpha2/resource_client.go index d5795fd62..2a5c35855 100644 --- a/kubernetes/typed/resource/v1alpha2/resource_client.go +++ b/kubernetes/typed/resource/v1alpha2/resource_client.go @@ -28,10 +28,13 @@ import ( type ResourceV1alpha2Interface interface { RESTClient() rest.Interface + NodeResourceSlicesGetter PodSchedulingContextsGetter ResourceClaimsGetter + ResourceClaimParametersGetter ResourceClaimTemplatesGetter ResourceClassesGetter + ResourceClassParametersGetter } // ResourceV1alpha2Client is used to interact with features provided by the resource.k8s.io group. @@ -39,6 +42,10 @@ type ResourceV1alpha2Client struct { restClient rest.Interface } +func (c *ResourceV1alpha2Client) NodeResourceSlices() NodeResourceSliceInterface { + return newNodeResourceSlices(c) +} + func (c *ResourceV1alpha2Client) PodSchedulingContexts(namespace string) PodSchedulingContextInterface { return newPodSchedulingContexts(c, namespace) } @@ -47,6 +54,10 @@ func (c *ResourceV1alpha2Client) ResourceClaims(namespace string) ResourceClaimI return newResourceClaims(c, namespace) } +func (c *ResourceV1alpha2Client) ResourceClaimParameters(namespace string) ResourceClaimParametersInterface { + return newResourceClaimParameters(c, namespace) +} + func (c *ResourceV1alpha2Client) ResourceClaimTemplates(namespace string) ResourceClaimTemplateInterface { return newResourceClaimTemplates(c, namespace) } @@ -55,6 +66,10 @@ func (c *ResourceV1alpha2Client) ResourceClasses() ResourceClassInterface { return newResourceClasses(c) } +func (c *ResourceV1alpha2Client) ResourceClassParameters(namespace string) ResourceClassParametersInterface { + return newResourceClassParameters(c, namespace) +} + // NewForConfig creates a new ResourceV1alpha2Client for the given config. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). diff --git a/kubernetes/typed/resource/v1alpha2/resourceclaimparameters.go b/kubernetes/typed/resource/v1alpha2/resourceclaimparameters.go new file mode 100644 index 000000000..d08afcb61 --- /dev/null +++ b/kubernetes/typed/resource/v1alpha2/resourceclaimparameters.go @@ -0,0 +1,208 @@ +/* +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 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" + scheme "k8s.io/client-go/kubernetes/scheme" + rest "k8s.io/client-go/rest" +) + +// 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 *v1alpha2.ResourceClaimParameters, opts v1.CreateOptions) (*v1alpha2.ResourceClaimParameters, error) + Update(ctx context.Context, resourceClaimParameters *v1alpha2.ResourceClaimParameters, opts v1.UpdateOptions) (*v1alpha2.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) + 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) + ResourceClaimParametersExpansion +} + +// resourceClaimParameters implements ResourceClaimParametersInterface +type resourceClaimParameters struct { + client rest.Interface + ns string +} + +// newResourceClaimParameters returns a ResourceClaimParameters +func newResourceClaimParameters(c *ResourceV1alpha2Client, namespace string) *resourceClaimParameters { + return &resourceClaimParameters{ + client: c.RESTClient(), + ns: namespace, + } +} + +// 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) (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 +} + +// 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/resourceclassparameters.go b/kubernetes/typed/resource/v1alpha2/resourceclassparameters.go new file mode 100644 index 000000000..8ac9be078 --- /dev/null +++ b/kubernetes/typed/resource/v1alpha2/resourceclassparameters.go @@ -0,0 +1,208 @@ +/* +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 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" + scheme "k8s.io/client-go/kubernetes/scheme" + rest "k8s.io/client-go/rest" +) + +// 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 *v1alpha2.ResourceClassParameters, opts v1.CreateOptions) (*v1alpha2.ResourceClassParameters, error) + Update(ctx context.Context, resourceClassParameters *v1alpha2.ResourceClassParameters, opts v1.UpdateOptions) (*v1alpha2.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) + 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) + ResourceClassParametersExpansion +} + +// resourceClassParameters implements ResourceClassParametersInterface +type resourceClassParameters struct { + client rest.Interface + ns string +} + +// newResourceClassParameters returns a ResourceClassParameters +func newResourceClassParameters(c *ResourceV1alpha2Client, namespace string) *resourceClassParameters { + return &resourceClassParameters{ + client: c.RESTClient(), + ns: namespace, + } +} + +// 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) (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 +} + +// 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/listers/resource/v1alpha2/expansion_generated.go b/listers/resource/v1alpha2/expansion_generated.go index 3b16e4429..dd8a21755 100644 --- a/listers/resource/v1alpha2/expansion_generated.go +++ b/listers/resource/v1alpha2/expansion_generated.go @@ -18,6 +18,10 @@ limitations under the License. package v1alpha2 +// NodeResourceSliceListerExpansion allows custom methods to be added to +// NodeResourceSliceLister. +type NodeResourceSliceListerExpansion interface{} + // PodSchedulingContextListerExpansion allows custom methods to be added to // PodSchedulingContextLister. type PodSchedulingContextListerExpansion interface{} @@ -34,6 +38,14 @@ 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{} @@ -45,3 +57,11 @@ 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{} diff --git a/listers/resource/v1alpha2/noderesourceslice.go b/listers/resource/v1alpha2/noderesourceslice.go new file mode 100644 index 000000000..f5853499a --- /dev/null +++ b/listers/resource/v1alpha2/noderesourceslice.go @@ -0,0 +1,68 @@ +/* +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 v1alpha2 + +import ( + v1alpha2 "k8s.io/api/resource/v1alpha2" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// NodeResourceSliceLister helps list NodeResourceSlices. +// All objects returned here must be treated as read-only. +type NodeResourceSliceLister interface { + // List lists all NodeResourceSlices in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1alpha2.NodeResourceSlice, err error) + // Get retrieves the NodeResourceSlice from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1alpha2.NodeResourceSlice, error) + NodeResourceSliceListerExpansion +} + +// nodeResourceSliceLister implements the NodeResourceSliceLister interface. +type nodeResourceSliceLister struct { + indexer cache.Indexer +} + +// NewNodeResourceSliceLister returns a new NodeResourceSliceLister. +func NewNodeResourceSliceLister(indexer cache.Indexer) NodeResourceSliceLister { + return &nodeResourceSliceLister{indexer: indexer} +} + +// List lists all NodeResourceSlices in the indexer. +func (s *nodeResourceSliceLister) List(selector labels.Selector) (ret []*v1alpha2.NodeResourceSlice, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1alpha2.NodeResourceSlice)) + }) + return ret, err +} + +// Get retrieves the NodeResourceSlice from the index for a given name. +func (s *nodeResourceSliceLister) Get(name string) (*v1alpha2.NodeResourceSlice, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1alpha2.Resource("noderesourceslice"), name) + } + return obj.(*v1alpha2.NodeResourceSlice), nil +} diff --git a/listers/resource/v1alpha2/resourceclaimparameters.go b/listers/resource/v1alpha2/resourceclaimparameters.go new file mode 100644 index 000000000..1a561ef7a --- /dev/null +++ b/listers/resource/v1alpha2/resourceclaimparameters.go @@ -0,0 +1,99 @@ +/* +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 v1alpha2 + +import ( + v1alpha2 "k8s.io/api/resource/v1alpha2" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "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 []*v1alpha2.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 { + indexer cache.Indexer +} + +// 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 +} + +// ResourceClaimParameters returns an object that can list and get ResourceClaimParameters. +func (s *resourceClaimParametersLister) ResourceClaimParameters(namespace string) ResourceClaimParametersNamespaceLister { + return resourceClaimParametersNamespaceLister{indexer: s.indexer, namespace: 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 []*v1alpha2.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) + ResourceClaimParametersNamespaceListerExpansion +} + +// 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 +} diff --git a/listers/resource/v1alpha2/resourceclassparameters.go b/listers/resource/v1alpha2/resourceclassparameters.go new file mode 100644 index 000000000..26fb95e6d --- /dev/null +++ b/listers/resource/v1alpha2/resourceclassparameters.go @@ -0,0 +1,99 @@ +/* +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 v1alpha2 + +import ( + v1alpha2 "k8s.io/api/resource/v1alpha2" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "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 []*v1alpha2.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 { + indexer cache.Indexer +} + +// 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 +} + +// ResourceClassParameters returns an object that can list and get ResourceClassParameters. +func (s *resourceClassParametersLister) ResourceClassParameters(namespace string) ResourceClassParametersNamespaceLister { + return resourceClassParametersNamespaceLister{indexer: s.indexer, namespace: 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 []*v1alpha2.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) + ResourceClassParametersNamespaceListerExpansion +} + +// 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 +} From db79dcf23b6dda9c2713d69493da75b7a947cd2a Mon Sep 17 00:00:00 2001 From: Tim Allclair Date: Tue, 20 Feb 2024 20:04:35 -0800 Subject: [PATCH 055/239] Generated code Kubernetes-commit: b7f620c12b7f2dbd7907ccad1ca63811a5c5766b --- .../core/v1/apparmorprofile.go | 52 +++++++++++++++++++ .../core/v1/podsecuritycontext.go | 9 ++++ .../core/v1/securitycontext.go | 9 ++++ applyconfigurations/internal/internal.go | 21 ++++++++ applyconfigurations/utils.go | 2 + 5 files changed, 93 insertions(+) create mode 100644 applyconfigurations/core/v1/apparmorprofile.go diff --git a/applyconfigurations/core/v1/apparmorprofile.go b/applyconfigurations/core/v1/apparmorprofile.go new file mode 100644 index 000000000..7f3c22afa --- /dev/null +++ b/applyconfigurations/core/v1/apparmorprofile.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" +) + +// AppArmorProfileApplyConfiguration represents an 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 +// apply. +func AppArmorProfile() *AppArmorProfileApplyConfiguration { + return &AppArmorProfileApplyConfiguration{} +} + +// WithType sets the Type field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Type field is set to the value of the last call. +func (b *AppArmorProfileApplyConfiguration) WithType(value v1.AppArmorProfileType) *AppArmorProfileApplyConfiguration { + b.Type = &value + return b +} + +// WithLocalhostProfile sets the LocalhostProfile field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LocalhostProfile field is set to the value of the last call. +func (b *AppArmorProfileApplyConfiguration) WithLocalhostProfile(value string) *AppArmorProfileApplyConfiguration { + b.LocalhostProfile = &value + return b +} diff --git a/applyconfigurations/core/v1/podsecuritycontext.go b/applyconfigurations/core/v1/podsecuritycontext.go index 6db09aa32..6b340294e 100644 --- a/applyconfigurations/core/v1/podsecuritycontext.go +++ b/applyconfigurations/core/v1/podsecuritycontext.go @@ -35,6 +35,7 @@ type PodSecurityContextApplyConfiguration struct { 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 @@ -129,3 +130,11 @@ func (b *PodSecurityContextApplyConfiguration) WithSeccompProfile(value *Seccomp b.SeccompProfile = value return b } + +// WithAppArmorProfile sets the AppArmorProfile field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AppArmorProfile field is set to the value of the last call. +func (b *PodSecurityContextApplyConfiguration) WithAppArmorProfile(value *AppArmorProfileApplyConfiguration) *PodSecurityContextApplyConfiguration { + b.AppArmorProfile = value + return b +} diff --git a/applyconfigurations/core/v1/securitycontext.go b/applyconfigurations/core/v1/securitycontext.go index 8f01537eb..4146b765d 100644 --- a/applyconfigurations/core/v1/securitycontext.go +++ b/applyconfigurations/core/v1/securitycontext.go @@ -36,6 +36,7 @@ type SecurityContextApplyConfiguration struct { AllowPrivilegeEscalation *bool `json:"allowPrivilegeEscalation,omitempty"` ProcMount *corev1.ProcMountType `json:"procMount,omitempty"` SeccompProfile *SeccompProfileApplyConfiguration `json:"seccompProfile,omitempty"` + AppArmorProfile *AppArmorProfileApplyConfiguration `json:"appArmorProfile,omitempty"` } // SecurityContextApplyConfiguration constructs an declarative configuration of the SecurityContext type for use with @@ -131,3 +132,11 @@ func (b *SecurityContextApplyConfiguration) WithSeccompProfile(value *SeccompPro b.SeccompProfile = value return b } + +// WithAppArmorProfile sets the AppArmorProfile field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AppArmorProfile field is set to the value of the last call. +func (b *SecurityContextApplyConfiguration) WithAppArmorProfile(value *AppArmorProfileApplyConfiguration) *SecurityContextApplyConfiguration { + b.AppArmorProfile = value + return b +} diff --git a/applyconfigurations/internal/internal.go b/applyconfigurations/internal/internal.go index a22406d3e..d1946cfb1 100644 --- a/applyconfigurations/internal/internal.go +++ b/applyconfigurations/internal/internal.go @@ -4401,6 +4401,21 @@ var schemaYAML = typed.YAMLObject(`types: - name: podAntiAffinity type: namedType: io.k8s.api.core.v1.PodAntiAffinity +- name: io.k8s.api.core.v1.AppArmorProfile + map: + fields: + - name: localhostProfile + type: + scalar: string + - name: type + type: + scalar: string + default: "" + unions: + - discriminator: type + fields: + - fieldName: localhostProfile + discriminatorValue: LocalhostProfile - name: io.k8s.api.core.v1.AttachedVolume map: fields: @@ -6720,6 +6735,9 @@ var schemaYAML = typed.YAMLObject(`types: - name: io.k8s.api.core.v1.PodSecurityContext map: fields: + - name: appArmorProfile + type: + namedType: io.k8s.api.core.v1.AppArmorProfile - name: fsGroup type: scalar: numeric @@ -7614,6 +7632,9 @@ var schemaYAML = typed.YAMLObject(`types: - name: allowPrivilegeEscalation type: scalar: boolean + - name: appArmorProfile + type: + namedType: io.k8s.api.core.v1.AppArmorProfile - name: capabilities type: namedType: io.k8s.api.core.v1.Capabilities diff --git a/applyconfigurations/utils.go b/applyconfigurations/utils.go index d3ec5e7df..346776974 100644 --- a/applyconfigurations/utils.go +++ b/applyconfigurations/utils.go @@ -613,6 +613,8 @@ func ForKind(kind schema.GroupVersionKind) interface{} { // Group=core, Version=v1 case corev1.SchemeGroupVersion.WithKind("Affinity"): return &applyconfigurationscorev1.AffinityApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("AppArmorProfile"): + return &applyconfigurationscorev1.AppArmorProfileApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("AttachedVolume"): return &applyconfigurationscorev1.AttachedVolumeApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("AWSElasticBlockStoreVolumeSource"): From 0b7086f721834bc32ab16ad0c7ac12e13b02a9c7 Mon Sep 17 00:00:00 2001 From: Erik Godding Boye Date: Sat, 24 Feb 2024 15:44:21 +0100 Subject: [PATCH 056/239] feat: add csaupgrade option to upgrade subresource Kubernetes-commit: 9633e25579dfa5449450875b9a238acc7cfac3e8 --- util/csaupgrade/options.go | 30 ++++++ util/csaupgrade/upgrade.go | 33 +++++-- util/csaupgrade/upgrade_test.go | 161 +++++++++++++++++++++++++++++++- 3 files changed, 213 insertions(+), 11 deletions(-) create mode 100644 util/csaupgrade/options.go diff --git a/util/csaupgrade/options.go b/util/csaupgrade/options.go new file mode 100644 index 000000000..490b92753 --- /dev/null +++ b/util/csaupgrade/options.go @@ -0,0 +1,30 @@ +/* +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 csaupgrade + +type Option func(*options) + +// Subresource set the subresource to upgrade from CSA to SSA. +func Subresource(s string) Option { + return func(opts *options) { + opts.subresource = s + } +} + +type options struct { + subresource string +} diff --git a/util/csaupgrade/upgrade.go b/util/csaupgrade/upgrade.go index aad135782..554e601e4 100644 --- a/util/csaupgrade/upgrade.go +++ b/util/csaupgrade/upgrade.go @@ -82,7 +82,13 @@ func UpgradeManagedFields( obj runtime.Object, csaManagerNames sets.Set[string], ssaManagerName string, + opts ...Option, ) error { + o := options{} + for _, opt := range opts { + opt(&o) + } + accessor, err := meta.Accessor(obj) if err != nil { return err @@ -92,7 +98,7 @@ func UpgradeManagedFields( for csaManagerName := range csaManagerNames { filteredManagers, err = upgradedManagedFields( - filteredManagers, csaManagerName, ssaManagerName) + filteredManagers, csaManagerName, ssaManagerName, o) if err != nil { return err @@ -116,7 +122,14 @@ func UpgradeManagedFields( func UpgradeManagedFieldsPatch( obj runtime.Object, csaManagerNames sets.Set[string], - ssaManagerName string) ([]byte, error) { + ssaManagerName string, + opts ...Option, +) ([]byte, error) { + o := options{} + for _, opt := range opts { + opt(&o) + } + accessor, err := meta.Accessor(obj) if err != nil { return nil, err @@ -126,7 +139,7 @@ func UpgradeManagedFieldsPatch( filteredManagers := accessor.GetManagedFields() for csaManagerName := range csaManagerNames { filteredManagers, err = upgradedManagedFields( - filteredManagers, csaManagerName, ssaManagerName) + filteredManagers, csaManagerName, ssaManagerName, o) if err != nil { return nil, err } @@ -166,6 +179,7 @@ func upgradedManagedFields( managedFields []metav1.ManagedFieldsEntry, csaManagerName string, ssaManagerName string, + opts options, ) ([]metav1.ManagedFieldsEntry, error) { if managedFields == nil { return nil, nil @@ -183,7 +197,7 @@ func upgradedManagedFields( func(entry metav1.ManagedFieldsEntry) bool { return entry.Manager == ssaManagerName && entry.Operation == metav1.ManagedFieldsOperationApply && - entry.Subresource == "" + entry.Subresource == opts.subresource }) if !managerExists { @@ -196,7 +210,7 @@ func upgradedManagedFields( func(entry metav1.ManagedFieldsEntry) bool { return entry.Manager == csaManagerName && entry.Operation == metav1.ManagedFieldsOperationUpdate && - entry.Subresource == "" + entry.Subresource == opts.subresource }) if !managerExists { @@ -209,7 +223,7 @@ func upgradedManagedFields( managedFields[replaceIndex].Operation = metav1.ManagedFieldsOperationApply managedFields[replaceIndex].Manager = ssaManagerName } - err := unionManagerIntoIndex(managedFields, replaceIndex, csaManagerName) + err := unionManagerIntoIndex(managedFields, replaceIndex, csaManagerName, opts) if err != nil { return nil, err } @@ -218,7 +232,7 @@ func upgradedManagedFields( filteredManagers := filter(managedFields, func(entry metav1.ManagedFieldsEntry) bool { return !(entry.Manager == csaManagerName && entry.Operation == metav1.ManagedFieldsOperationUpdate && - entry.Subresource == "") + entry.Subresource == opts.subresource) }) return filteredManagers, nil @@ -231,6 +245,7 @@ func unionManagerIntoIndex( entries []metav1.ManagedFieldsEntry, targetIndex int, csaManagerName string, + opts options, ) error { ssaManager := entries[targetIndex] @@ -240,9 +255,7 @@ func unionManagerIntoIndex( func(entry metav1.ManagedFieldsEntry) bool { return entry.Manager == csaManagerName && entry.Operation == metav1.ManagedFieldsOperationUpdate && - //!TODO: some users may want to migrate subresources. - // should thread through the args at some point. - entry.Subresource == "" && + entry.Subresource == opts.subresource && entry.APIVersion == ssaManager.APIVersion }) diff --git a/util/csaupgrade/upgrade_test.go b/util/csaupgrade/upgrade_test.go index c3be1d785..33c668349 100644 --- a/util/csaupgrade/upgrade_test.go +++ b/util/csaupgrade/upgrade_test.go @@ -294,6 +294,7 @@ func TestUpgradeCSA(t *testing.T) { Name string CSAManagers []string SSAManager string + Options []csaupgrade.Option OriginalObject []byte ExpectedObject []byte }{ @@ -1079,6 +1080,163 @@ metadata: time: "2022-11-03T23:22:40Z" name: test namespace: default +`), + }, + { + // Expect multiple targets to be merged into a new ssa manager + Name: "subresource", + CSAManagers: []string{"kube-controller-manager"}, + SSAManager: "kube-controller-manager", + Options: []csaupgrade.Option{csaupgrade.Subresource("status")}, + OriginalObject: []byte(` +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + annotations: + pv.kubernetes.io/bind-completed: "yes" + pv.kubernetes.io/bound-by-controller: "yes" + volume.beta.kubernetes.io/storage-provisioner: openshift-storage.cephfs.csi.ceph.com + volume.kubernetes.io/storage-provisioner: openshift-storage.cephfs.csi.ceph.com + creationTimestamp: "2024-02-24T15:24:31Z" + finalizers: + - kubernetes.io/pvc-protection + managedFields: + - apiVersion: v1 + fieldsType: FieldsV1 + fieldsV1: + f:spec: + f:accessModes: {} + f:resources: + f:requests: + .: {} + f:storage: {} + f:storageClassName: {} + f:volumeMode: {} + manager: Mozilla + operation: Update + time: "2024-02-24T15:24:31Z" + - apiVersion: v1 + fieldsType: FieldsV1 + fieldsV1: + f:metadata: + f:annotations: + .: {} + f:pv.kubernetes.io/bind-completed: {} + f:pv.kubernetes.io/bound-by-controller: {} + f:volume.beta.kubernetes.io/storage-provisioner: {} + f:volume.kubernetes.io/storage-provisioner: {} + f:spec: + f:volumeName: {} + manager: kube-controller-manager + operation: Update + time: "2024-02-24T15:24:32Z" + - apiVersion: v1 + fieldsType: FieldsV1 + fieldsV1: + f:status: + f:accessModes: {} + f:capacity: + .: {} + f:storage: {} + f:phase: {} + manager: kube-controller-manager + operation: Update + subresource: status + time: "2024-02-24T15:24:32Z" + name: test + namespace: default + resourceVersion: "948647140" + uid: f0692a61-0ffe-4fd5-b00f-0b95f3654fb9 +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 1Gi + storageClassName: ocs-storagecluster-cephfs + volumeMode: Filesystem + volumeName: pvc-f0692a61-0ffe-4fd5-b00f-0b95f3654fb9 +status: + accessModes: + - ReadWriteOnce + capacity: + storage: 1Gi + phase: Bound +`), + ExpectedObject: []byte(` +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + annotations: + pv.kubernetes.io/bind-completed: "yes" + pv.kubernetes.io/bound-by-controller: "yes" + volume.beta.kubernetes.io/storage-provisioner: openshift-storage.cephfs.csi.ceph.com + volume.kubernetes.io/storage-provisioner: openshift-storage.cephfs.csi.ceph.com + creationTimestamp: "2024-02-24T15:24:31Z" + finalizers: + - kubernetes.io/pvc-protection + managedFields: + - apiVersion: v1 + fieldsType: FieldsV1 + fieldsV1: + f:spec: + f:accessModes: {} + f:resources: + f:requests: + .: {} + f:storage: {} + f:storageClassName: {} + f:volumeMode: {} + manager: Mozilla + operation: Update + time: "2024-02-24T15:24:31Z" + - apiVersion: v1 + fieldsType: FieldsV1 + fieldsV1: + f:metadata: + f:annotations: + .: {} + f:pv.kubernetes.io/bind-completed: {} + f:pv.kubernetes.io/bound-by-controller: {} + f:volume.beta.kubernetes.io/storage-provisioner: {} + f:volume.kubernetes.io/storage-provisioner: {} + f:spec: + f:volumeName: {} + manager: kube-controller-manager + operation: Update + time: "2024-02-24T15:24:32Z" + - apiVersion: v1 + fieldsType: FieldsV1 + fieldsV1: + f:status: + f:accessModes: {} + f:capacity: + .: {} + f:storage: {} + f:phase: {} + manager: kube-controller-manager + operation: Apply + subresource: status + time: "2024-02-24T15:24:32Z" + name: test + namespace: default + resourceVersion: "948647140" + uid: f0692a61-0ffe-4fd5-b00f-0b95f3654fb9 +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 1Gi + storageClassName: ocs-storagecluster-cephfs + volumeMode: Filesystem + volumeName: pvc-f0692a61-0ffe-4fd5-b00f-0b95f3654fb9 +status: + accessModes: + - ReadWriteOnce + capacity: + storage: 1Gi + phase: Bound `), }, } @@ -1096,6 +1254,7 @@ metadata: upgraded, sets.New(testCase.CSAManagers...), testCase.SSAManager, + testCase.Options..., ) if err != nil { @@ -1118,7 +1277,7 @@ metadata: initialCopy := initialObject.DeepCopyObject() patchBytes, err := csaupgrade.UpgradeManagedFieldsPatch( - initialCopy, sets.New(testCase.CSAManagers...), testCase.SSAManager) + initialCopy, sets.New(testCase.CSAManagers...), testCase.SSAManager, testCase.Options...) if err != nil { t.Fatal(err) From d48adf87e6e26a307ddeaf25fb51552b082b6c8f Mon Sep 17 00:00:00 2001 From: Kubernetes Publisher Date: Fri, 1 Mar 2024 14:41:02 -0800 Subject: [PATCH 057/239] Merge pull request #122882 from Jefftree/agg-discovery-v2-usage Use Aggregated Discovery v2 types and promote to GA Kubernetes-commit: 3f25211d69b4412e3e926835067918f86f629f3e From f759d2e9764cf6b7d87fea3b63df8d1233c84890 Mon Sep 17 00:00:00 2001 From: Sean Sullivan Date: Fri, 1 Mar 2024 18:16:44 -0800 Subject: [PATCH 058/239] increases client-side websocket write deadline to 30 seconds Kubernetes-commit: 1d4be7527f8b2d2c4eb6dcc7ef58b4c3133f6f19 --- tools/remotecommand/websocket.go | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/tools/remotecommand/websocket.go b/tools/remotecommand/websocket.go index 49ef4717c..e6e893a10 100644 --- a/tools/remotecommand/websocket.go +++ b/tools/remotecommand/websocket.go @@ -36,13 +36,9 @@ import ( "k8s.io/klog/v2" ) -// writeDeadline defines the time that a write to the websocket connection -// must complete by, otherwise an i/o timeout occurs. The writeDeadline -// has nothing to do with a response from the other websocket connection -// endpoint; only that the message was successfully processed by the -// local websocket connection. The typical write deadline within the websocket -// library is one second. -const writeDeadline = 2 * time.Second +// writeDeadline defines the time that a client-side write to the websocket +// connection must complete before an i/o timeout occurs. +const writeDeadline = 30 * time.Second var ( _ Executor = &wsStreamExecutor{} @@ -65,8 +61,8 @@ const ( // "pong" message before a timeout error occurs for websocket reading. // This duration must always be greater than the "pingPeriod". By defining // this deadline in terms of the ping period, we are essentially saying - // we can drop "X-1" (e.g. 3-1=2) pings before firing the timeout. - pingReadDeadline = (pingPeriod * 3) + (1 * time.Second) + // we can drop "X-1" (e.g. 6-1=5) pings before firing the timeout. + pingReadDeadline = (pingPeriod * 6) + (1 * time.Second) ) // wsStreamExecutor handles transporting standard shell streams over an httpstream connection. @@ -497,7 +493,7 @@ func (h *heartbeat) start() { // "WriteControl" does not need to be protected by a mutex. According to // gorilla/websockets library docs: "The Close and WriteControl methods can // be called concurrently with all other methods." - if err := h.conn.WriteControl(gwebsocket.PingMessage, h.message, time.Now().Add(writeDeadline)); err == nil { + if err := h.conn.WriteControl(gwebsocket.PingMessage, h.message, time.Now().Add(pingReadDeadline)); err == nil { klog.V(8).Infof("Websocket Ping succeeeded") } else { klog.Errorf("Websocket Ping failed: %v", err) From 271d034e86108101a804541843d50abe3fea06ae Mon Sep 17 00:00:00 2001 From: Sean Sullivan Date: Wed, 21 Feb 2024 08:56:07 +0000 Subject: [PATCH 059/239] portforward: tunnel spdy through websockets Kubernetes-commit: 8b447d8c97e8823b4308eb91cf7d75693e867c61 --- tools/portforward/fallback_dialer.go | 57 ++++++ tools/portforward/fallback_dialer_test.go | 53 +++++ tools/portforward/portforward.go | 6 +- tools/portforward/portforward_test.go | 9 +- tools/portforward/tunneling_connection.go | 153 ++++++++++++++ .../portforward/tunneling_connection_test.go | 190 ++++++++++++++++++ tools/portforward/tunneling_dialer.go | 93 +++++++++ 7 files changed, 557 insertions(+), 4 deletions(-) create mode 100644 tools/portforward/fallback_dialer.go create mode 100644 tools/portforward/fallback_dialer_test.go create mode 100644 tools/portforward/tunneling_connection.go create mode 100644 tools/portforward/tunneling_connection_test.go create mode 100644 tools/portforward/tunneling_dialer.go diff --git a/tools/portforward/fallback_dialer.go b/tools/portforward/fallback_dialer.go new file mode 100644 index 000000000..8fb74a418 --- /dev/null +++ b/tools/portforward/fallback_dialer.go @@ -0,0 +1,57 @@ +/* +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 portforward + +import ( + "k8s.io/apimachinery/pkg/util/httpstream" + "k8s.io/klog/v2" +) + +var _ httpstream.Dialer = &fallbackDialer{} + +// 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 { + primary httpstream.Dialer + secondary httpstream.Dialer + shouldFallback func(error) bool +} + +// 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{ + primary: primary, + secondary: secondary, + shouldFallback: shouldFallback, + } +} + +// Dial is the single function necessary to implement the "httpstream.Dialer" interface. +// It takes the protocol version strings to request, returning an the upgraded +// 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) { + 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) + return f.secondary.Dial(protocols...) + } + return conn, version, err +} diff --git a/tools/portforward/fallback_dialer_test.go b/tools/portforward/fallback_dialer_test.go new file mode 100644 index 000000000..4680fa298 --- /dev/null +++ b/tools/portforward/fallback_dialer_test.go @@ -0,0 +1,53 @@ +/* +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 portforward + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +func TestFallbackDialer(t *testing.T) { + protocol := "v6.fake.k8s.io" + // If "shouldFallback" is false, then only primary should be dialed. + primary := &fakeDialer{dialed: false} + primary.negotiatedProtocol = protocol + secondary := &fakeDialer{dialed: false} + fallbackDialer := NewFallbackDialer(primary, secondary, alwaysFalse) + _, negotiated, err := fallbackDialer.Dial(protocol) + assert.True(t, primary.dialed, "no fallback; primary should have dialed") + assert.Equal(t, protocol, negotiated, "") + assert.False(t, secondary.dialed, "no fallback; secondary should *not* have dialed") + assert.Nil(t, err, "error should be nil") + // If "shouldFallback" is true, then primary AND secondary should be dialed. + primary.dialed = false // reset dialed field + primary.err = fmt.Errorf("bad handshake") + secondary.dialed = false // reset dialed field + secondary.negotiatedProtocol = protocol + fallbackDialer = NewFallbackDialer(primary, secondary, alwaysTrue) + _, negotiated, err = fallbackDialer.Dial(protocol) + assert.True(t, primary.dialed, "fallback; primary should have dialed (first)") + assert.True(t, secondary.dialed, "fallback; secondary should have dialed") + assert.Equal(t, protocol, negotiated) + assert.Nil(t, err) +} + +func alwaysTrue(err error) bool { return true } + +func alwaysFalse(err error) bool { return false } diff --git a/tools/portforward/portforward.go b/tools/portforward/portforward.go index b581043f6..83ef3e929 100644 --- a/tools/portforward/portforward.go +++ b/tools/portforward/portforward.go @@ -191,11 +191,15 @@ func (pf *PortForwarder) ForwardPorts() error { defer pf.Close() var err error - pf.streamConn, _, err = pf.dialer.Dial(PortForwardProtocolV1Name) + var protocol string + pf.streamConn, protocol, err = pf.dialer.Dial(PortForwardProtocolV1Name) if err != nil { return fmt.Errorf("error upgrading connection: %s", err) } defer pf.streamConn.Close() + if protocol != PortForwardProtocolV1Name { + return fmt.Errorf("unable to negotiate protocol: client supports %q, server returned %q", PortForwardProtocolV1Name, protocol) + } return pf.forward() } diff --git a/tools/portforward/portforward_test.go b/tools/portforward/portforward_test.go index 3c90a3fde..075a22e62 100644 --- a/tools/portforward/portforward_test.go +++ b/tools/portforward/portforward_test.go @@ -430,7 +430,8 @@ func TestGetListener(t *testing.T) { func TestGetPortsReturnsDynamicallyAssignedLocalPort(t *testing.T) { dialer := &fakeDialer{ - conn: newFakeConnection(), + conn: newFakeConnection(), + negotiatedProtocol: PortForwardProtocolV1Name, } stopChan := make(chan struct{}) @@ -570,7 +571,8 @@ func TestWaitForConnectionExitsOnStreamConnClosed(t *testing.T) { func TestForwardPortsReturnsErrorWhenConnectionIsLost(t *testing.T) { dialer := &fakeDialer{ - conn: newFakeConnection(), + conn: newFakeConnection(), + negotiatedProtocol: PortForwardProtocolV1Name, } stopChan := make(chan struct{}) @@ -601,7 +603,8 @@ func TestForwardPortsReturnsErrorWhenConnectionIsLost(t *testing.T) { func TestForwardPortsReturnsNilWhenStopChanIsClosed(t *testing.T) { dialer := &fakeDialer{ - conn: newFakeConnection(), + conn: newFakeConnection(), + negotiatedProtocol: PortForwardProtocolV1Name, } stopChan := make(chan struct{}) diff --git a/tools/portforward/tunneling_connection.go b/tools/portforward/tunneling_connection.go new file mode 100644 index 000000000..4c04531b6 --- /dev/null +++ b/tools/portforward/tunneling_connection.go @@ -0,0 +1,153 @@ +/* +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 portforward + +import ( + "errors" + "fmt" + "io" + "net" + "sync" + "time" + + gwebsocket "github.com/gorilla/websocket" + + "k8s.io/klog/v2" +) + +var _ net.Conn = &TunnelingConnection{} + +// TunnelingConnection implements the "httpstream.Connection" interface, wrapping +// a websocket connection that tunnels SPDY. +type TunnelingConnection struct { + name string + conn *gwebsocket.Conn + inProgressMessage io.Reader + closeOnce sync.Once +} + +// NewTunnelingConnection wraps the passed gorilla/websockets connection +// with the TunnelingConnection struct (implementing net.Conn). +func NewTunnelingConnection(name string, conn *gwebsocket.Conn) *TunnelingConnection { + return &TunnelingConnection{ + name: name, + conn: conn, + } +} + +// Read implements "io.Reader" interface, reading from the stored connection +// into the passed buffer "p". Returns the number of bytes read and an error. +// Can keep track of the "inProgress" messsage from the tunneled connection. +func (c *TunnelingConnection) Read(p []byte) (int, error) { + klog.V(7).Infof("%s: tunneling connection read...", c.name) + defer klog.V(7).Infof("%s: tunneling connection read...complete", c.name) + for { + if c.inProgressMessage == nil { + klog.V(8).Infof("%s: tunneling connection read before NextReader()...", c.name) + messageType, nextReader, err := c.conn.NextReader() + if err != nil { + closeError := &gwebsocket.CloseError{} + if errors.As(err, &closeError) && closeError.Code == gwebsocket.CloseNormalClosure { + return 0, io.EOF + } + klog.V(4).Infof("%s:tunneling connection NextReader() error: %v", c.name, err) + return 0, err + } + if messageType != gwebsocket.BinaryMessage { + return 0, fmt.Errorf("invalid message type received") + } + c.inProgressMessage = nextReader + } + klog.V(8).Infof("%s: tunneling connection read in progress message...", c.name) + i, err := c.inProgressMessage.Read(p) + if i == 0 && err == io.EOF { + c.inProgressMessage = nil + } else { + klog.V(8).Infof("%s: read %d bytes, error=%v, bytes=% X", c.name, i, err, p[:i]) + return i, err + } + } +} + +// Write implements "io.Writer" interface, copying the data in the passed +// byte array "p" into the stored tunneled connection. Returns the number +// of bytes written and an error. +func (c *TunnelingConnection) Write(p []byte) (n int, err error) { + klog.V(7).Infof("%s: write: %d bytes, bytes=% X", c.name, len(p), p) + defer klog.V(7).Infof("%s: tunneling connection write...complete", c.name) + w, err := c.conn.NextWriter(gwebsocket.BinaryMessage) + if err != nil { + return 0, err + } + defer func() { + // close, which flushes the message + closeErr := w.Close() + if closeErr != nil && err == nil { + // if closing/flushing errored and we weren't already returning an error, return the close error + err = closeErr + } + }() + + n, err = w.Write(p) + return +} + +// Close implements "io.Closer" interface, signaling the other tunneled connection +// endpoint, and closing the tunneled connection only once. +func (c *TunnelingConnection) Close() error { + var err error + c.closeOnce.Do(func() { + klog.V(7).Infof("%s: tunneling connection Close()...", c.name) + // Signal other endpoint that websocket connection is closing; ignore error. + normalCloseMsg := gwebsocket.FormatCloseMessage(gwebsocket.CloseNormalClosure, "") + c.conn.WriteControl(gwebsocket.CloseMessage, normalCloseMsg, time.Now().Add(time.Second)) //nolint:errcheck + err = c.conn.Close() + }) + return err +} + +// LocalAddr implements part of the "net.Conn" interface, returning the local +// endpoint network address of the tunneled connection. +func (c *TunnelingConnection) LocalAddr() net.Addr { + return c.conn.LocalAddr() +} + +// LocalAddr implements part of the "net.Conn" interface, returning the remote +// endpoint network address of the tunneled connection. +func (c *TunnelingConnection) RemoteAddr() net.Addr { + return c.conn.RemoteAddr() +} + +// SetDeadline sets the *absolute* time in the future for both +// read and write deadlines. Returns an error if one occurs. +func (c *TunnelingConnection) SetDeadline(t time.Time) error { + rerr := c.SetReadDeadline(t) + werr := c.SetWriteDeadline(t) + return errors.Join(rerr, werr) +} + +// SetDeadline sets the *absolute* time in the future for the +// read deadlines. Returns an error if one occurs. +func (c *TunnelingConnection) SetReadDeadline(t time.Time) error { + return c.conn.SetReadDeadline(t) +} + +// SetDeadline sets the *absolute* time in the future for the +// write deadlines. Returns an error if one occurs. +func (c *TunnelingConnection) SetWriteDeadline(t time.Time) error { + return c.conn.SetWriteDeadline(t) +} diff --git a/tools/portforward/tunneling_connection_test.go b/tools/portforward/tunneling_connection_test.go new file mode 100644 index 000000000..4127f49d4 --- /dev/null +++ b/tools/portforward/tunneling_connection_test.go @@ -0,0 +1,190 @@ +/* +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 portforward + +import ( + "io" + "net" + "net/http" + "net/http/httptest" + "net/url" + "strings" + "testing" + "time" + + gwebsocket "github.com/gorilla/websocket" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "k8s.io/apimachinery/pkg/util/httpstream" + "k8s.io/apimachinery/pkg/util/httpstream/spdy" + constants "k8s.io/apimachinery/pkg/util/portforward" + "k8s.io/apimachinery/pkg/util/wait" + "k8s.io/client-go/rest" + "k8s.io/client-go/transport/websocket" +) + +func TestTunnelingConnection_ReadWriteClose(t *testing.T) { + // Stream channel that will receive streams created on upstream SPDY server. + streamChan := make(chan httpstream.Stream) + defer close(streamChan) + stopServerChan := make(chan struct{}) + defer close(stopServerChan) + // Create tunneling connection server endpoint with fake upstream SPDY server. + tunnelingServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { + var upgrader = gwebsocket.Upgrader{ + CheckOrigin: func(r *http.Request) bool { return true }, + Subprotocols: []string{constants.WebsocketsSPDYTunnelingPortForwardV1}, + } + conn, err := upgrader.Upgrade(w, req, nil) + require.NoError(t, err) + defer conn.Close() //nolint:errcheck + require.Equal(t, constants.WebsocketsSPDYTunnelingPortForwardV1, conn.Subprotocol()) + tunnelingConn := NewTunnelingConnection("server", conn) + spdyConn, err := spdy.NewServerConnection(tunnelingConn, justQueueStream(streamChan)) + require.NoError(t, err) + defer spdyConn.Close() //nolint:errcheck + <-stopServerChan + })) + defer tunnelingServer.Close() + // Dial the client tunneling connection to the tunneling server. + url, err := url.Parse(tunnelingServer.URL) + require.NoError(t, err) + dialer, err := NewSPDYOverWebsocketDialer(url, &rest.Config{Host: url.Host}) + require.NoError(t, err) + spdyClient, protocol, err := dialer.Dial(constants.PortForwardV1Name) + require.NoError(t, err) + assert.Equal(t, constants.PortForwardV1Name, protocol) + defer spdyClient.Close() //nolint:errcheck + // Create a SPDY client stream, which will queue a SPDY server stream + // on the stream creation channel. Send data on the client stream + // reading off the SPDY server stream, and validating it was tunneled. + expected := "This is a test tunneling SPDY data through websockets." + var actual []byte + go func() { + clientStream, err := spdyClient.CreateStream(http.Header{}) + require.NoError(t, err) + _, err = io.Copy(clientStream, strings.NewReader(expected)) + require.NoError(t, err) + clientStream.Close() //nolint:errcheck + }() + select { + case serverStream := <-streamChan: + actual, err = io.ReadAll(serverStream) + require.NoError(t, err) + defer serverStream.Close() //nolint:errcheck + case <-time.After(wait.ForeverTestTimeout): + t.Fatalf("timeout waiting for spdy stream to arrive on channel.") + } + assert.Equal(t, expected, string(actual), "error validating tunneled string") +} + +func TestTunnelingConnection_LocalRemoteAddress(t *testing.T) { + stopServerChan := make(chan struct{}) + defer close(stopServerChan) + tunnelingServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { + var upgrader = gwebsocket.Upgrader{ + CheckOrigin: func(r *http.Request) bool { return true }, + Subprotocols: []string{constants.WebsocketsSPDYTunnelingPortForwardV1}, + } + conn, err := upgrader.Upgrade(w, req, nil) + require.NoError(t, err) + defer conn.Close() //nolint:errcheck + require.Equal(t, constants.WebsocketsSPDYTunnelingPortForwardV1, conn.Subprotocol()) + <-stopServerChan + })) + defer tunnelingServer.Close() + // Create the client side tunneling connection. + url, err := url.Parse(tunnelingServer.URL) + require.NoError(t, err) + tConn, err := dialForTunnelingConnection(url) + require.NoError(t, err, "error creating client tunneling connection") + defer tConn.Close() //nolint:errcheck + // Validate "LocalAddr()" and "RemoteAddr()" + localAddr := tConn.LocalAddr() + remoteAddr := tConn.RemoteAddr() + assert.Equal(t, "tcp", localAddr.Network(), "tunneling connection must be TCP") + assert.Equal(t, "tcp", remoteAddr.Network(), "tunneling connection must be TCP") + _, err = net.ResolveTCPAddr("tcp", localAddr.String()) + assert.NoError(t, err, "tunneling connection local addr should parse") + _, err = net.ResolveTCPAddr("tcp", remoteAddr.String()) + assert.NoError(t, err, "tunneling connection remote addr should parse") +} + +func TestTunnelingConnection_ReadWriteDeadlines(t *testing.T) { + stopServerChan := make(chan struct{}) + defer close(stopServerChan) + tunnelingServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { + var upgrader = gwebsocket.Upgrader{ + CheckOrigin: func(r *http.Request) bool { return true }, + Subprotocols: []string{constants.WebsocketsSPDYTunnelingPortForwardV1}, + } + conn, err := upgrader.Upgrade(w, req, nil) + require.NoError(t, err) + defer conn.Close() //nolint:errcheck + require.Equal(t, constants.WebsocketsSPDYTunnelingPortForwardV1, conn.Subprotocol()) + <-stopServerChan + })) + defer tunnelingServer.Close() + // Create the client side tunneling connection. + url, err := url.Parse(tunnelingServer.URL) + require.NoError(t, err) + tConn, err := dialForTunnelingConnection(url) + require.NoError(t, err, "error creating client tunneling connection") + defer tConn.Close() //nolint:errcheck + // Validate the read and write deadlines. + err = tConn.SetReadDeadline(time.Time{}) + assert.NoError(t, err, "setting zero deadline should always succeed; turns off deadline") + err = tConn.SetWriteDeadline(time.Time{}) + assert.NoError(t, err, "setting zero deadline should always succeed; turns off deadline") + err = tConn.SetDeadline(time.Time{}) + assert.NoError(t, err, "setting zero deadline should always succeed; turns off deadline") + err = tConn.SetReadDeadline(time.Now().AddDate(10, 0, 0)) + assert.NoError(t, err, "setting deadline 10 year from now succeeds") + err = tConn.SetWriteDeadline(time.Now().AddDate(10, 0, 0)) + assert.NoError(t, err, "setting deadline 10 year from now succeeds") + err = tConn.SetDeadline(time.Now().AddDate(10, 0, 0)) + assert.NoError(t, err, "setting deadline 10 year from now succeeds") +} + +// dialForTunnelingConnection upgrades a request at the passed "url", creating +// a websocket connection. Returns the TunnelingConnection injected with the +// websocket connection or an error if one occurs. +func dialForTunnelingConnection(url *url.URL) (*TunnelingConnection, error) { + req, err := http.NewRequest("GET", url.String(), nil) + if err != nil { + return nil, err + } + // Tunneling must initiate a websocket upgrade connection, using tunneling portforward protocol. + tunnelingProtocols := []string{constants.WebsocketsSPDYTunnelingPortForwardV1} + transport, holder, err := websocket.RoundTripperFor(&rest.Config{Host: url.Host}) + if err != nil { + return nil, err + } + conn, err := websocket.Negotiate(transport, holder, req, tunnelingProtocols...) + if err != nil { + return nil, err + } + return NewTunnelingConnection("client", conn), nil +} + +func justQueueStream(streams chan httpstream.Stream) func(httpstream.Stream, <-chan struct{}) error { + return func(stream httpstream.Stream, replySent <-chan struct{}) error { + streams <- stream + return nil + } +} diff --git a/tools/portforward/tunneling_dialer.go b/tools/portforward/tunneling_dialer.go new file mode 100644 index 000000000..2bef5ecd7 --- /dev/null +++ b/tools/portforward/tunneling_dialer.go @@ -0,0 +1,93 @@ +/* +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 portforward + +import ( + "fmt" + "net/http" + "net/url" + "strings" + "time" + + "k8s.io/apimachinery/pkg/util/httpstream" + "k8s.io/apimachinery/pkg/util/httpstream/spdy" + constants "k8s.io/apimachinery/pkg/util/portforward" + restclient "k8s.io/client-go/rest" + "k8s.io/client-go/transport/websocket" + "k8s.io/klog/v2" +) + +const PingPeriod = 10 * time.Second + +// tunnelingDialer implements "httpstream.Dial" interface +type tunnelingDialer struct { + url *url.URL + transport http.RoundTripper + holder websocket.ConnectionHolder +} + +// NewTunnelingDialer creates and returns the tunnelingDialer structure which implemements the "httpstream.Dialer" +// interface. The dialer can upgrade a websocket request, creating a websocket connection. This function +// returns an error if one occurs. +func NewSPDYOverWebsocketDialer(url *url.URL, config *restclient.Config) (httpstream.Dialer, error) { + transport, holder, err := websocket.RoundTripperFor(config) + if err != nil { + return nil, err + } + return &tunnelingDialer{ + url: url, + transport: transport, + holder: holder, + }, nil +} + +// Dial upgrades to a tunneling streaming connection, returning a SPDY connection +// containing a WebSockets connection (which implements "net.Conn"). Also +// returns the protocol negotiated, or an error. +func (d *tunnelingDialer) Dial(protocols ...string) (httpstream.Connection, string, error) { + // There is no passed context, so skip the context when creating request for now. + // Websockets requires "GET" method: RFC 6455 Sec. 4.1 (page 17). + req, err := http.NewRequest("GET", d.url.String(), nil) + if err != nil { + return nil, "", err + } + // Add the spdy tunneling prefix to the requested protocols. The tunneling + // handler will know how to negotiate these protocols. + tunnelingProtocols := []string{} + for _, protocol := range protocols { + tunnelingProtocol := constants.WebsocketsSPDYTunnelingPrefix + protocol + tunnelingProtocols = append(tunnelingProtocols, tunnelingProtocol) + } + klog.V(4).Infoln("Before WebSocket Upgrade Connection...") + conn, err := websocket.Negotiate(d.transport, d.holder, req, tunnelingProtocols...) + if err != nil { + return nil, "", err + } + if conn == nil { + return nil, "", fmt.Errorf("negotiated websocket connection is nil") + } + protocol := conn.Subprotocol() + protocol = strings.TrimPrefix(protocol, constants.WebsocketsSPDYTunnelingPrefix) + klog.V(4).Infof("negotiated protocol: %s", protocol) + + // Wrap the websocket connection which implements "net.Conn". + tConn := NewTunnelingConnection("client", conn) + // Create SPDY connection injecting the previously created tunneling connection. + spdyConn, err := spdy.NewClientConnectionWithPings(tConn, PingPeriod) + + return spdyConn, protocol, err +} From 64b46766f1e0001dfa709b6650e1993a7e959320 Mon Sep 17 00:00:00 2001 From: Gaurav Ghildiyal Date: Fri, 23 Feb 2024 12:23:32 -0800 Subject: [PATCH 060/239] Run 'make update' Kubernetes-commit: 646fd200b8532b0df95df300a8351379315f3ac9 --- applyconfigurations/core/v1/servicespec.go | 9 +++++++++ applyconfigurations/internal/internal.go | 3 +++ 2 files changed, 12 insertions(+) diff --git a/applyconfigurations/core/v1/servicespec.go b/applyconfigurations/core/v1/servicespec.go index 493af6fb3..5cfbcb700 100644 --- a/applyconfigurations/core/v1/servicespec.go +++ b/applyconfigurations/core/v1/servicespec.go @@ -44,6 +44,7 @@ type ServiceSpecApplyConfiguration struct { AllocateLoadBalancerNodePorts *bool `json:"allocateLoadBalancerNodePorts,omitempty"` LoadBalancerClass *string `json:"loadBalancerClass,omitempty"` InternalTrafficPolicy *corev1.ServiceInternalTrafficPolicy `json:"internalTrafficPolicy,omitempty"` + TrafficDistribution *string `json:"trafficDistribution,omitempty"` } // ServiceSpecApplyConfiguration constructs an declarative configuration of the ServiceSpec type for use with @@ -222,3 +223,11 @@ func (b *ServiceSpecApplyConfiguration) WithInternalTrafficPolicy(value corev1.S b.InternalTrafficPolicy = &value return b } + +// WithTrafficDistribution sets the TrafficDistribution field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TrafficDistribution field is set to the value of the last call. +func (b *ServiceSpecApplyConfiguration) WithTrafficDistribution(value string) *ServiceSpecApplyConfiguration { + b.TrafficDistribution = &value + return b +} diff --git a/applyconfigurations/internal/internal.go b/applyconfigurations/internal/internal.go index 2ceb26221..37589e6b3 100644 --- a/applyconfigurations/internal/internal.go +++ b/applyconfigurations/internal/internal.go @@ -7546,6 +7546,9 @@ var schemaYAML = typed.YAMLObject(`types: - name: sessionAffinityConfig type: namedType: io.k8s.api.core.v1.SessionAffinityConfig + - name: trafficDistribution + type: + scalar: string - name: type type: scalar: string From 79f21dcaa87516d7bc638fb62baca8895b3db89d Mon Sep 17 00:00:00 2001 From: Sean Sullivan Date: Sat, 2 Mar 2024 16:10:39 -0800 Subject: [PATCH 061/239] removes extra upgrade aware proxy logging; returns tunneling connection close error Kubernetes-commit: e8bbb221d36f1adf4116752990c0c4f17a9e5deb --- tools/portforward/tunneling_connection.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tools/portforward/tunneling_connection.go b/tools/portforward/tunneling_connection.go index 4c04531b6..a9c9b18fd 100644 --- a/tools/portforward/tunneling_connection.go +++ b/tools/portforward/tunneling_connection.go @@ -114,8 +114,13 @@ func (c *TunnelingConnection) Close() error { klog.V(7).Infof("%s: tunneling connection Close()...", c.name) // Signal other endpoint that websocket connection is closing; ignore error. normalCloseMsg := gwebsocket.FormatCloseMessage(gwebsocket.CloseNormalClosure, "") - c.conn.WriteControl(gwebsocket.CloseMessage, normalCloseMsg, time.Now().Add(time.Second)) //nolint:errcheck - err = c.conn.Close() + writeControlErr := c.conn.WriteControl(gwebsocket.CloseMessage, normalCloseMsg, time.Now().Add(time.Second)) + closeErr := c.conn.Close() + if closeErr != nil { + err = closeErr + } else if writeControlErr != nil { + err = writeControlErr + } }) return err } From 4b03fda005e7596959fdfe9099d7346c47572e04 Mon Sep 17 00:00:00 2001 From: Sean Sullivan Date: Mon, 4 Mar 2024 10:52:59 -0800 Subject: [PATCH 062/239] re-write fallback dialer unit test Kubernetes-commit: 33af937b4a5f4eb5c5005bddb483317f042da515 --- tools/portforward/fallback_dialer_test.go | 51 +++++++++++++---------- 1 file changed, 29 insertions(+), 22 deletions(-) diff --git a/tools/portforward/fallback_dialer_test.go b/tools/portforward/fallback_dialer_test.go index 4680fa298..1a6805f12 100644 --- a/tools/portforward/fallback_dialer_test.go +++ b/tools/portforward/fallback_dialer_test.go @@ -21,33 +21,40 @@ import ( "testing" "github.com/stretchr/testify/assert" + "k8s.io/apimachinery/pkg/util/httpstream" ) func TestFallbackDialer(t *testing.T) { - protocol := "v6.fake.k8s.io" - // If "shouldFallback" is false, then only primary should be dialed. - primary := &fakeDialer{dialed: false} - primary.negotiatedProtocol = protocol - secondary := &fakeDialer{dialed: false} - fallbackDialer := NewFallbackDialer(primary, secondary, alwaysFalse) - _, negotiated, err := fallbackDialer.Dial(protocol) + primaryProtocol := "primary.fake.protocol" + secondaryProtocol := "secondary.fake.protocol" + protocols := []string{primaryProtocol, secondaryProtocol} + // If primary dialer error is nil, then no fallback and primary negotiated protocol returned. + primary := &fakeDialer{dialed: false, negotiatedProtocol: primaryProtocol} + secondary := &fakeDialer{dialed: false, negotiatedProtocol: secondaryProtocol} + fallbackDialer := NewFallbackDialer(primary, secondary, notCalled) + _, negotiated, err := fallbackDialer.Dial(protocols...) assert.True(t, primary.dialed, "no fallback; primary should have dialed") - assert.Equal(t, protocol, negotiated, "") assert.False(t, secondary.dialed, "no fallback; secondary should *not* have dialed") - assert.Nil(t, err, "error should be nil") - // If "shouldFallback" is true, then primary AND secondary should be dialed. - primary.dialed = false // reset dialed field - primary.err = fmt.Errorf("bad handshake") - secondary.dialed = false // reset dialed field - secondary.negotiatedProtocol = protocol - fallbackDialer = NewFallbackDialer(primary, secondary, alwaysTrue) - _, negotiated, err = fallbackDialer.Dial(protocol) - assert.True(t, primary.dialed, "fallback; primary should have dialed (first)") + assert.Equal(t, primaryProtocol, negotiated, "primary negotiated protocol returned") + assert.Nil(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} + fallbackDialer = NewFallbackDialer(primary, secondary, httpstream.IsUpgradeFailure) + _, 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, protocol, negotiated) - assert.Nil(t, err) + assert.Equal(t, secondaryProtocol, negotiated, "negotiated protocol is from secondary dialer") + assert.Nil(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} + secondary = &fakeDialer{dialed: false} + fallbackDialer = NewFallbackDialer(primary, secondary, httpstream.IsUpgradeFailure) + _, _, err = fallbackDialer.Dial(protocols...) + 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, nonUpgradeErr, err, "error is from primary dialer") } -func alwaysTrue(err error) bool { return true } - -func alwaysFalse(err error) bool { return false } +func notCalled(err error) bool { return false } From ae38726e6eb0fcdb988e2d97ebf4defcb166b2a9 Mon Sep 17 00:00:00 2001 From: Sean Sullivan Date: Mon, 4 Mar 2024 11:31:56 -0800 Subject: [PATCH 063/239] extend deadlines to one minute Kubernetes-commit: b04d1177efb0cfc84b76732848eef8f0ea89b25b --- tools/remotecommand/websocket.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/remotecommand/websocket.go b/tools/remotecommand/websocket.go index e6e893a10..1dc679cb1 100644 --- a/tools/remotecommand/websocket.go +++ b/tools/remotecommand/websocket.go @@ -38,7 +38,7 @@ import ( // writeDeadline defines the time that a client-side write to the websocket // connection must complete before an i/o timeout occurs. -const writeDeadline = 30 * time.Second +const writeDeadline = 60 * time.Second var ( _ Executor = &wsStreamExecutor{} @@ -61,8 +61,8 @@ const ( // "pong" message before a timeout error occurs for websocket reading. // This duration must always be greater than the "pingPeriod". By defining // this deadline in terms of the ping period, we are essentially saying - // we can drop "X-1" (e.g. 6-1=5) pings before firing the timeout. - pingReadDeadline = (pingPeriod * 6) + (1 * time.Second) + // we can drop "X" (e.g. 12) pings before firing the timeout. + pingReadDeadline = (pingPeriod * 12) + (1 * time.Second) ) // wsStreamExecutor handles transporting standard shell streams over an httpstream connection. From f323801a3474eafa0a3c5bdd22438b77752a3fa7 Mon Sep 17 00:00:00 2001 From: Kubernetes Publisher Date: Mon, 4 Mar 2024 17:18:44 -0800 Subject: [PATCH 064/239] Merge pull request #123413 from seans3/tunneling-spdy-websockets PortForward: Tunnel SPDY through WebSockets Kubernetes-commit: f745503112e06d6ff199e929d536c6a29825c01a --- go.mod | 8 ++++---- go.sum | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/go.mod b/go.mod index 0560cd647..96709bd9f 100644 --- a/go.mod +++ b/go.mod @@ -24,8 +24,8 @@ require ( golang.org/x/term v0.17.0 golang.org/x/time v0.3.0 google.golang.org/protobuf v1.31.0 - k8s.io/api v0.0.0-20240301204737-cd36300dc819 - k8s.io/apimachinery v0.0.0-20240302004725-df38a01ea799 + k8s.io/api v0.0.0-20240305005446-44e99ab012f3 + k8s.io/apimachinery v0.0.0-20240305011844-67cb3a878cd3 k8s.io/klog/v2 v2.120.1 k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 k8s.io/utils v0.0.0-20230726121419-3b25d923346b @@ -61,6 +61,6 @@ require ( ) replace ( - k8s.io/api => k8s.io/api v0.0.0-20240301204737-cd36300dc819 - k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20240302004725-df38a01ea799 + k8s.io/api => k8s.io/api v0.0.0-20240305005446-44e99ab012f3 + k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20240305011844-67cb3a878cd3 ) diff --git a/go.sum b/go.sum index 7269dc951..c6d10c1a4 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-20240301204737-cd36300dc819 h1:F87SZX4P+r/LNtLhFtsZjylRqRLRSX7rcvGKdjVy1UM= -k8s.io/api v0.0.0-20240301204737-cd36300dc819/go.mod h1:TYylmz5ON3nmsvimIN46iaRIjQwS/RcA5nYFRkdJmT4= -k8s.io/apimachinery v0.0.0-20240302004725-df38a01ea799 h1:QqDm+JeV6HCqng5kBgyWDazPe4nK0P20XhjX5Bx9elE= -k8s.io/apimachinery v0.0.0-20240302004725-df38a01ea799/go.mod h1:qPsrq6INURDMMgqxK78MEuC8GzI1f2oHvfHzg5ZOa6s= +k8s.io/api v0.0.0-20240305005446-44e99ab012f3 h1:kObw+Ii/uysUS4kFid2GeA/Ly0mKZMR0atFtzNShkYo= +k8s.io/api v0.0.0-20240305005446-44e99ab012f3/go.mod h1:LqWcRHARWAsGJzkb3VILGPRpvszhYI3gMjIZrqO6MMo= +k8s.io/apimachinery v0.0.0-20240305011844-67cb3a878cd3 h1:OQnlxechgbZid21Q0KyffHDuHHZz+G7RTGDA3SIkC+o= +k8s.io/apimachinery v0.0.0-20240305011844-67cb3a878cd3/go.mod h1:qPsrq6INURDMMgqxK78MEuC8GzI1f2oHvfHzg5ZOa6s= 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 62aace94ab8dbadd269b0295cc130ac7e54b1480 Mon Sep 17 00:00:00 2001 From: Sean Sullivan Date: Tue, 5 Mar 2024 20:21:48 +0000 Subject: [PATCH 065/239] Adds OWNERS files to client-go streaming dirs Kubernetes-commit: 855bc74023900b31095de72ae49c79d5d391aad5 --- tools/portforward/OWNERS | 10 ++++++++++ tools/remotecommand/OWNERS | 10 ++++++++++ 2 files changed, 20 insertions(+) create mode 100644 tools/portforward/OWNERS create mode 100644 tools/remotecommand/OWNERS diff --git a/tools/portforward/OWNERS b/tools/portforward/OWNERS new file mode 100644 index 000000000..307848307 --- /dev/null +++ b/tools/portforward/OWNERS @@ -0,0 +1,10 @@ +# See the OWNERS docs at https://go.k8s.io/owners + +approvers: + - aojea + - liggitt + - seans3 +reviewers: + - aojea + - liggitt + - seans3 diff --git a/tools/remotecommand/OWNERS b/tools/remotecommand/OWNERS new file mode 100644 index 000000000..307848307 --- /dev/null +++ b/tools/remotecommand/OWNERS @@ -0,0 +1,10 @@ +# See the OWNERS docs at https://go.k8s.io/owners + +approvers: + - aojea + - liggitt + - seans3 +reviewers: + - aojea + - liggitt + - seans3 From d1672351e4c0f0e0eb9d9ef616d8176b3ecf51ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Wo=C5=BAniak?= Date: Tue, 5 Mar 2024 18:25:15 +0100 Subject: [PATCH 066/239] Support for the Job managedBy field (alpha) (#123273) * support for the managed-by label in Job * Use managedBy field instead of managed-by label * Additional review remarks * Review remarks 2 * review remarks 3 * Skip cleanup of finalizers for job with custom managedBy * Drop the performance optimization * imrpove logs Kubernetes-commit: e568a77a931a1cf4239a4a5fa43e2b05bad3abdf --- applyconfigurations/batch/v1/jobspec.go | 9 +++++++++ applyconfigurations/internal/internal.go | 3 +++ go.mod | 4 ++-- go.sum | 4 ++-- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/applyconfigurations/batch/v1/jobspec.go b/applyconfigurations/batch/v1/jobspec.go index 3d46a3ecf..491b33615 100644 --- a/applyconfigurations/batch/v1/jobspec.go +++ b/applyconfigurations/batch/v1/jobspec.go @@ -41,6 +41,7 @@ type JobSpecApplyConfiguration struct { CompletionMode *batchv1.CompletionMode `json:"completionMode,omitempty"` Suspend *bool `json:"suspend,omitempty"` PodReplacementPolicy *batchv1.PodReplacementPolicy `json:"podReplacementPolicy,omitempty"` + ManagedBy *string `json:"managedBy,omitempty"` } // JobSpecApplyConfiguration constructs an declarative configuration of the JobSpec type for use with @@ -160,3 +161,11 @@ func (b *JobSpecApplyConfiguration) WithPodReplacementPolicy(value batchv1.PodRe b.PodReplacementPolicy = &value return b } + +// WithManagedBy sets the ManagedBy field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ManagedBy field is set to the value of the last call. +func (b *JobSpecApplyConfiguration) WithManagedBy(value string) *JobSpecApplyConfiguration { + b.ManagedBy = &value + return b +} diff --git a/applyconfigurations/internal/internal.go b/applyconfigurations/internal/internal.go index 37589e6b3..99c14e941 100644 --- a/applyconfigurations/internal/internal.go +++ b/applyconfigurations/internal/internal.go @@ -3599,6 +3599,9 @@ var schemaYAML = typed.YAMLObject(`types: - name: completions type: scalar: numeric + - name: managedBy + type: + scalar: string - name: manualSelector type: scalar: boolean diff --git a/go.mod b/go.mod index 392712749..93b4e51b6 100644 --- a/go.mod +++ b/go.mod @@ -24,7 +24,7 @@ require ( golang.org/x/term v0.17.0 golang.org/x/time v0.3.0 google.golang.org/protobuf v1.31.0 - k8s.io/api v0.0.0-20240305044759-dd2e75089b33 + k8s.io/api v0.0.0-20240305172515-3bd4693ef0c1 k8s.io/apimachinery v0.0.0-20240305011844-67cb3a878cd3 k8s.io/klog/v2 v2.120.1 k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 @@ -61,6 +61,6 @@ require ( ) replace ( - k8s.io/api => k8s.io/api v0.0.0-20240305044759-dd2e75089b33 + k8s.io/api => k8s.io/api v0.0.0-20240305172515-3bd4693ef0c1 k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20240305011844-67cb3a878cd3 ) diff --git a/go.sum b/go.sum index 29bff8ed4..532a4c1d9 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-20240305044759-dd2e75089b33 h1:t4rX/ZVL/5i5E/Z+kQFnCkqRn4Ni6vf+y7M399XPmSM= -k8s.io/api v0.0.0-20240305044759-dd2e75089b33/go.mod h1:vubRQCvGk3ZRs8VJewbBCTFfaSYNGtDSO4rI+Ur8d0M= +k8s.io/api v0.0.0-20240305172515-3bd4693ef0c1 h1:Bk1KMpe+FJvuKidoJIbw5wInLRq1xqp/wa/vU4AMCdg= +k8s.io/api v0.0.0-20240305172515-3bd4693ef0c1/go.mod h1:vubRQCvGk3ZRs8VJewbBCTFfaSYNGtDSO4rI+Ur8d0M= k8s.io/apimachinery v0.0.0-20240305011844-67cb3a878cd3 h1:OQnlxechgbZid21Q0KyffHDuHHZz+G7RTGDA3SIkC+o= k8s.io/apimachinery v0.0.0-20240305011844-67cb3a878cd3/go.mod h1:qPsrq6INURDMMgqxK78MEuC8GzI1f2oHvfHzg5ZOa6s= k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw= From 8b11b2fa6b24aed9da5b25aa8fe1ed67b8eba8ef Mon Sep 17 00:00:00 2001 From: Jordan Liggitt Date: Wed, 6 Mar 2024 09:47:28 -0500 Subject: [PATCH 067/239] Bump github.com/golang/protobuf v1.5.4, google.golang.org/protobuf v1.33.0 Kubernetes-commit: c6673d2346c814ddb4629c569bdc659ffa0c583f --- go.mod | 13 +++++++------ go.sum | 26 ++++++++++++++------------ 2 files changed, 21 insertions(+), 18 deletions(-) diff --git a/go.mod b/go.mod index fd34cbbe4..19bd291dd 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ 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.3 + github.com/golang/protobuf v1.5.4 github.com/google/gnostic-models v0.6.8 github.com/google/go-cmp v0.6.0 github.com/google/gofuzz v1.2.0 @@ -23,9 +23,9 @@ require ( golang.org/x/oauth2 v0.10.0 golang.org/x/term v0.17.0 golang.org/x/time v0.3.0 - google.golang.org/protobuf v1.31.0 - k8s.io/api v0.0.0-20240306045445-a70123b1de1f - k8s.io/apimachinery v0.0.0-20240306044809-0c29f846b598 + google.golang.org/protobuf v1.33.0 + 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 @@ -61,6 +61,7 @@ require ( ) replace ( - k8s.io/api => k8s.io/api v0.0.0-20240306045445-a70123b1de1f - k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20240306044809-0c29f846b598 + k8s.io/api => ../api + k8s.io/apimachinery => ../apimachinery + k8s.io/client-go => ../client-go ) diff --git a/go.sum b/go.sum index 89dbbded1..bbfdd8b0f 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= @@ -23,14 +28,12 @@ github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69 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.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= -github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/google/btree v1.0.1 h1:gK4Kx5IaGY9CD5sPJ36FHiBJ6ZXl0kilRiiCj+jdYp4= github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA= github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I= github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U= -github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= @@ -97,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.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= 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= @@ -140,12 +146,11 @@ 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.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= -google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +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 +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-20240306045445-a70123b1de1f h1:p5XDcqmDCJHQkhwObNjtqK9sveycMUeGXieCT22TVoQ= -k8s.io/api v0.0.0-20240306045445-a70123b1de1f/go.mod h1:qkir9rdbUyP/OP+nDI826HrYMhtfDnfFx99PpzTg+YE= -k8s.io/apimachinery v0.0.0-20240306044809-0c29f846b598 h1:LriDFTBjiDK5p5V94o5iurCor0lfCTOWf/wFXk12Sjk= -k8s.io/apimachinery v0.0.0-20240306044809-0c29f846b598/go.mod h1:qPsrq6INURDMMgqxK78MEuC8GzI1f2oHvfHzg5ZOa6s= +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 0cdc0ce850aff38ea01019751fb2a473aaaa1e66 Mon Sep 17 00:00:00 2001 From: Kubernetes Publisher Date: Wed, 6 Mar 2024 07:49:01 -0800 Subject: [PATCH 068/239] Merge pull request #123758 from liggitt/protobump [CVE-2024-24786] Bump github.com/golang/protobuf v1.5.4, google.golang.org/protobuf v1.33.0 Kubernetes-commit: a5f5f44157c49fdfb6384862c7cb34c2ddbd4cce --- go.mod | 9 ++++----- go.sum | 14 ++++---------- 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/go.mod b/go.mod index 19bd291dd..35e077ef6 100644 --- a/go.mod +++ b/go.mod @@ -24,8 +24,8 @@ require ( golang.org/x/term v0.17.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-20240306165540-05aa4bceed70 + k8s.io/apimachinery v0.0.0-20240306164812-cbfe0a1feaa5 k8s.io/klog/v2 v2.120.1 k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 k8s.io/utils v0.0.0-20230726121419-3b25d923346b @@ -61,7 +61,6 @@ require ( ) replace ( - k8s.io/api => ../api - k8s.io/apimachinery => ../apimachinery - k8s.io/client-go => ../client-go + k8s.io/api => k8s.io/api v0.0.0-20240306165540-05aa4bceed70 + k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20240306164812-cbfe0a1feaa5 ) diff --git a/go.sum b/go.sum index bbfdd8b0f..f737bab7b 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.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= 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-20240306165540-05aa4bceed70 h1:Kw6GufAvqr668v56lckDWoGHFG5wwjQRjYuf+PMt1us= +k8s.io/api v0.0.0-20240306165540-05aa4bceed70/go.mod h1:S69aw/5045kbDeBVmy89EQxSM7v5kHdLNzO4wt3OZ2o= +k8s.io/apimachinery v0.0.0-20240306164812-cbfe0a1feaa5 h1:YRP8FbAab9hlobsEfyUG7P6dC6hbVTLw0eFY/AnewmY= +k8s.io/apimachinery v0.0.0-20240306164812-cbfe0a1feaa5/go.mod h1:wEJvNDlfxMRaMhyv38SIHIEC9hah/xuzqUUhxIyUv7Y= 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 49bc97e51884d7b898151f41b11339aaea23f3bb Mon Sep 17 00:00:00 2001 From: Yuki Iwai Date: Wed, 21 Feb 2024 15:49:35 +0900 Subject: [PATCH 069/239] Job: Support for the JobSuccessPolicy (alpha) Signed-off-by: Yuki Iwai Kubernetes-commit: e216742672aa1bfd10b5cc84fa9191eddadeac72 --- applyconfigurations/batch/v1/jobspec.go | 9 ++++ applyconfigurations/batch/v1/successpolicy.go | 44 +++++++++++++++++ .../batch/v1/successpolicyrule.go | 48 +++++++++++++++++++ applyconfigurations/internal/internal.go | 21 ++++++++ applyconfigurations/utils.go | 4 ++ 5 files changed, 126 insertions(+) create mode 100644 applyconfigurations/batch/v1/successpolicy.go create mode 100644 applyconfigurations/batch/v1/successpolicyrule.go diff --git a/applyconfigurations/batch/v1/jobspec.go b/applyconfigurations/batch/v1/jobspec.go index 491b33615..bbcff71c8 100644 --- a/applyconfigurations/batch/v1/jobspec.go +++ b/applyconfigurations/batch/v1/jobspec.go @@ -31,6 +31,7 @@ type JobSpecApplyConfiguration struct { Completions *int32 `json:"completions,omitempty"` ActiveDeadlineSeconds *int64 `json:"activeDeadlineSeconds,omitempty"` PodFailurePolicy *PodFailurePolicyApplyConfiguration `json:"podFailurePolicy,omitempty"` + SuccessPolicy *SuccessPolicyApplyConfiguration `json:"successPolicy,omitempty"` BackoffLimit *int32 `json:"backoffLimit,omitempty"` BackoffLimitPerIndex *int32 `json:"backoffLimitPerIndex,omitempty"` MaxFailedIndexes *int32 `json:"maxFailedIndexes,omitempty"` @@ -82,6 +83,14 @@ func (b *JobSpecApplyConfiguration) WithPodFailurePolicy(value *PodFailurePolicy return b } +// WithSuccessPolicy sets the SuccessPolicy field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SuccessPolicy field is set to the value of the last call. +func (b *JobSpecApplyConfiguration) WithSuccessPolicy(value *SuccessPolicyApplyConfiguration) *JobSpecApplyConfiguration { + b.SuccessPolicy = value + return b +} + // WithBackoffLimit sets the BackoffLimit field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the BackoffLimit field is set to the value of the last call. diff --git a/applyconfigurations/batch/v1/successpolicy.go b/applyconfigurations/batch/v1/successpolicy.go new file mode 100644 index 000000000..327aa1f5a --- /dev/null +++ b/applyconfigurations/batch/v1/successpolicy.go @@ -0,0 +1,44 @@ +/* +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 + +// SuccessPolicyApplyConfiguration represents an 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 +// apply. +func SuccessPolicy() *SuccessPolicyApplyConfiguration { + return &SuccessPolicyApplyConfiguration{} +} + +// WithRules adds the given value to the Rules 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 Rules field. +func (b *SuccessPolicyApplyConfiguration) WithRules(values ...*SuccessPolicyRuleApplyConfiguration) *SuccessPolicyApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithRules") + } + b.Rules = append(b.Rules, *values[i]) + } + return b +} diff --git a/applyconfigurations/batch/v1/successpolicyrule.go b/applyconfigurations/batch/v1/successpolicyrule.go new file mode 100644 index 000000000..4c862e682 --- /dev/null +++ b/applyconfigurations/batch/v1/successpolicyrule.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 v1 + +// SuccessPolicyRuleApplyConfiguration represents an 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 +// apply. +func SuccessPolicyRule() *SuccessPolicyRuleApplyConfiguration { + return &SuccessPolicyRuleApplyConfiguration{} +} + +// WithSucceededIndexes sets the SucceededIndexes field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SucceededIndexes field is set to the value of the last call. +func (b *SuccessPolicyRuleApplyConfiguration) WithSucceededIndexes(value string) *SuccessPolicyRuleApplyConfiguration { + b.SucceededIndexes = &value + return b +} + +// WithSucceededCount sets the SucceededCount field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SucceededCount field is set to the value of the last call. +func (b *SuccessPolicyRuleApplyConfiguration) WithSucceededCount(value int32) *SuccessPolicyRuleApplyConfiguration { + b.SucceededCount = &value + return b +} diff --git a/applyconfigurations/internal/internal.go b/applyconfigurations/internal/internal.go index d1946cfb1..58fef57d2 100644 --- a/applyconfigurations/internal/internal.go +++ b/applyconfigurations/internal/internal.go @@ -3880,6 +3880,9 @@ var schemaYAML = typed.YAMLObject(`types: - name: selector type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector + - name: successPolicy + type: + namedType: io.k8s.api.batch.v1.SuccessPolicy - name: suspend type: scalar: boolean @@ -3992,6 +3995,24 @@ var schemaYAML = typed.YAMLObject(`types: elementType: namedType: io.k8s.api.batch.v1.PodFailurePolicyOnPodConditionsPattern elementRelationship: atomic +- name: io.k8s.api.batch.v1.SuccessPolicy + map: + fields: + - name: rules + type: + list: + elementType: + namedType: io.k8s.api.batch.v1.SuccessPolicyRule + elementRelationship: atomic +- name: io.k8s.api.batch.v1.SuccessPolicyRule + map: + fields: + - name: succeededCount + type: + scalar: numeric + - name: succeededIndexes + type: + scalar: string - name: io.k8s.api.batch.v1.UncountedTerminatedPods map: fields: diff --git a/applyconfigurations/utils.go b/applyconfigurations/utils.go index 346776974..2394bb1bd 100644 --- a/applyconfigurations/utils.go +++ b/applyconfigurations/utils.go @@ -559,6 +559,10 @@ func ForKind(kind schema.GroupVersionKind) interface{} { return &applyconfigurationsbatchv1.PodFailurePolicyOnPodConditionsPatternApplyConfiguration{} case batchv1.SchemeGroupVersion.WithKind("PodFailurePolicyRule"): return &applyconfigurationsbatchv1.PodFailurePolicyRuleApplyConfiguration{} + case batchv1.SchemeGroupVersion.WithKind("SuccessPolicy"): + return &applyconfigurationsbatchv1.SuccessPolicyApplyConfiguration{} + case batchv1.SchemeGroupVersion.WithKind("SuccessPolicyRule"): + return &applyconfigurationsbatchv1.SuccessPolicyRuleApplyConfiguration{} case batchv1.SchemeGroupVersion.WithKind("UncountedTerminatedPods"): return &applyconfigurationsbatchv1.UncountedTerminatedPodsApplyConfiguration{} From 95cf817801784984234ffcb892cb57ba839e28b4 Mon Sep 17 00:00:00 2001 From: Patrick Ohly Date: Fri, 23 Feb 2024 15:22:02 +0100 Subject: [PATCH 070/239] dra: add "named resources" structured parameter model Like the current device plugin interface, a DRA driver using this model announces a list of resource instances. In contrast to device plugins, this list is made available to the scheduler together with attributes that can be used to select suitable instances when they are not all alike. Because this is the first structured parameter model, some checks that previously were not possible, in particular "is one structured parameter field set", now gets enabled. Adding another structured parameter model will be similar. The applyconfigs code generator assumes that all types in an API are defined in a single package. If it wasn't for that, it would be possible to place the "named resources" types in separate packages, which makes their names in the Go code more natural and provides an indication of their stability level because the package name could include a version. Kubernetes-commit: d4d5ade7f5be047472f8d9572c7f01f142951a2d --- applyconfigurations/internal/internal.go | 98 +++++++++++++++++++ .../v1alpha2/allocationresultmodel.go | 39 ++++++++ .../v1alpha2/driverallocationresult.go | 13 ++- .../namedresourcesallocationresult.go | 39 ++++++++ .../v1alpha2/namedresourcesattribute.go | 92 +++++++++++++++++ .../v1alpha2/namedresourcesattributevalue.go | 88 +++++++++++++++++ .../resource/v1alpha2/namedresourcesfilter.go | 39 ++++++++ .../v1alpha2/namedresourcesinstance.go | 53 ++++++++++ .../v1alpha2/namedresourcesintslice.go | 41 ++++++++ .../v1alpha2/namedresourcesrequest.go | 39 ++++++++ .../v1alpha2/namedresourcesresources.go | 44 +++++++++ .../v1alpha2/namedresourcesstringslice.go | 41 ++++++++ .../resource/v1alpha2/noderesourcemodel.go | 39 ++++++++ .../resource/v1alpha2/noderesourceslice.go | 26 +++-- .../resource/v1alpha2/resourcefilter.go | 16 +-- .../resource/v1alpha2/resourcefiltermodel.go | 39 ++++++++ .../resource/v1alpha2/resourcerequest.go | 13 ++- .../resource/v1alpha2/resourcerequestmodel.go | 39 ++++++++ applyconfigurations/utils.go | 26 +++++ 19 files changed, 803 insertions(+), 21 deletions(-) create mode 100644 applyconfigurations/resource/v1alpha2/allocationresultmodel.go create mode 100644 applyconfigurations/resource/v1alpha2/namedresourcesallocationresult.go create mode 100644 applyconfigurations/resource/v1alpha2/namedresourcesattribute.go create mode 100644 applyconfigurations/resource/v1alpha2/namedresourcesattributevalue.go create mode 100644 applyconfigurations/resource/v1alpha2/namedresourcesfilter.go create mode 100644 applyconfigurations/resource/v1alpha2/namedresourcesinstance.go create mode 100644 applyconfigurations/resource/v1alpha2/namedresourcesintslice.go create mode 100644 applyconfigurations/resource/v1alpha2/namedresourcesrequest.go create mode 100644 applyconfigurations/resource/v1alpha2/namedresourcesresources.go create mode 100644 applyconfigurations/resource/v1alpha2/namedresourcesstringslice.go create mode 100644 applyconfigurations/resource/v1alpha2/noderesourcemodel.go create mode 100644 applyconfigurations/resource/v1alpha2/resourcefiltermodel.go create mode 100644 applyconfigurations/resource/v1alpha2/resourcerequestmodel.go diff --git a/applyconfigurations/internal/internal.go b/applyconfigurations/internal/internal.go index 622628d2d..ca1f4952c 100644 --- a/applyconfigurations/internal/internal.go +++ b/applyconfigurations/internal/internal.go @@ -11969,6 +11969,9 @@ var schemaYAML = typed.YAMLObject(`types: - name: io.k8s.api.resource.v1alpha2.DriverAllocationResult map: fields: + - name: namedResources + type: + namedType: io.k8s.api.resource.v1alpha2.NamedResourcesAllocationResult - name: vendorRequestParameters type: namedType: __untyped_atomic_ @@ -11987,6 +11990,92 @@ var schemaYAML = typed.YAMLObject(`types: - name: vendorParameters type: namedType: __untyped_atomic_ +- name: io.k8s.api.resource.v1alpha2.NamedResourcesAllocationResult + map: + fields: + - name: name + type: + scalar: string + default: "" +- name: io.k8s.api.resource.v1alpha2.NamedResourcesAttribute + map: + fields: + - name: bool + type: + scalar: boolean + - name: int + type: + scalar: numeric + - name: intSlice + type: + namedType: io.k8s.api.resource.v1alpha2.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.v1alpha2.NamedResourcesStringSlice +- name: io.k8s.api.resource.v1alpha2.NamedResourcesFilter + map: + fields: + - name: selector + type: + scalar: string + default: "" +- name: io.k8s.api.resource.v1alpha2.NamedResourcesInstance + map: + fields: + - name: attributes + type: + list: + elementType: + namedType: io.k8s.api.resource.v1alpha2.NamedResourcesAttribute + elementRelationship: atomic + - name: name + type: + scalar: string + default: "" +- name: io.k8s.api.resource.v1alpha2.NamedResourcesIntSlice + map: + fields: + - name: ints + type: + list: + elementType: + scalar: numeric + elementRelationship: atomic +- name: io.k8s.api.resource.v1alpha2.NamedResourcesRequest + map: + fields: + - name: selector + type: + scalar: string + default: "" +- name: io.k8s.api.resource.v1alpha2.NamedResourcesResources + map: + fields: + - name: instances + type: + list: + elementType: + namedType: io.k8s.api.resource.v1alpha2.NamedResourcesInstance + elementRelationship: atomic +- name: io.k8s.api.resource.v1alpha2.NamedResourcesStringSlice + map: + fields: + - name: strings + type: + list: + elementType: + scalar: string + elementRelationship: atomic - name: io.k8s.api.resource.v1alpha2.NodeResourceSlice map: fields: @@ -12004,6 +12093,9 @@ var schemaYAML = typed.YAMLObject(`types: type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} + - name: namedResources + type: + namedType: io.k8s.api.resource.v1alpha2.NamedResourcesResources - name: nodeName type: scalar: string @@ -12280,6 +12372,9 @@ var schemaYAML = typed.YAMLObject(`types: - name: driverName type: scalar: string + - name: namedResources + type: + namedType: io.k8s.api.resource.v1alpha2.NamedResourcesFilter - name: io.k8s.api.resource.v1alpha2.ResourceHandle map: fields: @@ -12295,6 +12390,9 @@ var schemaYAML = typed.YAMLObject(`types: - name: io.k8s.api.resource.v1alpha2.ResourceRequest map: fields: + - name: namedResources + type: + namedType: io.k8s.api.resource.v1alpha2.NamedResourcesRequest - name: vendorParameters type: namedType: __untyped_atomic_ diff --git a/applyconfigurations/resource/v1alpha2/allocationresultmodel.go b/applyconfigurations/resource/v1alpha2/allocationresultmodel.go new file mode 100644 index 000000000..0c8be0e6a --- /dev/null +++ b/applyconfigurations/resource/v1alpha2/allocationresultmodel.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 v1alpha2 + +// AllocationResultModelApplyConfiguration represents an 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 +// 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/v1alpha2/driverallocationresult.go b/applyconfigurations/resource/v1alpha2/driverallocationresult.go index 3b0403cca..a1f082fad 100644 --- a/applyconfigurations/resource/v1alpha2/driverallocationresult.go +++ b/applyconfigurations/resource/v1alpha2/driverallocationresult.go @@ -19,15 +19,14 @@ limitations under the License. package v1alpha2 import ( - v1alpha2 "k8s.io/api/resource/v1alpha2" runtime "k8s.io/apimachinery/pkg/runtime" ) // DriverAllocationResultApplyConfiguration represents an declarative configuration of the DriverAllocationResult type for use // with apply. type DriverAllocationResultApplyConfiguration struct { - VendorRequestParameters *runtime.RawExtension `json:"vendorRequestParameters,omitempty"` - v1alpha2.AllocationResultModel `json:",inline"` + VendorRequestParameters *runtime.RawExtension `json:"vendorRequestParameters,omitempty"` + AllocationResultModelApplyConfiguration `json:",inline"` } // DriverAllocationResultApplyConfiguration constructs an declarative configuration of the DriverAllocationResult type for use with @@ -43,3 +42,11 @@ func (b *DriverAllocationResultApplyConfiguration) WithVendorRequestParameters(v 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/v1alpha2/namedresourcesallocationresult.go b/applyconfigurations/resource/v1alpha2/namedresourcesallocationresult.go new file mode 100644 index 000000000..311edbac8 --- /dev/null +++ b/applyconfigurations/resource/v1alpha2/namedresourcesallocationresult.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 v1alpha2 + +// NamedResourcesAllocationResultApplyConfiguration represents an 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 +// apply. +func NamedResourcesAllocationResult() *NamedResourcesAllocationResultApplyConfiguration { + return &NamedResourcesAllocationResultApplyConfiguration{} +} + +// 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 { + b.Name = &value + return b +} diff --git a/applyconfigurations/resource/v1alpha2/namedresourcesattribute.go b/applyconfigurations/resource/v1alpha2/namedresourcesattribute.go new file mode 100644 index 000000000..43cd9044b --- /dev/null +++ b/applyconfigurations/resource/v1alpha2/namedresourcesattribute.go @@ -0,0 +1,92 @@ +/* +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 v1alpha2 + +import ( + resource "k8s.io/apimachinery/pkg/api/resource" +) + +// NamedResourcesAttributeApplyConfiguration represents an 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 +// 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 +} diff --git a/applyconfigurations/resource/v1alpha2/namedresourcesattributevalue.go b/applyconfigurations/resource/v1alpha2/namedresourcesattributevalue.go new file mode 100644 index 000000000..ad2c7e185 --- /dev/null +++ b/applyconfigurations/resource/v1alpha2/namedresourcesattributevalue.go @@ -0,0 +1,88 @@ +/* +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 v1alpha2 + +import ( + resource "k8s.io/apimachinery/pkg/api/resource" +) + +// NamedResourcesAttributeValueApplyConfiguration represents an 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"` +} + +// NamedResourcesAttributeValueApplyConfiguration constructs an 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 +} diff --git a/applyconfigurations/resource/v1alpha2/namedresourcesfilter.go b/applyconfigurations/resource/v1alpha2/namedresourcesfilter.go new file mode 100644 index 000000000..e483d8622 --- /dev/null +++ b/applyconfigurations/resource/v1alpha2/namedresourcesfilter.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 v1alpha2 + +// NamedResourcesFilterApplyConfiguration represents an 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 +// apply. +func NamedResourcesFilter() *NamedResourcesFilterApplyConfiguration { + return &NamedResourcesFilterApplyConfiguration{} +} + +// 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 *NamedResourcesFilterApplyConfiguration) WithSelector(value string) *NamedResourcesFilterApplyConfiguration { + b.Selector = &value + return b +} diff --git a/applyconfigurations/resource/v1alpha2/namedresourcesinstance.go b/applyconfigurations/resource/v1alpha2/namedresourcesinstance.go new file mode 100644 index 000000000..4f01372e4 --- /dev/null +++ b/applyconfigurations/resource/v1alpha2/namedresourcesinstance.go @@ -0,0 +1,53 @@ +/* +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 v1alpha2 + +// NamedResourcesInstanceApplyConfiguration represents an 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 +// 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/v1alpha2/namedresourcesintslice.go b/applyconfigurations/resource/v1alpha2/namedresourcesintslice.go new file mode 100644 index 000000000..ea00bffe5 --- /dev/null +++ b/applyconfigurations/resource/v1alpha2/namedresourcesintslice.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 v1alpha2 + +// NamedResourcesIntSliceApplyConfiguration represents an 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 +// 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/v1alpha2/namedresourcesrequest.go b/applyconfigurations/resource/v1alpha2/namedresourcesrequest.go new file mode 100644 index 000000000..5adfd84ee --- /dev/null +++ b/applyconfigurations/resource/v1alpha2/namedresourcesrequest.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 v1alpha2 + +// NamedResourcesRequestApplyConfiguration represents an 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 +// 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/v1alpha2/namedresourcesresources.go b/applyconfigurations/resource/v1alpha2/namedresourcesresources.go new file mode 100644 index 000000000..f01ff8699 --- /dev/null +++ b/applyconfigurations/resource/v1alpha2/namedresourcesresources.go @@ -0,0 +1,44 @@ +/* +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 v1alpha2 + +// NamedResourcesResourcesApplyConfiguration represents an 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 +// 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/v1alpha2/namedresourcesstringslice.go b/applyconfigurations/resource/v1alpha2/namedresourcesstringslice.go new file mode 100644 index 000000000..1e9387354 --- /dev/null +++ b/applyconfigurations/resource/v1alpha2/namedresourcesstringslice.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 v1alpha2 + +// NamedResourcesStringSliceApplyConfiguration represents an 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 +// 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/v1alpha2/noderesourcemodel.go b/applyconfigurations/resource/v1alpha2/noderesourcemodel.go new file mode 100644 index 000000000..20b7ea861 --- /dev/null +++ b/applyconfigurations/resource/v1alpha2/noderesourcemodel.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 v1alpha2 + +// NodeResourceModelApplyConfiguration represents an declarative configuration of the NodeResourceModel type for use +// with apply. +type NodeResourceModelApplyConfiguration struct { + NamedResources *NamedResourcesResourcesApplyConfiguration `json:"namedResources,omitempty"` +} + +// NodeResourceModelApplyConfiguration constructs an declarative configuration of the NodeResourceModel type for use with +// apply. +func NodeResourceModel() *NodeResourceModelApplyConfiguration { + return &NodeResourceModelApplyConfiguration{} +} + +// 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 *NodeResourceModelApplyConfiguration) WithNamedResources(value *NamedResourcesResourcesApplyConfiguration) *NodeResourceModelApplyConfiguration { + b.NamedResources = value + return b +} diff --git a/applyconfigurations/resource/v1alpha2/noderesourceslice.go b/applyconfigurations/resource/v1alpha2/noderesourceslice.go index a20245489..b7d7d9918 100644 --- a/applyconfigurations/resource/v1alpha2/noderesourceslice.go +++ b/applyconfigurations/resource/v1alpha2/noderesourceslice.go @@ -19,7 +19,7 @@ limitations under the License. package v1alpha2 import ( - v1alpha2 "k8s.io/api/resource/v1alpha2" + resourcev1alpha2 "k8s.io/api/resource/v1alpha2" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" @@ -30,11 +30,11 @@ import ( // NodeResourceSliceApplyConfiguration represents an declarative configuration of the NodeResourceSlice type for use // with apply. type NodeResourceSliceApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` - *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` - NodeName *string `json:"nodeName,omitempty"` - DriverName *string `json:"driverName,omitempty"` - v1alpha2.NodeResourceModel `json:",inline"` + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + NodeName *string `json:"nodeName,omitempty"` + DriverName *string `json:"driverName,omitempty"` + NodeResourceModelApplyConfiguration `json:",inline"` } // NodeResourceSlice constructs an declarative configuration of the NodeResourceSlice type for use with @@ -58,18 +58,18 @@ func NodeResourceSlice(name string) *NodeResourceSliceApplyConfiguration { // 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 ExtractNodeResourceSlice(nodeResourceSlice *v1alpha2.NodeResourceSlice, fieldManager string) (*NodeResourceSliceApplyConfiguration, error) { +func ExtractNodeResourceSlice(nodeResourceSlice *resourcev1alpha2.NodeResourceSlice, fieldManager string) (*NodeResourceSliceApplyConfiguration, error) { return extractNodeResourceSlice(nodeResourceSlice, fieldManager, "") } // ExtractNodeResourceSliceStatus is the same as ExtractNodeResourceSlice except // that it extracts the status subresource applied configuration. // Experimental! -func ExtractNodeResourceSliceStatus(nodeResourceSlice *v1alpha2.NodeResourceSlice, fieldManager string) (*NodeResourceSliceApplyConfiguration, error) { +func ExtractNodeResourceSliceStatus(nodeResourceSlice *resourcev1alpha2.NodeResourceSlice, fieldManager string) (*NodeResourceSliceApplyConfiguration, error) { return extractNodeResourceSlice(nodeResourceSlice, fieldManager, "status") } -func extractNodeResourceSlice(nodeResourceSlice *v1alpha2.NodeResourceSlice, fieldManager string, subresource string) (*NodeResourceSliceApplyConfiguration, error) { +func extractNodeResourceSlice(nodeResourceSlice *resourcev1alpha2.NodeResourceSlice, fieldManager string, subresource string) (*NodeResourceSliceApplyConfiguration, error) { b := &NodeResourceSliceApplyConfiguration{} err := managedfields.ExtractInto(nodeResourceSlice, internal.Parser().Type("io.k8s.api.resource.v1alpha2.NodeResourceSlice"), fieldManager, b, subresource) if err != nil { @@ -255,3 +255,11 @@ func (b *NodeResourceSliceApplyConfiguration) WithDriverName(value string) *Node 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 *NodeResourceSliceApplyConfiguration) WithNamedResources(value *NamedResourcesResourcesApplyConfiguration) *NodeResourceSliceApplyConfiguration { + b.NamedResources = value + return b +} diff --git a/applyconfigurations/resource/v1alpha2/resourcefilter.go b/applyconfigurations/resource/v1alpha2/resourcefilter.go index 2fd4ef89f..15371b44a 100644 --- a/applyconfigurations/resource/v1alpha2/resourcefilter.go +++ b/applyconfigurations/resource/v1alpha2/resourcefilter.go @@ -18,15 +18,11 @@ limitations under the License. package v1alpha2 -import ( - v1alpha2 "k8s.io/api/resource/v1alpha2" -) - // ResourceFilterApplyConfiguration represents an declarative configuration of the ResourceFilter type for use // with apply. type ResourceFilterApplyConfiguration struct { - DriverName *string `json:"driverName,omitempty"` - v1alpha2.ResourceFilterModel `json:",inline"` + DriverName *string `json:"driverName,omitempty"` + ResourceFilterModelApplyConfiguration `json:",inline"` } // ResourceFilterApplyConfiguration constructs an declarative configuration of the ResourceFilter type for use with @@ -42,3 +38,11 @@ func (b *ResourceFilterApplyConfiguration) WithDriverName(value string) *Resourc 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/v1alpha2/resourcefiltermodel.go b/applyconfigurations/resource/v1alpha2/resourcefiltermodel.go new file mode 100644 index 000000000..4f8d138f7 --- /dev/null +++ b/applyconfigurations/resource/v1alpha2/resourcefiltermodel.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 v1alpha2 + +// ResourceFilterModelApplyConfiguration represents an 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 +// 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/v1alpha2/resourcerequest.go b/applyconfigurations/resource/v1alpha2/resourcerequest.go index 971eace5b..0243d06f8 100644 --- a/applyconfigurations/resource/v1alpha2/resourcerequest.go +++ b/applyconfigurations/resource/v1alpha2/resourcerequest.go @@ -19,15 +19,14 @@ limitations under the License. package v1alpha2 import ( - v1alpha2 "k8s.io/api/resource/v1alpha2" runtime "k8s.io/apimachinery/pkg/runtime" ) // ResourceRequestApplyConfiguration represents an declarative configuration of the ResourceRequest type for use // with apply. type ResourceRequestApplyConfiguration struct { - VendorParameters *runtime.RawExtension `json:"vendorParameters,omitempty"` - v1alpha2.ResourceRequestModel `json:",inline"` + VendorParameters *runtime.RawExtension `json:"vendorParameters,omitempty"` + ResourceRequestModelApplyConfiguration `json:",inline"` } // ResourceRequestApplyConfiguration constructs an declarative configuration of the ResourceRequest type for use with @@ -43,3 +42,11 @@ func (b *ResourceRequestApplyConfiguration) WithVendorParameters(value runtime.R 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/v1alpha2/resourcerequestmodel.go b/applyconfigurations/resource/v1alpha2/resourcerequestmodel.go new file mode 100644 index 000000000..35bd1d88f --- /dev/null +++ b/applyconfigurations/resource/v1alpha2/resourcerequestmodel.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 v1alpha2 + +// ResourceRequestModelApplyConfiguration represents an 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 +// 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/utils.go b/applyconfigurations/utils.go index 59188c6ec..72547bde9 100644 --- a/applyconfigurations/utils.go +++ b/applyconfigurations/utils.go @@ -1527,10 +1527,32 @@ func ForKind(kind schema.GroupVersionKind) interface{} { // 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("NodeResourceModel"): + return &resourcev1alpha2.NodeResourceModelApplyConfiguration{} case v1alpha2.SchemeGroupVersion.WithKind("NodeResourceSlice"): return &resourcev1alpha2.NodeResourceSliceApplyConfiguration{} case v1alpha2.SchemeGroupVersion.WithKind("PodSchedulingContext"): @@ -1565,10 +1587,14 @@ func ForKind(kind schema.GroupVersionKind) interface{} { 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("ResourceRequest"): return &resourcev1alpha2.ResourceRequestApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("ResourceRequestModel"): + return &resourcev1alpha2.ResourceRequestModelApplyConfiguration{} case v1alpha2.SchemeGroupVersion.WithKind("StructuredResourceHandle"): return &resourcev1alpha2.StructuredResourceHandleApplyConfiguration{} case v1alpha2.SchemeGroupVersion.WithKind("VendorParameters"): From 4c3285554053b8b9f6f9d64a61fbe15530c9b8d3 Mon Sep 17 00:00:00 2001 From: Patrick Ohly Date: Mon, 4 Mar 2024 09:13:19 +0100 Subject: [PATCH 071/239] dra api: implement semver attribute value type This adds support for semantic version comparison to the CEL support in the "named resources" structured parameter model. For example, it can be used to check that an instance supports a certain API level. To minimize the risk, the new "semver" type is only defined in the CEL environment for DRA expressions, not in the base library. See https://github.com/kubernetes/kubernetes/pull/123664 for a PR which adds it to the base library. Validation of semver strings is done with the regular expression from semver.org. The actual evaluation at runtime then uses semver/v4. Kubernetes-commit: 42ee56f093133402ed860d4c5f54b049041386c9 --- applyconfigurations/internal/internal.go | 3 +++ .../resource/v1alpha2/namedresourcesattribute.go | 8 ++++++++ .../resource/v1alpha2/namedresourcesattributevalue.go | 9 +++++++++ 3 files changed, 20 insertions(+) diff --git a/applyconfigurations/internal/internal.go b/applyconfigurations/internal/internal.go index ca1f4952c..2a3325a32 100644 --- a/applyconfigurations/internal/internal.go +++ b/applyconfigurations/internal/internal.go @@ -12022,6 +12022,9 @@ var schemaYAML = typed.YAMLObject(`types: - name: stringSlice type: namedType: io.k8s.api.resource.v1alpha2.NamedResourcesStringSlice + - name: version + type: + scalar: string - name: io.k8s.api.resource.v1alpha2.NamedResourcesFilter map: fields: diff --git a/applyconfigurations/resource/v1alpha2/namedresourcesattribute.go b/applyconfigurations/resource/v1alpha2/namedresourcesattribute.go index 43cd9044b..d9545d054 100644 --- a/applyconfigurations/resource/v1alpha2/namedresourcesattribute.go +++ b/applyconfigurations/resource/v1alpha2/namedresourcesattribute.go @@ -90,3 +90,11 @@ func (b *NamedResourcesAttributeApplyConfiguration) WithStringSliceValue(value * 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/v1alpha2/namedresourcesattributevalue.go b/applyconfigurations/resource/v1alpha2/namedresourcesattributevalue.go index ad2c7e185..e0b19650a 100644 --- a/applyconfigurations/resource/v1alpha2/namedresourcesattributevalue.go +++ b/applyconfigurations/resource/v1alpha2/namedresourcesattributevalue.go @@ -31,6 +31,7 @@ type NamedResourcesAttributeValueApplyConfiguration struct { IntSliceValue *NamedResourcesIntSliceApplyConfiguration `json:"intSlice,omitempty"` StringValue *string `json:"string,omitempty"` StringSliceValue *NamedResourcesStringSliceApplyConfiguration `json:"stringSlice,omitempty"` + VersionValue *string `json:"version,omitempty"` } // NamedResourcesAttributeValueApplyConfiguration constructs an declarative configuration of the NamedResourcesAttributeValue type for use with @@ -86,3 +87,11 @@ func (b *NamedResourcesAttributeValueApplyConfiguration) WithStringSliceValue(va 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 +} From fee411cff231738d642468b317473bc535ffa55d Mon Sep 17 00:00:00 2001 From: Patrick Ohly Date: Thu, 7 Mar 2024 10:14:11 +0100 Subject: [PATCH 072/239] dra api: rename NodeResourceSlice -> ResourceSlice While currently those objects only get published by the kubelet for node-local resources, this could change once we also support network-attached resources. Dropping the "Node" prefix enables such a future extension. The NodeName in ResourceSlice and StructuredResourceHandle then becomes optional. The kubelet still needs to provide one and it must match its own node name, otherwise it doesn't have permission to access ResourceSlice objects. Kubernetes-commit: 0b6a0d686a060b5d5ff92cea931aacd4eba85adb --- applyconfigurations/internal/internal.go | 48 ++--- ...{noderesourceslice.go => resourceslice.go} | 80 +++---- applyconfigurations/utils.go | 4 +- informers/generic.go | 4 +- informers/resource/v1alpha2/interface.go | 14 +- ...{noderesourceslice.go => resourceslice.go} | 38 ++-- .../v1alpha2/fake/fake_noderesourceslice.go | 145 ------------- .../v1alpha2/fake/fake_resource_client.go | 8 +- .../v1alpha2/fake/fake_resourceslice.go | 145 +++++++++++++ .../resource/v1alpha2/generated_expansion.go | 4 +- .../resource/v1alpha2/noderesourceslice.go | 197 ------------------ .../resource/v1alpha2/resource_client.go | 10 +- .../typed/resource/v1alpha2/resourceslice.go | 197 ++++++++++++++++++ .../resource/v1alpha2/expansion_generated.go | 8 +- .../resource/v1alpha2/noderesourceslice.go | 68 ------ listers/resource/v1alpha2/resourceslice.go | 68 ++++++ 16 files changed, 518 insertions(+), 520 deletions(-) rename applyconfigurations/resource/v1alpha2/{noderesourceslice.go => resourceslice.go} (68%) rename informers/resource/v1alpha2/{noderesourceslice.go => resourceslice.go} (54%) delete mode 100644 kubernetes/typed/resource/v1alpha2/fake/fake_noderesourceslice.go create mode 100644 kubernetes/typed/resource/v1alpha2/fake/fake_resourceslice.go delete mode 100644 kubernetes/typed/resource/v1alpha2/noderesourceslice.go create mode 100644 kubernetes/typed/resource/v1alpha2/resourceslice.go delete mode 100644 listers/resource/v1alpha2/noderesourceslice.go create mode 100644 listers/resource/v1alpha2/resourceslice.go diff --git a/applyconfigurations/internal/internal.go b/applyconfigurations/internal/internal.go index 2a3325a32..197ab1f69 100644 --- a/applyconfigurations/internal/internal.go +++ b/applyconfigurations/internal/internal.go @@ -12079,30 +12079,6 @@ var schemaYAML = typed.YAMLObject(`types: elementType: scalar: string elementRelationship: atomic -- name: io.k8s.api.resource.v1alpha2.NodeResourceSlice - 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: namedResources - type: - namedType: io.k8s.api.resource.v1alpha2.NamedResourcesResources - - name: nodeName - type: - scalar: string - default: "" - name: io.k8s.api.resource.v1alpha2.PodSchedulingContext map: fields: @@ -12399,13 +12375,35 @@ var schemaYAML = typed.YAMLObject(`types: - name: vendorParameters type: namedType: __untyped_atomic_ +- name: io.k8s.api.resource.v1alpha2.ResourceSlice + 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: namedResources + type: + namedType: io.k8s.api.resource.v1alpha2.NamedResourcesResources + - name: nodeName + type: + scalar: string - name: io.k8s.api.resource.v1alpha2.StructuredResourceHandle map: fields: - name: nodeName type: scalar: string - default: "" - name: results type: list: diff --git a/applyconfigurations/resource/v1alpha2/noderesourceslice.go b/applyconfigurations/resource/v1alpha2/resourceslice.go similarity index 68% rename from applyconfigurations/resource/v1alpha2/noderesourceslice.go rename to applyconfigurations/resource/v1alpha2/resourceslice.go index b7d7d9918..91ff2a3e5 100644 --- a/applyconfigurations/resource/v1alpha2/noderesourceslice.go +++ b/applyconfigurations/resource/v1alpha2/resourceslice.go @@ -27,9 +27,9 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// NodeResourceSliceApplyConfiguration represents an declarative configuration of the NodeResourceSlice type for use +// ResourceSliceApplyConfiguration represents an declarative configuration of the ResourceSlice type for use // with apply. -type NodeResourceSliceApplyConfiguration struct { +type ResourceSliceApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` NodeName *string `json:"nodeName,omitempty"` @@ -37,47 +37,47 @@ type NodeResourceSliceApplyConfiguration struct { NodeResourceModelApplyConfiguration `json:",inline"` } -// NodeResourceSlice constructs an declarative configuration of the NodeResourceSlice type for use with +// ResourceSlice constructs an declarative configuration of the ResourceSlice type for use with // apply. -func NodeResourceSlice(name string) *NodeResourceSliceApplyConfiguration { - b := &NodeResourceSliceApplyConfiguration{} +func ResourceSlice(name string) *ResourceSliceApplyConfiguration { + b := &ResourceSliceApplyConfiguration{} b.WithName(name) - b.WithKind("NodeResourceSlice") + b.WithKind("ResourceSlice") b.WithAPIVersion("resource.k8s.io/v1alpha2") return b } -// ExtractNodeResourceSlice extracts the applied configuration owned by fieldManager from -// nodeResourceSlice. If no managedFields are found in nodeResourceSlice for fieldManager, a -// NodeResourceSliceApplyConfiguration is returned with only the Name, Namespace (if applicable), +// ExtractResourceSlice extracts the applied configuration owned by fieldManager from +// resourceSlice. If no managedFields are found in resourceSlice for fieldManager, a +// ResourceSliceApplyConfiguration 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. -// nodeResourceSlice must be a unmodified NodeResourceSlice API object that was retrieved from the Kubernetes API. -// ExtractNodeResourceSlice provides a way to perform a extract/modify-in-place/apply workflow. +// resourceSlice must be a unmodified ResourceSlice API object that was retrieved from the Kubernetes API. +// ExtractResourceSlice 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 ExtractNodeResourceSlice(nodeResourceSlice *resourcev1alpha2.NodeResourceSlice, fieldManager string) (*NodeResourceSliceApplyConfiguration, error) { - return extractNodeResourceSlice(nodeResourceSlice, fieldManager, "") +func ExtractResourceSlice(resourceSlice *resourcev1alpha2.ResourceSlice, fieldManager string) (*ResourceSliceApplyConfiguration, error) { + return extractResourceSlice(resourceSlice, fieldManager, "") } -// ExtractNodeResourceSliceStatus is the same as ExtractNodeResourceSlice except +// ExtractResourceSliceStatus is the same as ExtractResourceSlice except // that it extracts the status subresource applied configuration. // Experimental! -func ExtractNodeResourceSliceStatus(nodeResourceSlice *resourcev1alpha2.NodeResourceSlice, fieldManager string) (*NodeResourceSliceApplyConfiguration, error) { - return extractNodeResourceSlice(nodeResourceSlice, fieldManager, "status") +func ExtractResourceSliceStatus(resourceSlice *resourcev1alpha2.ResourceSlice, fieldManager string) (*ResourceSliceApplyConfiguration, error) { + return extractResourceSlice(resourceSlice, fieldManager, "status") } -func extractNodeResourceSlice(nodeResourceSlice *resourcev1alpha2.NodeResourceSlice, fieldManager string, subresource string) (*NodeResourceSliceApplyConfiguration, error) { - b := &NodeResourceSliceApplyConfiguration{} - err := managedfields.ExtractInto(nodeResourceSlice, internal.Parser().Type("io.k8s.api.resource.v1alpha2.NodeResourceSlice"), fieldManager, b, subresource) +func extractResourceSlice(resourceSlice *resourcev1alpha2.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) if err != nil { return nil, err } - b.WithName(nodeResourceSlice.Name) + b.WithName(resourceSlice.Name) - b.WithKind("NodeResourceSlice") + b.WithKind("ResourceSlice") b.WithAPIVersion("resource.k8s.io/v1alpha2") return b, nil } @@ -85,7 +85,7 @@ func extractNodeResourceSlice(nodeResourceSlice *resourcev1alpha2.NodeResourceSl // 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 *NodeResourceSliceApplyConfiguration) WithKind(value string) *NodeResourceSliceApplyConfiguration { +func (b *ResourceSliceApplyConfiguration) WithKind(value string) *ResourceSliceApplyConfiguration { b.Kind = &value return b } @@ -93,7 +93,7 @@ func (b *NodeResourceSliceApplyConfiguration) WithKind(value string) *NodeResour // 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 *NodeResourceSliceApplyConfiguration) WithAPIVersion(value string) *NodeResourceSliceApplyConfiguration { +func (b *ResourceSliceApplyConfiguration) WithAPIVersion(value string) *ResourceSliceApplyConfiguration { b.APIVersion = &value return b } @@ -101,7 +101,7 @@ func (b *NodeResourceSliceApplyConfiguration) WithAPIVersion(value string) *Node // 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 *NodeResourceSliceApplyConfiguration) WithName(value string) *NodeResourceSliceApplyConfiguration { +func (b *ResourceSliceApplyConfiguration) WithName(value string) *ResourceSliceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b @@ -110,7 +110,7 @@ func (b *NodeResourceSliceApplyConfiguration) WithName(value string) *NodeResour // 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 *NodeResourceSliceApplyConfiguration) WithGenerateName(value string) *NodeResourceSliceApplyConfiguration { +func (b *ResourceSliceApplyConfiguration) WithGenerateName(value string) *ResourceSliceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b @@ -119,7 +119,7 @@ func (b *NodeResourceSliceApplyConfiguration) WithGenerateName(value string) *No // 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 *NodeResourceSliceApplyConfiguration) WithNamespace(value string) *NodeResourceSliceApplyConfiguration { +func (b *ResourceSliceApplyConfiguration) WithNamespace(value string) *ResourceSliceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b @@ -128,7 +128,7 @@ func (b *NodeResourceSliceApplyConfiguration) WithNamespace(value string) *NodeR // 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 *NodeResourceSliceApplyConfiguration) WithUID(value types.UID) *NodeResourceSliceApplyConfiguration { +func (b *ResourceSliceApplyConfiguration) WithUID(value types.UID) *ResourceSliceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b @@ -137,7 +137,7 @@ func (b *NodeResourceSliceApplyConfiguration) WithUID(value types.UID) *NodeReso // 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 *NodeResourceSliceApplyConfiguration) WithResourceVersion(value string) *NodeResourceSliceApplyConfiguration { +func (b *ResourceSliceApplyConfiguration) WithResourceVersion(value string) *ResourceSliceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b @@ -146,7 +146,7 @@ func (b *NodeResourceSliceApplyConfiguration) WithResourceVersion(value string) // 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 *NodeResourceSliceApplyConfiguration) WithGeneration(value int64) *NodeResourceSliceApplyConfiguration { +func (b *ResourceSliceApplyConfiguration) WithGeneration(value int64) *ResourceSliceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b @@ -155,7 +155,7 @@ func (b *NodeResourceSliceApplyConfiguration) WithGeneration(value int64) *NodeR // 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 *NodeResourceSliceApplyConfiguration) WithCreationTimestamp(value metav1.Time) *NodeResourceSliceApplyConfiguration { +func (b *ResourceSliceApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ResourceSliceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b @@ -164,7 +164,7 @@ func (b *NodeResourceSliceApplyConfiguration) WithCreationTimestamp(value metav1 // 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 *NodeResourceSliceApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *NodeResourceSliceApplyConfiguration { +func (b *ResourceSliceApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ResourceSliceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b @@ -173,7 +173,7 @@ func (b *NodeResourceSliceApplyConfiguration) WithDeletionTimestamp(value metav1 // 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 *NodeResourceSliceApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *NodeResourceSliceApplyConfiguration { +func (b *ResourceSliceApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ResourceSliceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b @@ -183,7 +183,7 @@ func (b *NodeResourceSliceApplyConfiguration) WithDeletionGracePeriodSeconds(val // 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 *NodeResourceSliceApplyConfiguration) WithLabels(entries map[string]string) *NodeResourceSliceApplyConfiguration { +func (b *ResourceSliceApplyConfiguration) WithLabels(entries map[string]string) *ResourceSliceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) @@ -198,7 +198,7 @@ func (b *NodeResourceSliceApplyConfiguration) WithLabels(entries map[string]stri // 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 *NodeResourceSliceApplyConfiguration) WithAnnotations(entries map[string]string) *NodeResourceSliceApplyConfiguration { +func (b *ResourceSliceApplyConfiguration) WithAnnotations(entries map[string]string) *ResourceSliceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) @@ -212,7 +212,7 @@ func (b *NodeResourceSliceApplyConfiguration) WithAnnotations(entries map[string // 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 *NodeResourceSliceApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *NodeResourceSliceApplyConfiguration { +func (b *ResourceSliceApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ResourceSliceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { @@ -226,7 +226,7 @@ func (b *NodeResourceSliceApplyConfiguration) WithOwnerReferences(values ...*v1. // 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 *NodeResourceSliceApplyConfiguration) WithFinalizers(values ...string) *NodeResourceSliceApplyConfiguration { +func (b *ResourceSliceApplyConfiguration) WithFinalizers(values ...string) *ResourceSliceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) @@ -234,7 +234,7 @@ func (b *NodeResourceSliceApplyConfiguration) WithFinalizers(values ...string) * return b } -func (b *NodeResourceSliceApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { +func (b *ResourceSliceApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } @@ -243,7 +243,7 @@ func (b *NodeResourceSliceApplyConfiguration) ensureObjectMetaApplyConfiguration // 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 *NodeResourceSliceApplyConfiguration) WithNodeName(value string) *NodeResourceSliceApplyConfiguration { +func (b *ResourceSliceApplyConfiguration) WithNodeName(value string) *ResourceSliceApplyConfiguration { b.NodeName = &value return b } @@ -251,7 +251,7 @@ func (b *NodeResourceSliceApplyConfiguration) WithNodeName(value string) *NodeRe // 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 *NodeResourceSliceApplyConfiguration) WithDriverName(value string) *NodeResourceSliceApplyConfiguration { +func (b *ResourceSliceApplyConfiguration) WithDriverName(value string) *ResourceSliceApplyConfiguration { b.DriverName = &value return b } @@ -259,7 +259,7 @@ func (b *NodeResourceSliceApplyConfiguration) WithDriverName(value string) *Node // 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 *NodeResourceSliceApplyConfiguration) WithNamedResources(value *NamedResourcesResourcesApplyConfiguration) *NodeResourceSliceApplyConfiguration { +func (b *ResourceSliceApplyConfiguration) WithNamedResources(value *NamedResourcesResourcesApplyConfiguration) *ResourceSliceApplyConfiguration { b.NamedResources = value return b } diff --git a/applyconfigurations/utils.go b/applyconfigurations/utils.go index 72547bde9..07f81c8f6 100644 --- a/applyconfigurations/utils.go +++ b/applyconfigurations/utils.go @@ -1553,8 +1553,6 @@ func ForKind(kind schema.GroupVersionKind) interface{} { return &resourcev1alpha2.NamedResourcesStringSliceApplyConfiguration{} case v1alpha2.SchemeGroupVersion.WithKind("NodeResourceModel"): return &resourcev1alpha2.NodeResourceModelApplyConfiguration{} - case v1alpha2.SchemeGroupVersion.WithKind("NodeResourceSlice"): - return &resourcev1alpha2.NodeResourceSliceApplyConfiguration{} case v1alpha2.SchemeGroupVersion.WithKind("PodSchedulingContext"): return &resourcev1alpha2.PodSchedulingContextApplyConfiguration{} case v1alpha2.SchemeGroupVersion.WithKind("PodSchedulingContextSpec"): @@ -1595,6 +1593,8 @@ func ForKind(kind schema.GroupVersionKind) interface{} { 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"): diff --git a/informers/generic.go b/informers/generic.go index 37e928e8d..297633c23 100644 --- a/informers/generic.go +++ b/informers/generic.go @@ -362,8 +362,6 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource return &genericInformer{resource: resource.GroupResource(), informer: f.Rbac().V1beta1().RoleBindings().Informer()}, nil // Group=resource.k8s.io, Version=v1alpha2 - case v1alpha2.SchemeGroupVersion.WithResource("noderesourceslices"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Resource().V1alpha2().NodeResourceSlices().Informer()}, nil case v1alpha2.SchemeGroupVersion.WithResource("podschedulingcontexts"): return &genericInformer{resource: resource.GroupResource(), informer: f.Resource().V1alpha2().PodSchedulingContexts().Informer()}, nil case v1alpha2.SchemeGroupVersion.WithResource("resourceclaims"): @@ -376,6 +374,8 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource 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=scheduling.k8s.io, Version=v1 case schedulingv1.SchemeGroupVersion.WithResource("priorityclasses"): diff --git a/informers/resource/v1alpha2/interface.go b/informers/resource/v1alpha2/interface.go index 29d4a7c66..aa4a5ae7d 100644 --- a/informers/resource/v1alpha2/interface.go +++ b/informers/resource/v1alpha2/interface.go @@ -24,8 +24,6 @@ import ( // Interface provides access to all the informers in this group version. type Interface interface { - // NodeResourceSlices returns a NodeResourceSliceInformer. - NodeResourceSlices() NodeResourceSliceInformer // PodSchedulingContexts returns a PodSchedulingContextInformer. PodSchedulingContexts() PodSchedulingContextInformer // ResourceClaims returns a ResourceClaimInformer. @@ -38,6 +36,8 @@ type Interface interface { ResourceClasses() ResourceClassInformer // ResourceClassParameters returns a ResourceClassParametersInformer. ResourceClassParameters() ResourceClassParametersInformer + // ResourceSlices returns a ResourceSliceInformer. + ResourceSlices() ResourceSliceInformer } type version struct { @@ -51,11 +51,6 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } -// NodeResourceSlices returns a NodeResourceSliceInformer. -func (v *version) NodeResourceSlices() NodeResourceSliceInformer { - return &nodeResourceSliceInformer{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} @@ -85,3 +80,8 @@ func (v *version) ResourceClasses() ResourceClassInformer { 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/v1alpha2/noderesourceslice.go b/informers/resource/v1alpha2/resourceslice.go similarity index 54% rename from informers/resource/v1alpha2/noderesourceslice.go rename to informers/resource/v1alpha2/resourceslice.go index e4e6197d1..da9d2a024 100644 --- a/informers/resource/v1alpha2/noderesourceslice.go +++ b/informers/resource/v1alpha2/resourceslice.go @@ -32,58 +32,58 @@ import ( cache "k8s.io/client-go/tools/cache" ) -// NodeResourceSliceInformer provides access to a shared informer and lister for -// NodeResourceSlices. -type NodeResourceSliceInformer interface { +// ResourceSliceInformer provides access to a shared informer and lister for +// ResourceSlices. +type ResourceSliceInformer interface { Informer() cache.SharedIndexInformer - Lister() v1alpha2.NodeResourceSliceLister + Lister() v1alpha2.ResourceSliceLister } -type nodeResourceSliceInformer struct { +type resourceSliceInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc } -// NewNodeResourceSliceInformer constructs a new informer for NodeResourceSlice type. +// NewResourceSliceInformer constructs a new informer for ResourceSlice 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 NewNodeResourceSliceInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredNodeResourceSliceInformer(client, resyncPeriod, indexers, nil) +func NewResourceSliceInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredResourceSliceInformer(client, resyncPeriod, indexers, nil) } -// NewFilteredNodeResourceSliceInformer constructs a new informer for NodeResourceSlice type. +// NewFilteredResourceSliceInformer constructs a new informer for ResourceSlice 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 NewFilteredNodeResourceSliceInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { +func NewFilteredResourceSliceInformer(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.ResourceV1alpha2().NodeResourceSlices().List(context.TODO(), options) + return client.ResourceV1alpha2().ResourceSlices().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.ResourceV1alpha2().NodeResourceSlices().Watch(context.TODO(), options) + return client.ResourceV1alpha2().ResourceSlices().Watch(context.TODO(), options) }, }, - &resourcev1alpha2.NodeResourceSlice{}, + &resourcev1alpha2.ResourceSlice{}, resyncPeriod, indexers, ) } -func (f *nodeResourceSliceInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredNodeResourceSliceInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +func (f *resourceSliceInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredResourceSliceInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } -func (f *nodeResourceSliceInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&resourcev1alpha2.NodeResourceSlice{}, f.defaultInformer) +func (f *resourceSliceInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&resourcev1alpha2.ResourceSlice{}, f.defaultInformer) } -func (f *nodeResourceSliceInformer) Lister() v1alpha2.NodeResourceSliceLister { - return v1alpha2.NewNodeResourceSliceLister(f.Informer().GetIndexer()) +func (f *resourceSliceInformer) Lister() v1alpha2.ResourceSliceLister { + return v1alpha2.NewResourceSliceLister(f.Informer().GetIndexer()) } diff --git a/kubernetes/typed/resource/v1alpha2/fake/fake_noderesourceslice.go b/kubernetes/typed/resource/v1alpha2/fake/fake_noderesourceslice.go deleted file mode 100644 index 13ec45b6f..000000000 --- a/kubernetes/typed/resource/v1alpha2/fake/fake_noderesourceslice.go +++ /dev/null @@ -1,145 +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" - - v1alpha2 "k8s.io/api/resource/v1alpha2" - 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" - testing "k8s.io/client-go/testing" -) - -// FakeNodeResourceSlices implements NodeResourceSliceInterface -type FakeNodeResourceSlices struct { - Fake *FakeResourceV1alpha2 -} - -var noderesourceslicesResource = v1alpha2.SchemeGroupVersion.WithResource("noderesourceslices") - -var noderesourceslicesKind = v1alpha2.SchemeGroupVersion.WithKind("NodeResourceSlice") - -// Get takes name of the nodeResourceSlice, and returns the corresponding nodeResourceSlice object, and an error if there is any. -func (c *FakeNodeResourceSlices) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.NodeResourceSlice, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootGetAction(noderesourceslicesResource, name), &v1alpha2.NodeResourceSlice{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha2.NodeResourceSlice), err -} - -// List takes label and field selectors, and returns the list of NodeResourceSlices that match those selectors. -func (c *FakeNodeResourceSlices) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.NodeResourceSliceList, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootListAction(noderesourceslicesResource, noderesourceslicesKind, opts), &v1alpha2.NodeResourceSliceList{}) - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha2.NodeResourceSliceList{ListMeta: obj.(*v1alpha2.NodeResourceSliceList).ListMeta} - for _, item := range obj.(*v1alpha2.NodeResourceSliceList).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 nodeResourceSlices. -func (c *FakeNodeResourceSlices) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchAction(noderesourceslicesResource, opts)) -} - -// Create takes the representation of a nodeResourceSlice and creates it. Returns the server's representation of the nodeResourceSlice, and an error, if there is any. -func (c *FakeNodeResourceSlices) Create(ctx context.Context, nodeResourceSlice *v1alpha2.NodeResourceSlice, opts v1.CreateOptions) (result *v1alpha2.NodeResourceSlice, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(noderesourceslicesResource, nodeResourceSlice), &v1alpha2.NodeResourceSlice{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha2.NodeResourceSlice), err -} - -// Update takes the representation of a nodeResourceSlice and updates it. Returns the server's representation of the nodeResourceSlice, and an error, if there is any. -func (c *FakeNodeResourceSlices) Update(ctx context.Context, nodeResourceSlice *v1alpha2.NodeResourceSlice, opts v1.UpdateOptions) (result *v1alpha2.NodeResourceSlice, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(noderesourceslicesResource, nodeResourceSlice), &v1alpha2.NodeResourceSlice{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha2.NodeResourceSlice), err -} - -// Delete takes name of the nodeResourceSlice and deletes it. Returns an error if one occurs. -func (c *FakeNodeResourceSlices) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(noderesourceslicesResource, name, opts), &v1alpha2.NodeResourceSlice{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeNodeResourceSlices) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(noderesourceslicesResource, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha2.NodeResourceSliceList{}) - return err -} - -// Patch applies the patch and returns the patched nodeResourceSlice. -func (c *FakeNodeResourceSlices) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.NodeResourceSlice, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(noderesourceslicesResource, name, pt, data, subresources...), &v1alpha2.NodeResourceSlice{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha2.NodeResourceSlice), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied nodeResourceSlice. -func (c *FakeNodeResourceSlices) Apply(ctx context.Context, nodeResourceSlice *resourcev1alpha2.NodeResourceSliceApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.NodeResourceSlice, err error) { - if nodeResourceSlice == nil { - return nil, fmt.Errorf("nodeResourceSlice provided to Apply must not be nil") - } - data, err := json.Marshal(nodeResourceSlice) - if err != nil { - return nil, err - } - name := nodeResourceSlice.Name - if name == nil { - return nil, fmt.Errorf("nodeResourceSlice.Name must be provided to Apply") - } - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(noderesourceslicesResource, *name, types.ApplyPatchType, data), &v1alpha2.NodeResourceSlice{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha2.NodeResourceSlice), err -} diff --git a/kubernetes/typed/resource/v1alpha2/fake/fake_resource_client.go b/kubernetes/typed/resource/v1alpha2/fake/fake_resource_client.go index c26af9ecd..6f69d0fa7 100644 --- a/kubernetes/typed/resource/v1alpha2/fake/fake_resource_client.go +++ b/kubernetes/typed/resource/v1alpha2/fake/fake_resource_client.go @@ -28,10 +28,6 @@ type FakeResourceV1alpha2 struct { *testing.Fake } -func (c *FakeResourceV1alpha2) NodeResourceSlices() v1alpha2.NodeResourceSliceInterface { - return &FakeNodeResourceSlices{c} -} - func (c *FakeResourceV1alpha2) PodSchedulingContexts(namespace string) v1alpha2.PodSchedulingContextInterface { return &FakePodSchedulingContexts{c, namespace} } @@ -56,6 +52,10 @@ func (c *FakeResourceV1alpha2) ResourceClassParameters(namespace string) v1alpha return &FakeResourceClassParameters{c, namespace} } +func (c *FakeResourceV1alpha2) ResourceSlices() v1alpha2.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 { diff --git a/kubernetes/typed/resource/v1alpha2/fake/fake_resourceslice.go b/kubernetes/typed/resource/v1alpha2/fake/fake_resourceslice.go new file mode 100644 index 000000000..325e729e9 --- /dev/null +++ b/kubernetes/typed/resource/v1alpha2/fake/fake_resourceslice.go @@ -0,0 +1,145 @@ +/* +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" + + v1alpha2 "k8s.io/api/resource/v1alpha2" + 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" + testing "k8s.io/client-go/testing" +) + +// FakeResourceSlices implements ResourceSliceInterface +type FakeResourceSlices struct { + Fake *FakeResourceV1alpha2 +} + +var resourceslicesResource = v1alpha2.SchemeGroupVersion.WithResource("resourceslices") + +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) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(resourceslicesResource, name), &v1alpha2.ResourceSlice{}) + if obj == nil { + return nil, 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) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(resourceslicesResource, resourceslicesKind, opts), &v1alpha2.ResourceSliceList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1alpha2.ResourceSliceList{ListMeta: obj.(*v1alpha2.ResourceSliceList).ListMeta} + for _, item := range obj.(*v1alpha2.ResourceSliceList).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 resourceSlices. +func (c *FakeResourceSlices) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(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) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(resourceslicesResource, resourceSlice), &v1alpha2.ResourceSlice{}) + if obj == nil { + return nil, 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) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(resourceslicesResource, resourceSlice), &v1alpha2.ResourceSlice{}) + if obj == nil { + return nil, err + } + return obj.(*v1alpha2.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{}) + return err +} + +// 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) + + _, err := c.Fake.Invokes(action, &v1alpha2.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) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(resourceslicesResource, name, pt, data, subresources...), &v1alpha2.ResourceSlice{}) + if obj == nil { + return nil, err + } + return obj.(*v1alpha2.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) { + if resourceSlice == nil { + return nil, fmt.Errorf("resourceSlice provided to Apply must not be nil") + } + 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") + } + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(resourceslicesResource, *name, types.ApplyPatchType, data), &v1alpha2.ResourceSlice{}) + if obj == nil { + return nil, err + } + return obj.(*v1alpha2.ResourceSlice), err +} diff --git a/kubernetes/typed/resource/v1alpha2/generated_expansion.go b/kubernetes/typed/resource/v1alpha2/generated_expansion.go index abb4d7004..d11410bb9 100644 --- a/kubernetes/typed/resource/v1alpha2/generated_expansion.go +++ b/kubernetes/typed/resource/v1alpha2/generated_expansion.go @@ -18,8 +18,6 @@ limitations under the License. package v1alpha2 -type NodeResourceSliceExpansion interface{} - type PodSchedulingContextExpansion interface{} type ResourceClaimExpansion interface{} @@ -31,3 +29,5 @@ type ResourceClaimTemplateExpansion interface{} type ResourceClassExpansion interface{} type ResourceClassParametersExpansion interface{} + +type ResourceSliceExpansion interface{} diff --git a/kubernetes/typed/resource/v1alpha2/noderesourceslice.go b/kubernetes/typed/resource/v1alpha2/noderesourceslice.go deleted file mode 100644 index 491f63e7c..000000000 --- a/kubernetes/typed/resource/v1alpha2/noderesourceslice.go +++ /dev/null @@ -1,197 +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 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" - scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" -) - -// NodeResourceSlicesGetter has a method to return a NodeResourceSliceInterface. -// A group's client should implement this interface. -type NodeResourceSlicesGetter interface { - NodeResourceSlices() NodeResourceSliceInterface -} - -// NodeResourceSliceInterface has methods to work with NodeResourceSlice resources. -type NodeResourceSliceInterface interface { - Create(ctx context.Context, nodeResourceSlice *v1alpha2.NodeResourceSlice, opts v1.CreateOptions) (*v1alpha2.NodeResourceSlice, error) - Update(ctx context.Context, nodeResourceSlice *v1alpha2.NodeResourceSlice, opts v1.UpdateOptions) (*v1alpha2.NodeResourceSlice, 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.NodeResourceSlice, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha2.NodeResourceSliceList, 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.NodeResourceSlice, err error) - Apply(ctx context.Context, nodeResourceSlice *resourcev1alpha2.NodeResourceSliceApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.NodeResourceSlice, err error) - NodeResourceSliceExpansion -} - -// nodeResourceSlices implements NodeResourceSliceInterface -type nodeResourceSlices struct { - client rest.Interface -} - -// newNodeResourceSlices returns a NodeResourceSlices -func newNodeResourceSlices(c *ResourceV1alpha2Client) *nodeResourceSlices { - return &nodeResourceSlices{ - client: c.RESTClient(), - } -} - -// Get takes name of the nodeResourceSlice, and returns the corresponding nodeResourceSlice object, and an error if there is any. -func (c *nodeResourceSlices) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.NodeResourceSlice, err error) { - result = &v1alpha2.NodeResourceSlice{} - err = c.client.Get(). - Resource("noderesourceslices"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of NodeResourceSlices that match those selectors. -func (c *nodeResourceSlices) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.NodeResourceSliceList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha2.NodeResourceSliceList{} - err = c.client.Get(). - Resource("noderesourceslices"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested nodeResourceSlices. -func (c *nodeResourceSlices) 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("noderesourceslices"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a nodeResourceSlice and creates it. Returns the server's representation of the nodeResourceSlice, and an error, if there is any. -func (c *nodeResourceSlices) Create(ctx context.Context, nodeResourceSlice *v1alpha2.NodeResourceSlice, opts v1.CreateOptions) (result *v1alpha2.NodeResourceSlice, err error) { - result = &v1alpha2.NodeResourceSlice{} - err = c.client.Post(). - Resource("noderesourceslices"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(nodeResourceSlice). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a nodeResourceSlice and updates it. Returns the server's representation of the nodeResourceSlice, and an error, if there is any. -func (c *nodeResourceSlices) Update(ctx context.Context, nodeResourceSlice *v1alpha2.NodeResourceSlice, opts v1.UpdateOptions) (result *v1alpha2.NodeResourceSlice, err error) { - result = &v1alpha2.NodeResourceSlice{} - err = c.client.Put(). - Resource("noderesourceslices"). - Name(nodeResourceSlice.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(nodeResourceSlice). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the nodeResourceSlice and deletes it. Returns an error if one occurs. -func (c *nodeResourceSlices) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Resource("noderesourceslices"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *nodeResourceSlices) 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("noderesourceslices"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched nodeResourceSlice. -func (c *nodeResourceSlices) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.NodeResourceSlice, err error) { - result = &v1alpha2.NodeResourceSlice{} - err = c.client.Patch(pt). - Resource("noderesourceslices"). - 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 nodeResourceSlice. -func (c *nodeResourceSlices) Apply(ctx context.Context, nodeResourceSlice *resourcev1alpha2.NodeResourceSliceApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.NodeResourceSlice, err error) { - if nodeResourceSlice == nil { - return nil, fmt.Errorf("nodeResourceSlice provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(nodeResourceSlice) - if err != nil { - return nil, err - } - name := nodeResourceSlice.Name - if name == nil { - return nil, fmt.Errorf("nodeResourceSlice.Name must be provided to Apply") - } - result = &v1alpha2.NodeResourceSlice{} - err = c.client.Patch(types.ApplyPatchType). - Resource("noderesourceslices"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/resource/v1alpha2/resource_client.go b/kubernetes/typed/resource/v1alpha2/resource_client.go index 2a5c35855..8e258b3e1 100644 --- a/kubernetes/typed/resource/v1alpha2/resource_client.go +++ b/kubernetes/typed/resource/v1alpha2/resource_client.go @@ -28,13 +28,13 @@ import ( type ResourceV1alpha2Interface interface { RESTClient() rest.Interface - NodeResourceSlicesGetter PodSchedulingContextsGetter ResourceClaimsGetter ResourceClaimParametersGetter ResourceClaimTemplatesGetter ResourceClassesGetter ResourceClassParametersGetter + ResourceSlicesGetter } // ResourceV1alpha2Client is used to interact with features provided by the resource.k8s.io group. @@ -42,10 +42,6 @@ type ResourceV1alpha2Client struct { restClient rest.Interface } -func (c *ResourceV1alpha2Client) NodeResourceSlices() NodeResourceSliceInterface { - return newNodeResourceSlices(c) -} - func (c *ResourceV1alpha2Client) PodSchedulingContexts(namespace string) PodSchedulingContextInterface { return newPodSchedulingContexts(c, namespace) } @@ -70,6 +66,10 @@ func (c *ResourceV1alpha2Client) ResourceClassParameters(namespace string) Resou return newResourceClassParameters(c, namespace) } +func (c *ResourceV1alpha2Client) ResourceSlices() ResourceSliceInterface { + return newResourceSlices(c) +} + // NewForConfig creates a new ResourceV1alpha2Client for the given config. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). diff --git a/kubernetes/typed/resource/v1alpha2/resourceslice.go b/kubernetes/typed/resource/v1alpha2/resourceslice.go new file mode 100644 index 000000000..302f370d5 --- /dev/null +++ b/kubernetes/typed/resource/v1alpha2/resourceslice.go @@ -0,0 +1,197 @@ +/* +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 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" + scheme "k8s.io/client-go/kubernetes/scheme" + rest "k8s.io/client-go/rest" +) + +// ResourceSlicesGetter has a method to return a ResourceSliceInterface. +// A group's client should implement this interface. +type ResourceSlicesGetter interface { + ResourceSlices() ResourceSliceInterface +} + +// 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) + 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) + 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) + ResourceSliceExpansion +} + +// resourceSlices implements ResourceSliceInterface +type resourceSlices struct { + client rest.Interface +} + +// newResourceSlices returns a ResourceSlices +func newResourceSlices(c *ResourceV1alpha2Client) *resourceSlices { + return &resourceSlices{ + client: c.RESTClient(), + } +} + +// 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) (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 +} + +// 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/listers/resource/v1alpha2/expansion_generated.go b/listers/resource/v1alpha2/expansion_generated.go index dd8a21755..68861832d 100644 --- a/listers/resource/v1alpha2/expansion_generated.go +++ b/listers/resource/v1alpha2/expansion_generated.go @@ -18,10 +18,6 @@ limitations under the License. package v1alpha2 -// NodeResourceSliceListerExpansion allows custom methods to be added to -// NodeResourceSliceLister. -type NodeResourceSliceListerExpansion interface{} - // PodSchedulingContextListerExpansion allows custom methods to be added to // PodSchedulingContextLister. type PodSchedulingContextListerExpansion interface{} @@ -65,3 +61,7 @@ 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/v1alpha2/noderesourceslice.go b/listers/resource/v1alpha2/noderesourceslice.go deleted file mode 100644 index f5853499a..000000000 --- a/listers/resource/v1alpha2/noderesourceslice.go +++ /dev/null @@ -1,68 +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 v1alpha2 - -import ( - v1alpha2 "k8s.io/api/resource/v1alpha2" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/tools/cache" -) - -// NodeResourceSliceLister helps list NodeResourceSlices. -// All objects returned here must be treated as read-only. -type NodeResourceSliceLister interface { - // List lists all NodeResourceSlices in the indexer. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha2.NodeResourceSlice, err error) - // Get retrieves the NodeResourceSlice from the index for a given name. - // Objects returned here must be treated as read-only. - Get(name string) (*v1alpha2.NodeResourceSlice, error) - NodeResourceSliceListerExpansion -} - -// nodeResourceSliceLister implements the NodeResourceSliceLister interface. -type nodeResourceSliceLister struct { - indexer cache.Indexer -} - -// NewNodeResourceSliceLister returns a new NodeResourceSliceLister. -func NewNodeResourceSliceLister(indexer cache.Indexer) NodeResourceSliceLister { - return &nodeResourceSliceLister{indexer: indexer} -} - -// List lists all NodeResourceSlices in the indexer. -func (s *nodeResourceSliceLister) List(selector labels.Selector) (ret []*v1alpha2.NodeResourceSlice, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha2.NodeResourceSlice)) - }) - return ret, err -} - -// Get retrieves the NodeResourceSlice from the index for a given name. -func (s *nodeResourceSliceLister) Get(name string) (*v1alpha2.NodeResourceSlice, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha2.Resource("noderesourceslice"), name) - } - return obj.(*v1alpha2.NodeResourceSlice), nil -} diff --git a/listers/resource/v1alpha2/resourceslice.go b/listers/resource/v1alpha2/resourceslice.go new file mode 100644 index 000000000..4301cea2e --- /dev/null +++ b/listers/resource/v1alpha2/resourceslice.go @@ -0,0 +1,68 @@ +/* +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 v1alpha2 + +import ( + v1alpha2 "k8s.io/api/resource/v1alpha2" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ResourceSliceLister helps list ResourceSlices. +// All objects returned here must be treated as read-only. +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) + // 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) + ResourceSliceListerExpansion +} + +// resourceSliceLister implements the ResourceSliceLister interface. +type resourceSliceLister struct { + indexer cache.Indexer +} + +// 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 +} From d2c6177154437cf28b06059688fb7a619d87c163 Mon Sep 17 00:00:00 2001 From: Kubernetes Publisher Date: Thu, 7 Mar 2024 14:49:20 -0800 Subject: [PATCH 073/239] Merge pull request #123412 from tenzen-y/add-new-jobsuccesspolicy-api Job: Support for the SuccessPolicy Kubernetes-commit: 364ef335dbd49bfa3d66dbc606c642481d283851 --- go.mod | 8 ++++---- go.sum | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/go.mod b/go.mod index 2e753046a..066de1209 100644 --- a/go.mod +++ b/go.mod @@ -24,8 +24,8 @@ require ( golang.org/x/term v0.17.0 golang.org/x/time v0.3.0 google.golang.org/protobuf v1.33.0 - k8s.io/api v0.0.0-20240307045517-1d33fcde6f3f - k8s.io/apimachinery v0.0.0-20240307044802-25164f774551 + k8s.io/api v0.0.0-20240307235618-1cabcc10ad5a + k8s.io/apimachinery v0.0.0-20240307171817-d82afe1e363a k8s.io/klog/v2 v2.120.1 k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 k8s.io/utils v0.0.0-20230726121419-3b25d923346b @@ -61,6 +61,6 @@ require ( ) replace ( - k8s.io/api => k8s.io/api v0.0.0-20240307045517-1d33fcde6f3f - k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20240307044802-25164f774551 + k8s.io/api => k8s.io/api v0.0.0-20240307235618-1cabcc10ad5a + k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20240307171817-d82afe1e363a ) diff --git a/go.sum b/go.sum index 403e5e26f..3b5170ddb 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-20240307045517-1d33fcde6f3f h1:AZBD10PF/cNxYJJgh8fMrENM3UItvPkMO18LB0dTrV8= -k8s.io/api v0.0.0-20240307045517-1d33fcde6f3f/go.mod h1:qUUt5cHNc6u/2o6gcfyGSFTAK8Ca4QD40QqESHedUoc= -k8s.io/apimachinery v0.0.0-20240307044802-25164f774551 h1:uzmc7GC/4uB5xeS8MaTO/UgsFRt2eepWEh0EIg1Og5c= -k8s.io/apimachinery v0.0.0-20240307044802-25164f774551/go.mod h1:wEJvNDlfxMRaMhyv38SIHIEC9hah/xuzqUUhxIyUv7Y= +k8s.io/api v0.0.0-20240307235618-1cabcc10ad5a h1:Whyv7ab6OoILUe9IF6qIPx9JNnQX0CBUL3RqZ0sWDYY= +k8s.io/api v0.0.0-20240307235618-1cabcc10ad5a/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/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 b0efa42e529fb54ba15ca1f2efcd00deeac1dc67 Mon Sep 17 00:00:00 2001 From: Nilekh Chaudhari <1626598+nilekhc@users.noreply.github.com> Date: Tue, 10 Oct 2023 20:23:08 +0000 Subject: [PATCH 074/239] feat: implements Storage Version Migration API in-tree Signed-off-by: Nilekh Chaudhari <1626598+nilekhc@users.noreply.github.com> Kubernetes-commit: 91a7708cdcea8cdb1d7db2cc8a27c57741e0cddc --- applyconfigurations/internal/internal.go | 77 ++++++ .../v1alpha1/groupversionresource.go | 57 ++++ .../v1alpha1/migrationcondition.go | 81 ++++++ .../v1alpha1/storageversionmigration.go | 256 ++++++++++++++++++ .../v1alpha1/storageversionmigrationspec.go | 48 ++++ .../v1alpha1/storageversionmigrationstatus.go | 53 ++++ applyconfigurations/utils.go | 14 + informers/factory.go | 6 + informers/generic.go | 5 + informers/storagemigration/interface.go | 46 ++++ .../storagemigration/v1alpha1/interface.go | 45 +++ .../v1alpha1/storageversionmigration.go | 89 ++++++ kubernetes/clientset.go | 13 + kubernetes/fake/clientset_generated.go | 7 + kubernetes/fake/register.go | 2 + kubernetes/scheme/register.go | 2 + .../typed/storagemigration/v1alpha1/doc.go | 20 ++ .../storagemigration/v1alpha1/fake/doc.go | 20 ++ .../fake/fake_storagemigration_client.go | 40 +++ .../fake/fake_storageversionmigration.go | 178 ++++++++++++ .../v1alpha1/generated_expansion.go | 21 ++ .../v1alpha1/storagemigration_client.go | 107 ++++++++ .../v1alpha1/storageversionmigration.go | 243 +++++++++++++++++ .../v1alpha1/expansion_generated.go | 23 ++ .../v1alpha1/storageversionmigration.go | 68 +++++ 25 files changed, 1521 insertions(+) create mode 100644 applyconfigurations/storagemigration/v1alpha1/groupversionresource.go create mode 100644 applyconfigurations/storagemigration/v1alpha1/migrationcondition.go create mode 100644 applyconfigurations/storagemigration/v1alpha1/storageversionmigration.go create mode 100644 applyconfigurations/storagemigration/v1alpha1/storageversionmigrationspec.go create mode 100644 applyconfigurations/storagemigration/v1alpha1/storageversionmigrationstatus.go create mode 100644 informers/storagemigration/interface.go create mode 100644 informers/storagemigration/v1alpha1/interface.go create mode 100644 informers/storagemigration/v1alpha1/storageversionmigration.go create mode 100644 kubernetes/typed/storagemigration/v1alpha1/doc.go create mode 100644 kubernetes/typed/storagemigration/v1alpha1/fake/doc.go create mode 100644 kubernetes/typed/storagemigration/v1alpha1/fake/fake_storagemigration_client.go create mode 100644 kubernetes/typed/storagemigration/v1alpha1/fake/fake_storageversionmigration.go create mode 100644 kubernetes/typed/storagemigration/v1alpha1/generated_expansion.go create mode 100644 kubernetes/typed/storagemigration/v1alpha1/storagemigration_client.go create mode 100644 kubernetes/typed/storagemigration/v1alpha1/storageversionmigration.go create mode 100644 listers/storagemigration/v1alpha1/expansion_generated.go create mode 100644 listers/storagemigration/v1alpha1/storageversionmigration.go diff --git a/applyconfigurations/internal/internal.go b/applyconfigurations/internal/internal.go index 197ab1f69..62a8e823a 100644 --- a/applyconfigurations/internal/internal.go +++ b/applyconfigurations/internal/internal.go @@ -13133,6 +13133,83 @@ var schemaYAML = typed.YAMLObject(`types: - name: count type: scalar: numeric +- name: io.k8s.api.storagemigration.v1alpha1.GroupVersionResource + map: + fields: + - name: group + type: + scalar: string + - name: resource + type: + scalar: string + - name: version + type: + scalar: string +- name: io.k8s.api.storagemigration.v1alpha1.MigrationCondition + map: + fields: + - name: lastUpdateTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + - name: message + type: + scalar: string + - name: reason + type: + scalar: string + - name: status + type: + scalar: string + default: "" + - name: type + type: + scalar: string + default: "" +- name: io.k8s.api.storagemigration.v1alpha1.StorageVersionMigration + 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.storagemigration.v1alpha1.StorageVersionMigrationSpec + default: {} + - name: status + type: + namedType: io.k8s.api.storagemigration.v1alpha1.StorageVersionMigrationStatus + default: {} +- name: io.k8s.api.storagemigration.v1alpha1.StorageVersionMigrationSpec + map: + fields: + - name: continueToken + type: + scalar: string + - name: resource + type: + namedType: io.k8s.api.storagemigration.v1alpha1.GroupVersionResource + default: {} +- name: io.k8s.api.storagemigration.v1alpha1.StorageVersionMigrationStatus + map: + fields: + - name: conditions + type: + list: + elementType: + namedType: io.k8s.api.storagemigration.v1alpha1.MigrationCondition + elementRelationship: associative + keys: + - type + - name: resourceVersion + type: + scalar: string - name: io.k8s.apimachinery.pkg.api.resource.Quantity scalar: untyped - name: io.k8s.apimachinery.pkg.apis.meta.v1.Condition diff --git a/applyconfigurations/storagemigration/v1alpha1/groupversionresource.go b/applyconfigurations/storagemigration/v1alpha1/groupversionresource.go new file mode 100644 index 000000000..c733ac5c0 --- /dev/null +++ b/applyconfigurations/storagemigration/v1alpha1/groupversionresource.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 v1alpha1 + +// GroupVersionResourceApplyConfiguration represents an declarative configuration of the GroupVersionResource type for use +// with apply. +type GroupVersionResourceApplyConfiguration struct { + Group *string `json:"group,omitempty"` + Version *string `json:"version,omitempty"` + Resource *string `json:"resource,omitempty"` +} + +// GroupVersionResourceApplyConfiguration constructs an declarative configuration of the GroupVersionResource type for use with +// apply. +func GroupVersionResource() *GroupVersionResourceApplyConfiguration { + return &GroupVersionResourceApplyConfiguration{} +} + +// 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 *GroupVersionResourceApplyConfiguration) WithGroup(value string) *GroupVersionResourceApplyConfiguration { + b.Group = &value + return b +} + +// WithVersion sets the Version field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Version field is set to the value of the last call. +func (b *GroupVersionResourceApplyConfiguration) WithVersion(value string) *GroupVersionResourceApplyConfiguration { + b.Version = &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 *GroupVersionResourceApplyConfiguration) WithResource(value string) *GroupVersionResourceApplyConfiguration { + b.Resource = &value + return b +} diff --git a/applyconfigurations/storagemigration/v1alpha1/migrationcondition.go b/applyconfigurations/storagemigration/v1alpha1/migrationcondition.go new file mode 100644 index 000000000..d0f863446 --- /dev/null +++ b/applyconfigurations/storagemigration/v1alpha1/migrationcondition.go @@ -0,0 +1,81 @@ +/* +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 ( + v1 "k8s.io/api/core/v1" + v1alpha1 "k8s.io/api/storagemigration/v1alpha1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// MigrationConditionApplyConfiguration represents an declarative configuration of the MigrationCondition type for use +// with apply. +type MigrationConditionApplyConfiguration struct { + Type *v1alpha1.MigrationConditionType `json:"type,omitempty"` + Status *v1.ConditionStatus `json:"status,omitempty"` + LastUpdateTime *metav1.Time `json:"lastUpdateTime,omitempty"` + Reason *string `json:"reason,omitempty"` + Message *string `json:"message,omitempty"` +} + +// MigrationConditionApplyConfiguration constructs an declarative configuration of the MigrationCondition type for use with +// apply. +func MigrationCondition() *MigrationConditionApplyConfiguration { + return &MigrationConditionApplyConfiguration{} +} + +// WithType sets the Type field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Type field is set to the value of the last call. +func (b *MigrationConditionApplyConfiguration) WithType(value v1alpha1.MigrationConditionType) *MigrationConditionApplyConfiguration { + b.Type = &value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *MigrationConditionApplyConfiguration) WithStatus(value v1.ConditionStatus) *MigrationConditionApplyConfiguration { + b.Status = &value + return b +} + +// WithLastUpdateTime sets the LastUpdateTime field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LastUpdateTime field is set to the value of the last call. +func (b *MigrationConditionApplyConfiguration) WithLastUpdateTime(value metav1.Time) *MigrationConditionApplyConfiguration { + b.LastUpdateTime = &value + return b +} + +// WithReason sets the Reason field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Reason field is set to the value of the last call. +func (b *MigrationConditionApplyConfiguration) WithReason(value string) *MigrationConditionApplyConfiguration { + b.Reason = &value + return b +} + +// WithMessage sets the Message field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Message field is set to the value of the last call. +func (b *MigrationConditionApplyConfiguration) WithMessage(value string) *MigrationConditionApplyConfiguration { + b.Message = &value + return b +} diff --git a/applyconfigurations/storagemigration/v1alpha1/storageversionmigration.go b/applyconfigurations/storagemigration/v1alpha1/storageversionmigration.go new file mode 100644 index 000000000..cc57b2b12 --- /dev/null +++ b/applyconfigurations/storagemigration/v1alpha1/storageversionmigration.go @@ -0,0 +1,256 @@ +/* +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 ( + storagemigrationv1alpha1 "k8s.io/api/storagemigration/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" +) + +// StorageVersionMigrationApplyConfiguration represents an declarative configuration of the StorageVersionMigration type for use +// with apply. +type StorageVersionMigrationApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *StorageVersionMigrationSpecApplyConfiguration `json:"spec,omitempty"` + Status *StorageVersionMigrationStatusApplyConfiguration `json:"status,omitempty"` +} + +// StorageVersionMigration constructs an declarative configuration of the StorageVersionMigration type for use with +// apply. +func StorageVersionMigration(name string) *StorageVersionMigrationApplyConfiguration { + b := &StorageVersionMigrationApplyConfiguration{} + b.WithName(name) + b.WithKind("StorageVersionMigration") + b.WithAPIVersion("storagemigration.k8s.io/v1alpha1") + return b +} + +// ExtractStorageVersionMigration extracts the applied configuration owned by fieldManager from +// storageVersionMigration. If no managedFields are found in storageVersionMigration for fieldManager, a +// StorageVersionMigrationApplyConfiguration 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. +// storageVersionMigration must be a unmodified StorageVersionMigration API object that was retrieved from the Kubernetes API. +// ExtractStorageVersionMigration 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 ExtractStorageVersionMigration(storageVersionMigration *storagemigrationv1alpha1.StorageVersionMigration, fieldManager string) (*StorageVersionMigrationApplyConfiguration, error) { + return extractStorageVersionMigration(storageVersionMigration, fieldManager, "") +} + +// ExtractStorageVersionMigrationStatus is the same as ExtractStorageVersionMigration except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractStorageVersionMigrationStatus(storageVersionMigration *storagemigrationv1alpha1.StorageVersionMigration, fieldManager string) (*StorageVersionMigrationApplyConfiguration, error) { + return extractStorageVersionMigration(storageVersionMigration, fieldManager, "status") +} + +func extractStorageVersionMigration(storageVersionMigration *storagemigrationv1alpha1.StorageVersionMigration, fieldManager string, subresource string) (*StorageVersionMigrationApplyConfiguration, error) { + b := &StorageVersionMigrationApplyConfiguration{} + err := managedfields.ExtractInto(storageVersionMigration, internal.Parser().Type("io.k8s.api.storagemigration.v1alpha1.StorageVersionMigration"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(storageVersionMigration.Name) + + b.WithKind("StorageVersionMigration") + b.WithAPIVersion("storagemigration.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 *StorageVersionMigrationApplyConfiguration) WithKind(value string) *StorageVersionMigrationApplyConfiguration { + 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 *StorageVersionMigrationApplyConfiguration) WithAPIVersion(value string) *StorageVersionMigrationApplyConfiguration { + 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 *StorageVersionMigrationApplyConfiguration) WithName(value string) *StorageVersionMigrationApplyConfiguration { + 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 *StorageVersionMigrationApplyConfiguration) WithGenerateName(value string) *StorageVersionMigrationApplyConfiguration { + 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 *StorageVersionMigrationApplyConfiguration) WithNamespace(value string) *StorageVersionMigrationApplyConfiguration { + 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 *StorageVersionMigrationApplyConfiguration) WithUID(value types.UID) *StorageVersionMigrationApplyConfiguration { + 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 *StorageVersionMigrationApplyConfiguration) WithResourceVersion(value string) *StorageVersionMigrationApplyConfiguration { + 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 *StorageVersionMigrationApplyConfiguration) WithGeneration(value int64) *StorageVersionMigrationApplyConfiguration { + 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 *StorageVersionMigrationApplyConfiguration) WithCreationTimestamp(value metav1.Time) *StorageVersionMigrationApplyConfiguration { + 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 *StorageVersionMigrationApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *StorageVersionMigrationApplyConfiguration { + 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 *StorageVersionMigrationApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *StorageVersionMigrationApplyConfiguration { + 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 *StorageVersionMigrationApplyConfiguration) WithLabels(entries map[string]string) *StorageVersionMigrationApplyConfiguration { + 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 *StorageVersionMigrationApplyConfiguration) WithAnnotations(entries map[string]string) *StorageVersionMigrationApplyConfiguration { + 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 *StorageVersionMigrationApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *StorageVersionMigrationApplyConfiguration { + 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 *StorageVersionMigrationApplyConfiguration) WithFinalizers(values ...string) *StorageVersionMigrationApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *StorageVersionMigrationApplyConfiguration) 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 *StorageVersionMigrationApplyConfiguration) WithSpec(value *StorageVersionMigrationSpecApplyConfiguration) *StorageVersionMigrationApplyConfiguration { + 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 *StorageVersionMigrationApplyConfiguration) WithStatus(value *StorageVersionMigrationStatusApplyConfiguration) *StorageVersionMigrationApplyConfiguration { + b.Status = value + return b +} diff --git a/applyconfigurations/storagemigration/v1alpha1/storageversionmigrationspec.go b/applyconfigurations/storagemigration/v1alpha1/storageversionmigrationspec.go new file mode 100644 index 000000000..6c7c5b264 --- /dev/null +++ b/applyconfigurations/storagemigration/v1alpha1/storageversionmigrationspec.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 v1alpha1 + +// StorageVersionMigrationSpecApplyConfiguration represents an 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 +// apply. +func StorageVersionMigrationSpec() *StorageVersionMigrationSpecApplyConfiguration { + return &StorageVersionMigrationSpecApplyConfiguration{} +} + +// 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 *StorageVersionMigrationSpecApplyConfiguration) WithResource(value *GroupVersionResourceApplyConfiguration) *StorageVersionMigrationSpecApplyConfiguration { + b.Resource = value + return b +} + +// WithContinueToken sets the ContinueToken field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ContinueToken field is set to the value of the last call. +func (b *StorageVersionMigrationSpecApplyConfiguration) WithContinueToken(value string) *StorageVersionMigrationSpecApplyConfiguration { + b.ContinueToken = &value + return b +} diff --git a/applyconfigurations/storagemigration/v1alpha1/storageversionmigrationstatus.go b/applyconfigurations/storagemigration/v1alpha1/storageversionmigrationstatus.go new file mode 100644 index 000000000..b8d397548 --- /dev/null +++ b/applyconfigurations/storagemigration/v1alpha1/storageversionmigrationstatus.go @@ -0,0 +1,53 @@ +/* +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 + +// StorageVersionMigrationStatusApplyConfiguration represents an 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 +// apply. +func StorageVersionMigrationStatus() *StorageVersionMigrationStatusApplyConfiguration { + return &StorageVersionMigrationStatusApplyConfiguration{} +} + +// 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 *StorageVersionMigrationStatusApplyConfiguration) WithConditions(values ...*MigrationConditionApplyConfiguration) *StorageVersionMigrationStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithConditions") + } + b.Conditions = append(b.Conditions, *values[i]) + } + 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 *StorageVersionMigrationStatusApplyConfiguration) WithResourceVersion(value string) *StorageVersionMigrationStatusApplyConfiguration { + b.ResourceVersion = &value + return b +} diff --git a/applyconfigurations/utils.go b/applyconfigurations/utils.go index 07f81c8f6..604900272 100644 --- a/applyconfigurations/utils.go +++ b/applyconfigurations/utils.go @@ -66,6 +66,7 @@ import ( storagev1 "k8s.io/api/storage/v1" storagev1alpha1 "k8s.io/api/storage/v1alpha1" storagev1beta1 "k8s.io/api/storage/v1beta1" + storagemigrationv1alpha1 "k8s.io/api/storagemigration/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" schema "k8s.io/apimachinery/pkg/runtime/schema" admissionregistrationv1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1" @@ -116,6 +117,7 @@ import ( applyconfigurationsstoragev1 "k8s.io/client-go/applyconfigurations/storage/v1" applyconfigurationsstoragev1alpha1 "k8s.io/client-go/applyconfigurations/storage/v1alpha1" applyconfigurationsstoragev1beta1 "k8s.io/client-go/applyconfigurations/storage/v1beta1" + applyconfigurationsstoragemigrationv1alpha1 "k8s.io/client-go/applyconfigurations/storagemigration/v1alpha1" ) // ForKind returns an apply configuration type for the given GroupVersionKind, or nil if no @@ -1688,6 +1690,18 @@ func ForKind(kind schema.GroupVersionKind) interface{} { case storagev1beta1.SchemeGroupVersion.WithKind("VolumeNodeResources"): return &applyconfigurationsstoragev1beta1.VolumeNodeResourcesApplyConfiguration{} + // Group=storagemigration.k8s.io, Version=v1alpha1 + case storagemigrationv1alpha1.SchemeGroupVersion.WithKind("GroupVersionResource"): + return &applyconfigurationsstoragemigrationv1alpha1.GroupVersionResourceApplyConfiguration{} + case storagemigrationv1alpha1.SchemeGroupVersion.WithKind("MigrationCondition"): + return &applyconfigurationsstoragemigrationv1alpha1.MigrationConditionApplyConfiguration{} + case storagemigrationv1alpha1.SchemeGroupVersion.WithKind("StorageVersionMigration"): + return &applyconfigurationsstoragemigrationv1alpha1.StorageVersionMigrationApplyConfiguration{} + case storagemigrationv1alpha1.SchemeGroupVersion.WithKind("StorageVersionMigrationSpec"): + return &applyconfigurationsstoragemigrationv1alpha1.StorageVersionMigrationSpecApplyConfiguration{} + case storagemigrationv1alpha1.SchemeGroupVersion.WithKind("StorageVersionMigrationStatus"): + return &applyconfigurationsstoragemigrationv1alpha1.StorageVersionMigrationStatusApplyConfiguration{} + } return nil } diff --git a/informers/factory.go b/informers/factory.go index 9fc86441a..f2fef0e0b 100644 --- a/informers/factory.go +++ b/informers/factory.go @@ -46,6 +46,7 @@ import ( resource "k8s.io/client-go/informers/resource" scheduling "k8s.io/client-go/informers/scheduling" storage "k8s.io/client-go/informers/storage" + storagemigration "k8s.io/client-go/informers/storagemigration" kubernetes "k8s.io/client-go/kubernetes" cache "k8s.io/client-go/tools/cache" ) @@ -290,6 +291,7 @@ type SharedInformerFactory interface { Resource() resource.Interface Scheduling() scheduling.Interface Storage() storage.Interface + Storagemigration() storagemigration.Interface } func (f *sharedInformerFactory) Admissionregistration() admissionregistration.Interface { @@ -367,3 +369,7 @@ func (f *sharedInformerFactory) Scheduling() scheduling.Interface { func (f *sharedInformerFactory) Storage() storage.Interface { return storage.New(f, f.namespace, f.tweakListOptions) } + +func (f *sharedInformerFactory) Storagemigration() storagemigration.Interface { + return storagemigration.New(f, f.namespace, f.tweakListOptions) +} diff --git a/informers/generic.go b/informers/generic.go index 297633c23..d85117587 100644 --- a/informers/generic.go +++ b/informers/generic.go @@ -67,6 +67,7 @@ import ( storagev1 "k8s.io/api/storage/v1" storagev1alpha1 "k8s.io/api/storage/v1alpha1" storagev1beta1 "k8s.io/api/storage/v1beta1" + storagemigrationv1alpha1 "k8s.io/api/storagemigration/v1alpha1" schema "k8s.io/apimachinery/pkg/runtime/schema" cache "k8s.io/client-go/tools/cache" ) @@ -421,6 +422,10 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource case storagev1beta1.SchemeGroupVersion.WithResource("volumeattachments"): return &genericInformer{resource: resource.GroupResource(), informer: f.Storage().V1beta1().VolumeAttachments().Informer()}, nil + // Group=storagemigration.k8s.io, Version=v1alpha1 + case storagemigrationv1alpha1.SchemeGroupVersion.WithResource("storageversionmigrations"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Storagemigration().V1alpha1().StorageVersionMigrations().Informer()}, nil + } return nil, fmt.Errorf("no informer found for %v", resource) diff --git a/informers/storagemigration/interface.go b/informers/storagemigration/interface.go new file mode 100644 index 000000000..1f7030fea --- /dev/null +++ b/informers/storagemigration/interface.go @@ -0,0 +1,46 @@ +/* +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 storagemigration + +import ( + internalinterfaces "k8s.io/client-go/informers/internalinterfaces" + v1alpha1 "k8s.io/client-go/informers/storagemigration/v1alpha1" +) + +// Interface provides access to each of this group's versions. +type Interface interface { + // V1alpha1 provides access to shared informers for resources in V1alpha1. + V1alpha1() v1alpha1.Interface +} + +type group struct { + factory internalinterfaces.SharedInformerFactory + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// New returns a new Interface. +func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { + return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} +} + +// V1alpha1 returns a new v1alpha1.Interface. +func (g *group) V1alpha1() v1alpha1.Interface { + return v1alpha1.New(g.factory, g.namespace, g.tweakListOptions) +} diff --git a/informers/storagemigration/v1alpha1/interface.go b/informers/storagemigration/v1alpha1/interface.go new file mode 100644 index 000000000..60724e7a2 --- /dev/null +++ b/informers/storagemigration/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 { + // StorageVersionMigrations returns a StorageVersionMigrationInformer. + StorageVersionMigrations() StorageVersionMigrationInformer +} + +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} +} + +// StorageVersionMigrations returns a StorageVersionMigrationInformer. +func (v *version) StorageVersionMigrations() StorageVersionMigrationInformer { + return &storageVersionMigrationInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} diff --git a/informers/storagemigration/v1alpha1/storageversionmigration.go b/informers/storagemigration/v1alpha1/storageversionmigration.go new file mode 100644 index 000000000..70e7c7279 --- /dev/null +++ b/informers/storagemigration/v1alpha1/storageversionmigration.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 v1alpha1 + +import ( + "context" + time "time" + + storagemigrationv1alpha1 "k8s.io/api/storagemigration/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/storagemigration/v1alpha1" + cache "k8s.io/client-go/tools/cache" +) + +// StorageVersionMigrationInformer provides access to a shared informer and lister for +// StorageVersionMigrations. +type StorageVersionMigrationInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1alpha1.StorageVersionMigrationLister +} + +type storageVersionMigrationInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewStorageVersionMigrationInformer constructs a new informer for StorageVersionMigration 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 NewStorageVersionMigrationInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredStorageVersionMigrationInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredStorageVersionMigrationInformer constructs a new informer for StorageVersionMigration 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 NewFilteredStorageVersionMigrationInformer(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.StoragemigrationV1alpha1().StorageVersionMigrations().List(context.TODO(), options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.StoragemigrationV1alpha1().StorageVersionMigrations().Watch(context.TODO(), options) + }, + }, + &storagemigrationv1alpha1.StorageVersionMigration{}, + resyncPeriod, + indexers, + ) +} + +func (f *storageVersionMigrationInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredStorageVersionMigrationInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *storageVersionMigrationInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&storagemigrationv1alpha1.StorageVersionMigration{}, f.defaultInformer) +} + +func (f *storageVersionMigrationInformer) Lister() v1alpha1.StorageVersionMigrationLister { + return v1alpha1.NewStorageVersionMigrationLister(f.Informer().GetIndexer()) +} diff --git a/kubernetes/clientset.go b/kubernetes/clientset.go index a0095d086..eaa206ff6 100644 --- a/kubernetes/clientset.go +++ b/kubernetes/clientset.go @@ -74,6 +74,7 @@ import ( storagev1 "k8s.io/client-go/kubernetes/typed/storage/v1" storagev1alpha1 "k8s.io/client-go/kubernetes/typed/storage/v1alpha1" storagev1beta1 "k8s.io/client-go/kubernetes/typed/storage/v1beta1" + storagemigrationv1alpha1 "k8s.io/client-go/kubernetes/typed/storagemigration/v1alpha1" rest "k8s.io/client-go/rest" flowcontrol "k8s.io/client-go/util/flowcontrol" ) @@ -131,6 +132,7 @@ type Interface interface { StorageV1beta1() storagev1beta1.StorageV1beta1Interface StorageV1() storagev1.StorageV1Interface StorageV1alpha1() storagev1alpha1.StorageV1alpha1Interface + StoragemigrationV1alpha1() storagemigrationv1alpha1.StoragemigrationV1alpha1Interface } // Clientset contains the clients for groups. @@ -187,6 +189,7 @@ type Clientset struct { storageV1beta1 *storagev1beta1.StorageV1beta1Client storageV1 *storagev1.StorageV1Client storageV1alpha1 *storagev1alpha1.StorageV1alpha1Client + storagemigrationV1alpha1 *storagemigrationv1alpha1.StoragemigrationV1alpha1Client } // AdmissionregistrationV1 retrieves the AdmissionregistrationV1Client @@ -444,6 +447,11 @@ func (c *Clientset) StorageV1alpha1() storagev1alpha1.StorageV1alpha1Interface { return c.storageV1alpha1 } +// StoragemigrationV1alpha1 retrieves the StoragemigrationV1alpha1Client +func (c *Clientset) StoragemigrationV1alpha1() storagemigrationv1alpha1.StoragemigrationV1alpha1Interface { + return c.storagemigrationV1alpha1 +} + // Discovery retrieves the DiscoveryClient func (c *Clientset) Discovery() discovery.DiscoveryInterface { if c == nil { @@ -692,6 +700,10 @@ func NewForConfigAndClient(c *rest.Config, httpClient *http.Client) (*Clientset, if err != nil { return nil, err } + cs.storagemigrationV1alpha1, err = storagemigrationv1alpha1.NewForConfigAndClient(&configShallowCopy, httpClient) + if err != nil { + return nil, err + } cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfigAndClient(&configShallowCopy, httpClient) if err != nil { @@ -764,6 +776,7 @@ func New(c rest.Interface) *Clientset { cs.storageV1beta1 = storagev1beta1.New(c) cs.storageV1 = storagev1.New(c) cs.storageV1alpha1 = storagev1alpha1.New(c) + cs.storagemigrationV1alpha1 = storagemigrationv1alpha1.New(c) cs.DiscoveryClient = discovery.NewDiscoveryClient(c) return &cs diff --git a/kubernetes/fake/clientset_generated.go b/kubernetes/fake/clientset_generated.go index fc529873f..a62b8f7c4 100644 --- a/kubernetes/fake/clientset_generated.go +++ b/kubernetes/fake/clientset_generated.go @@ -126,6 +126,8 @@ import ( fakestoragev1alpha1 "k8s.io/client-go/kubernetes/typed/storage/v1alpha1/fake" storagev1beta1 "k8s.io/client-go/kubernetes/typed/storage/v1beta1" fakestoragev1beta1 "k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake" + storagemigrationv1alpha1 "k8s.io/client-go/kubernetes/typed/storagemigration/v1alpha1" + fakestoragemigrationv1alpha1 "k8s.io/client-go/kubernetes/typed/storagemigration/v1alpha1/fake" "k8s.io/client-go/testing" ) @@ -433,3 +435,8 @@ func (c *Clientset) StorageV1() storagev1.StorageV1Interface { func (c *Clientset) StorageV1alpha1() storagev1alpha1.StorageV1alpha1Interface { return &fakestoragev1alpha1.FakeStorageV1alpha1{Fake: &c.Fake} } + +// StoragemigrationV1alpha1 retrieves the StoragemigrationV1alpha1Client +func (c *Clientset) StoragemigrationV1alpha1() storagemigrationv1alpha1.StoragemigrationV1alpha1Interface { + return &fakestoragemigrationv1alpha1.FakeStoragemigrationV1alpha1{Fake: &c.Fake} +} diff --git a/kubernetes/fake/register.go b/kubernetes/fake/register.go index 6b80d6833..339983fe0 100644 --- a/kubernetes/fake/register.go +++ b/kubernetes/fake/register.go @@ -70,6 +70,7 @@ import ( storagev1 "k8s.io/api/storage/v1" storagev1alpha1 "k8s.io/api/storage/v1alpha1" storagev1beta1 "k8s.io/api/storage/v1beta1" + storagemigrationv1alpha1 "k8s.io/api/storagemigration/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -132,6 +133,7 @@ var localSchemeBuilder = runtime.SchemeBuilder{ storagev1beta1.AddToScheme, storagev1.AddToScheme, storagev1alpha1.AddToScheme, + storagemigrationv1alpha1.AddToScheme, } // AddToScheme adds all types of this clientset into the given scheme. This allows composition diff --git a/kubernetes/scheme/register.go b/kubernetes/scheme/register.go index f44055fbf..8ebfb7cea 100644 --- a/kubernetes/scheme/register.go +++ b/kubernetes/scheme/register.go @@ -70,6 +70,7 @@ import ( storagev1 "k8s.io/api/storage/v1" storagev1alpha1 "k8s.io/api/storage/v1alpha1" storagev1beta1 "k8s.io/api/storage/v1beta1" + storagemigrationv1alpha1 "k8s.io/api/storagemigration/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -132,6 +133,7 @@ var localSchemeBuilder = runtime.SchemeBuilder{ storagev1beta1.AddToScheme, storagev1.AddToScheme, storagev1alpha1.AddToScheme, + storagemigrationv1alpha1.AddToScheme, } // AddToScheme adds all types of this clientset into the given scheme. This allows composition diff --git a/kubernetes/typed/storagemigration/v1alpha1/doc.go b/kubernetes/typed/storagemigration/v1alpha1/doc.go new file mode 100644 index 000000000..df51baa4d --- /dev/null +++ b/kubernetes/typed/storagemigration/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/storagemigration/v1alpha1/fake/doc.go b/kubernetes/typed/storagemigration/v1alpha1/fake/doc.go new file mode 100644 index 000000000..16f443990 --- /dev/null +++ b/kubernetes/typed/storagemigration/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/storagemigration/v1alpha1/fake/fake_storagemigration_client.go b/kubernetes/typed/storagemigration/v1alpha1/fake/fake_storagemigration_client.go new file mode 100644 index 000000000..3ae8f4ae5 --- /dev/null +++ b/kubernetes/typed/storagemigration/v1alpha1/fake/fake_storagemigration_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/storagemigration/v1alpha1" + rest "k8s.io/client-go/rest" + testing "k8s.io/client-go/testing" +) + +type FakeStoragemigrationV1alpha1 struct { + *testing.Fake +} + +func (c *FakeStoragemigrationV1alpha1) StorageVersionMigrations() v1alpha1.StorageVersionMigrationInterface { + return &FakeStorageVersionMigrations{c} +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *FakeStoragemigrationV1alpha1) RESTClient() rest.Interface { + var ret *rest.RESTClient + return ret +} diff --git a/kubernetes/typed/storagemigration/v1alpha1/fake/fake_storageversionmigration.go b/kubernetes/typed/storagemigration/v1alpha1/fake/fake_storageversionmigration.go new file mode 100644 index 000000000..9b5da88c7 --- /dev/null +++ b/kubernetes/typed/storagemigration/v1alpha1/fake/fake_storageversionmigration.go @@ -0,0 +1,178 @@ +/* +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/storagemigration/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" + storagemigrationv1alpha1 "k8s.io/client-go/applyconfigurations/storagemigration/v1alpha1" + testing "k8s.io/client-go/testing" +) + +// FakeStorageVersionMigrations implements StorageVersionMigrationInterface +type FakeStorageVersionMigrations struct { + Fake *FakeStoragemigrationV1alpha1 +} + +var storageversionmigrationsResource = v1alpha1.SchemeGroupVersion.WithResource("storageversionmigrations") + +var storageversionmigrationsKind = v1alpha1.SchemeGroupVersion.WithKind("StorageVersionMigration") + +// 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) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(storageversionmigrationsResource, name), &v1alpha1.StorageVersionMigration{}) + if obj == nil { + return nil, 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) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(storageversionmigrationsResource, storageversionmigrationsKind, opts), &v1alpha1.StorageVersionMigrationList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1alpha1.StorageVersionMigrationList{ListMeta: obj.(*v1alpha1.StorageVersionMigrationList).ListMeta} + for _, item := range obj.(*v1alpha1.StorageVersionMigrationList).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 storageVersionMigrations. +func (c *FakeStorageVersionMigrations) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(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) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(storageversionmigrationsResource, storageVersionMigration), &v1alpha1.StorageVersionMigration{}) + if obj == nil { + return nil, 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) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(storageversionmigrationsResource, storageVersionMigration), &v1alpha1.StorageVersionMigration{}) + if obj == nil { + return nil, 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) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateSubresourceAction(storageversionmigrationsResource, "status", storageVersionMigration), &v1alpha1.StorageVersionMigration{}) + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.StorageVersionMigration), err +} + +// Delete takes name of the storageVersionMigration and deletes it. Returns an error if one occurs. +func (c *FakeStorageVersionMigrations) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteActionWithOptions(storageversionmigrationsResource, name, opts), &v1alpha1.StorageVersionMigration{}) + return err +} + +// 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) + + _, err := c.Fake.Invokes(action, &v1alpha1.StorageVersionMigrationList{}) + return err +} + +// 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) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(storageversionmigrationsResource, name, pt, data, subresources...), &v1alpha1.StorageVersionMigration{}) + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.StorageVersionMigration), err +} + +// Apply takes the given apply declarative configuration, applies it and returns the applied storageVersionMigration. +func (c *FakeStorageVersionMigrations) 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") + } + 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") + } + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(storageversionmigrationsResource, *name, types.ApplyPatchType, data), &v1alpha1.StorageVersionMigration{}) + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.StorageVersionMigration), 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 *FakeStorageVersionMigrations) 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") + } + 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") + } + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(storageversionmigrationsResource, *name, types.ApplyPatchType, data, "status"), &v1alpha1.StorageVersionMigration{}) + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.StorageVersionMigration), err +} diff --git a/kubernetes/typed/storagemigration/v1alpha1/generated_expansion.go b/kubernetes/typed/storagemigration/v1alpha1/generated_expansion.go new file mode 100644 index 000000000..89220c3ce --- /dev/null +++ b/kubernetes/typed/storagemigration/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 StorageVersionMigrationExpansion interface{} diff --git a/kubernetes/typed/storagemigration/v1alpha1/storagemigration_client.go b/kubernetes/typed/storagemigration/v1alpha1/storagemigration_client.go new file mode 100644 index 000000000..613e45355 --- /dev/null +++ b/kubernetes/typed/storagemigration/v1alpha1/storagemigration_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/storagemigration/v1alpha1" + "k8s.io/client-go/kubernetes/scheme" + rest "k8s.io/client-go/rest" +) + +type StoragemigrationV1alpha1Interface interface { + RESTClient() rest.Interface + StorageVersionMigrationsGetter +} + +// StoragemigrationV1alpha1Client is used to interact with features provided by the storagemigration.k8s.io group. +type StoragemigrationV1alpha1Client struct { + restClient rest.Interface +} + +func (c *StoragemigrationV1alpha1Client) StorageVersionMigrations() StorageVersionMigrationInterface { + return newStorageVersionMigrations(c) +} + +// NewForConfig creates a new StoragemigrationV1alpha1Client for the given config. +// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), +// where httpClient was generated with rest.HTTPClientFor(c). +func NewForConfig(c *rest.Config) (*StoragemigrationV1alpha1Client, 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 StoragemigrationV1alpha1Client 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) (*StoragemigrationV1alpha1Client, 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 &StoragemigrationV1alpha1Client{client}, nil +} + +// NewForConfigOrDie creates a new StoragemigrationV1alpha1Client for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *StoragemigrationV1alpha1Client { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new StoragemigrationV1alpha1Client for the given RESTClient. +func New(c rest.Interface) *StoragemigrationV1alpha1Client { + return &StoragemigrationV1alpha1Client{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 *StoragemigrationV1alpha1Client) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/kubernetes/typed/storagemigration/v1alpha1/storageversionmigration.go b/kubernetes/typed/storagemigration/v1alpha1/storageversionmigration.go new file mode 100644 index 000000000..be66a5b94 --- /dev/null +++ b/kubernetes/typed/storagemigration/v1alpha1/storageversionmigration.go @@ -0,0 +1,243 @@ +/* +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" + 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" + scheme "k8s.io/client-go/kubernetes/scheme" + rest "k8s.io/client-go/rest" +) + +// StorageVersionMigrationsGetter has a method to return a StorageVersionMigrationInterface. +// A group's client should implement this interface. +type StorageVersionMigrationsGetter interface { + StorageVersionMigrations() StorageVersionMigrationInterface +} + +// StorageVersionMigrationInterface has methods to work with StorageVersionMigration resources. +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) + 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 + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.StorageVersionMigration, error) + List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.StorageVersionMigrationList, 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.StorageVersionMigration, err error) + Apply(ctx context.Context, storageVersionMigration *storagemigrationv1alpha1.StorageVersionMigrationApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.StorageVersionMigration, err error) + 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 +} + +// newStorageVersionMigrations returns a StorageVersionMigrations +func newStorageVersionMigrations(c *StoragemigrationV1alpha1Client) *storageVersionMigrations { + return &storageVersionMigrations{ + client: c.RESTClient(), + } +} + +// 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) (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 +} + +// 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 +} diff --git a/listers/storagemigration/v1alpha1/expansion_generated.go b/listers/storagemigration/v1alpha1/expansion_generated.go new file mode 100644 index 000000000..92eb5c65b --- /dev/null +++ b/listers/storagemigration/v1alpha1/expansion_generated.go @@ -0,0 +1,23 @@ +/* +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 + +// StorageVersionMigrationListerExpansion allows custom methods to be added to +// StorageVersionMigrationLister. +type StorageVersionMigrationListerExpansion interface{} diff --git a/listers/storagemigration/v1alpha1/storageversionmigration.go b/listers/storagemigration/v1alpha1/storageversionmigration.go new file mode 100644 index 000000000..b65bf2532 --- /dev/null +++ b/listers/storagemigration/v1alpha1/storageversionmigration.go @@ -0,0 +1,68 @@ +/* +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/storagemigration/v1alpha1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// StorageVersionMigrationLister helps list StorageVersionMigrations. +// All objects returned here must be treated as read-only. +type StorageVersionMigrationLister interface { + // List lists all StorageVersionMigrations in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1alpha1.StorageVersionMigration, err error) + // Get retrieves the StorageVersionMigration from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1alpha1.StorageVersionMigration, error) + StorageVersionMigrationListerExpansion +} + +// storageVersionMigrationLister implements the StorageVersionMigrationLister interface. +type storageVersionMigrationLister struct { + indexer cache.Indexer +} + +// 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 +} From 05ff4bb2fdad22ac022a312f66fe3e09a22d62e8 Mon Sep 17 00:00:00 2001 From: Stephen Kitt Date: Fri, 27 Oct 2023 16:57:01 +0200 Subject: [PATCH 075/239] 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 000000000..c69bb22b1 --- /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 076/239] 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 fe9e27985..4ab267e42 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 fff072f4c..f233cdbe8 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 07856981e..450a06672 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 1579a0ebb..99045a675 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 ae500183a..c3aec2d73 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 552854daf..5a2cf79c5 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 93c6096ee..3bad49ac0 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 7018b3cee..74d7c6ce3 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 5fcebfd22..668d652bb 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 7c17fccb2..16167d573 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 9a6d74b2b..ce51b88f2 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 9e2f97374..b9061b159 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 061959e3d..4240cb624 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 770403417..3337026b7 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 3ca7757eb..244df1d33 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 f6899d5ff..a8dc1b022 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 fc73de723..c5e8fb373 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 3fb70794c..1bc6d45ad 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 e3556bc39..4bf103aef 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 da2ce8600..de941bc69 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 4b7aedd75..37784fe88 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 c2857bbc3..75acc1693 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 26b350ce8..37ea97630 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 fbbaf0133..cc48a1473 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 8447f059d..2cd4cc87b 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 a5cef2772..7c2806af2 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 f1804e995..a2befd606 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 b0dbaf9eb..52bae849b 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 8e49ed959..a7a3abbfa 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 3aba6b95f..4078a9f7d 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 4842d5e5a..33ed8219e 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 0d04e118d..38e4a3a65 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 b8049a761..88e5365f4 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 471b5629b..84b5ac4a9 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 de366d0e1..b36d8800e 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 8dfdc1e9b..dbe132696 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 5fcdac3c7..9e3274b5a 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 6a410e47c..0dde404f2 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 4759ce808..726b43255 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 4416e2012..5ab3a1932 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 d8fa569cd..5c7593cfa 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 454aa1a0a..a016447cf 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 596049857..495c6d79d 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 e7dfd4ac9..17f19bb7a 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 fc71bb5a1..ce9df9031 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 ab8f0946c..b17a8382a 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 6c310045b..8ac93148f 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 e28e2ef76..8ce23fc09 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 9c00b49d4..4b46194a2 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 d386d4d5c..47a0c9a08 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 51026d7b4..536fb337f 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 aa9554d8b..8a4af4f4c 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 4dd46ff1b..dcb18f19a 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 e92872d5f..d3762f5c2 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 4abe841e2..66e3c6466 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 41a521be6..3d51bb265 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 900475410..4510b4236 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 42b5a0723..149047c97 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 1cb7677bd..b714eebb3 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 84419a8e9..b31099c26 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 a5ec3229b..604bee80b 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 43ccd4e5f..ba7e51487 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 61189b9cf..61f5b9fe6 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 7927a8411..59bca6ce4 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 c94aaa4c1..902f7cc4b 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 2710f2630..721c5f6bd 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 00ede0070..3e8a2134f 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 ef01b5a76..c5555fd64 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 d05613949..9f7d89c54 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 cb0f7b7a1..843e6b68d 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 0f49d4f57..3007cd349 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 1480cb13f..a8efe5c5e 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 34cabf057..9a3e3172e 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 b3dfe2797..749affd7b 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 8bc2b10e6..8be2d11af 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 b8f4d3558..b8fe99e24 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 ebcd6ba85..a5e33525f 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 6e00cf1a5..17b88687e 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 31f335799..1f6e06f48 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 7dbd6ab26..cd0cdf3c5 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 dc5ffa074..83695668f 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 8470d38bb..38ed8144e 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 e1d40d0b3..0aff83352 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 aa08f813e..55ae892e2 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 84dc003ca..11a4cb4db 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 ff061d4b2..4c3583bb9 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 503f013b5..3e9425321 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 ea50c6413..1b3162a11 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 181ea95a7..5e5bbaa5a 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 29d283b6c..d825d0a2f 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 13a64137a..f3d2b2838 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 0ad3d0eba..6d6f7b700 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 bf6cd99cb..bade03262 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 00bab2330..1f4d391be 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 9cd9b9042..71666a9a0 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 7c7c91bf3..00f8542cb 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 c50b3f889..9aca7bfbf 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 273f16af3..8d789314d 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 1a561ef7a..ad751a6ce 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 91a488b17..7ad1c769f 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 eeb2fc337..ecbe18a76 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 26fb95e6d..f731bfe13 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 4301cea2e..c5937df82 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 4da84ccf8..b9179b568 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 3d25dc80a..776ad5ae2 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 c848d035a..966064e5d 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 4e8ab9090..db64f4588 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 93f869572..5bfd2a43a 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 a72328c9a..c2acfa115 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 ffa3d19f5..fc3759444 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 fbc735c93..44754d6f2 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 0c1b5f264..7f75aae2c 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 3d5e2b7b7..122864ffe 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 f30b4a89b..5d8ae09d7 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 c6787aa01..660038674 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 809efaa36..2c29ccabf 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 4680ffb7c..365304df1 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 eb7b8315c..070c061bc 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 bab2d317c..d437c1eae 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 b65bf2532..794dba25c 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 02f21344ac89b3cc5357db50e931f68222c187b0 Mon Sep 17 00:00:00 2001 From: Nilekh Chaudhari <1626598+nilekhc@users.noreply.github.com> Date: Thu, 4 Jan 2024 19:34:05 +0000 Subject: [PATCH 077/239] feat: implements svm controller Signed-off-by: Nilekh Chaudhari <1626598+nilekhc@users.noreply.github.com> Kubernetes-commit: 9161302e7fd3a5fb055b2f2572c6e1228240bb51 --- features/known_features.go | 7 ++++++- tools/cache/shared_informer.go | 6 ++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/features/known_features.go b/features/known_features.go index 329eed725..0c972a46f 100644 --- a/features/known_features.go +++ b/features/known_features.go @@ -37,6 +37,10 @@ const ( // The feature is disabled in Beta by default because // it will only be turned on for selected control plane component(s). WatchListClient Feature = "WatchListClient" + + // owner: @nilekhc + // alpha: v1.30 + InformerResourceVersion Feature = "InformerResourceVersion" ) // defaultKubernetesFeatureGates consists of all known Kubernetes-specific feature keys. @@ -45,5 +49,6 @@ const ( // After registering with the binary, the features are, by default, controllable using environment variables. // For more details, please see envVarFeatureGates implementation. var defaultKubernetesFeatureGates = map[Feature]FeatureSpec{ - WatchListClient: {Default: false, PreRelease: Beta}, + WatchListClient: {Default: false, PreRelease: Beta}, + InformerResourceVersion: {Default: false, PreRelease: Alpha}, } diff --git a/tools/cache/shared_informer.go b/tools/cache/shared_informer.go index a06df6e6e..c805030bd 100644 --- a/tools/cache/shared_informer.go +++ b/tools/cache/shared_informer.go @@ -31,6 +31,8 @@ import ( "k8s.io/utils/clock" "k8s.io/klog/v2" + + clientgofeaturegate "k8s.io/client-go/features" ) // SharedInformer provides eventually consistent linkage of its @@ -409,6 +411,10 @@ func (v *dummyController) HasSynced() bool { } func (v *dummyController) LastSyncResourceVersion() string { + if clientgofeaturegate.FeatureGates().Enabled(clientgofeaturegate.InformerResourceVersion) { + return v.informer.LastSyncResourceVersion() + } + return "" } From a1be94abc307ca59f9fa919650ec4ae5d534ae01 Mon Sep 17 00:00:00 2001 From: Lukasz Szaszkiewicz Date: Mon, 8 Jan 2024 16:43:26 +0100 Subject: [PATCH 078/239] 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 850e57dae..f5a9f68ca 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 000000000..4ebfe81bb --- /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 079/239] 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 b88598b71..b2036825d 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 c947e6572..f7ef06681 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 9ace73593..b6cd66fc0 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 a6951c736..afd5879d2 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 f4358ce46..fd8a17b2f 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 c520655f9..ca6d25235 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 9d85aff37..aa864b12f 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 90cb4ff6c..024fdec05 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 f771f81f3..9d6ff5153 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 41e3a7c1e..2c76bb9ac 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 738c68038..bf66e0f3b 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 f691ba9ac..1c1244329 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 3e0df7235..c1b1d7948 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 da1896fe6..c903e3f7b 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 dedf19b42..5df759dac 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 f1d7d96e8..89848d56a 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 1954c9470..d42773736 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 9614852f7..f45355a08 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 2124515cf..ea6b517de 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 1bf7fb331..5e8ca6df2 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 8f5cfa5a8..b554c2249 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 c9e8ab48b..c2a10e8ef 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 46e1a78a7..5af517d44 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 684f79925..a439fe9db 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 e683b3eaa..158b7f805 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 500e87d06..656bd8f07 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 a20b3dd76..5252eedaa 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 4a9db85cf..eedfebb6f 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 b1988a67a..cd1f1333a 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 43ea05328..491116f6e 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 27642266d..e2f1377f3 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 cd6c682d1..39edde853 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 09dab6480..c22cb2613 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 104e979d1..95ccfe795 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 517e48b76..1547c17d0 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 3aed050fc..cfc11b542 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 e9bfa521a..972d49e4d 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 a2c95b753..fe661a332 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 cfcc20823..57ce30f17 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 0b2658e64..ad81314bf 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 0a7c93c3d..becd8eeb8 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 0cbcce6d8..e14fbf68c 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 cf1a913bd..b13d5f736 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 9d078f55a..a624e8daa 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 adb7db0bf..a46be0352 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 2f849cbd7..39a1e0643 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 76bb38e7b..7fdbdf878 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 6dc7c4c17..1649eba8f 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 9a4a0d7eb..e15737b06 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 39d4c3282..2d8cd6c19 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 6e8a38bd8..37ad42be6 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 6b2f6c249..aa221b2da 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 9ad879b39..9bb0f5fb2 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 f18b5741c..03b1ca032 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 52fcff591..7a28220d2 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 5df40f8d1..538f0ab0c 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 5b06d0b19..2d5b0714c 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 b860e5367..67295ce42 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 23634c7d0..839f985a7 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 9fa97ab40..7f00b22f5 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 1e469c9b1..25d10d17b 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 87664985c..298b155f9 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 90035a703..e5dbb6bf1 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 514ab19e3..064abc18f 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 115ff0712..1ff5bbcba 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 d159b5ea9..843e96606 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 268371811..48b2aa90a 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 0928781f1..4207d2d6b 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 522b4dc06..cba822297 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 abe3d2da1..3bedb4264 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 e399361a9..16be81f40 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 48ae51e80..69f3dc9ba 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 a32022140..8e36b1027 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 42da6fa8b..b8031f709 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 922a60d89..20e9dbdb8 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 27d958674..239a07136 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 be7a7e390..9a94a0d34 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 698a168b3..edacdaf25 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 7ce6d2116..956becdc7 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 7340f8a09..40c763ff5 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 1371f6ed6..9f632abcf 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 a0e266fec..91205e85a 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 002de0dd8..49cded65b 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 208a97508..7d9cd478a 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 dde09774c..9b3e7c19f 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 4db8df68c..cffe0d63d 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 653ef631a..754985d16 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 7a3b861be..b2adf27b6 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 1804e61fc..5a98f982b 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 35cfbcae4..a512e9f09 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 2ff7d3f97..808bd4d40 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 e6552f9ac..a450fb86a 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 7b5f51caf..1916b7d28 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 bcee8e777..6015f367b 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 5add33ddf..ef6c57d76 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 d42e93e65..5ffc0be3e 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 a3bc5da66..ef5e73670 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 eeb37e9db..e9624cd2e 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 534a1990f..f953a91c6 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 0a4359392..7b0ee96c7 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 a0e28348a..738180ce8 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 76649f5c2..3fb9549b8 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 2a94a4315..da45ac6f0 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 c9fd7c0cd..fc7de1d68 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 4158cf1d5..6f7b59c2c 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 4616f0fd1..7bbf5acef 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 54882f817..6fda8c53a 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 087e51f71..30fb78ce8 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 da32b5cae..0bd86e4f8 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 2a1b4554e..014356091 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 4d247c513..6c4ea1045 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 c11762963..e07d43fa8 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 325e729e9..713f0ef57 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 40ab9fb40..b96659226 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 3c8404a72..c76820cb1 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 4cf2e26c7..0ca92e215 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 498322737..27a795913 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 0271a20f3..e8e48fce8 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 b12bbe3c1..8dd75b759 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 e232f4c8d..a44b58f42 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 3f5f2aec5..d68b6782f 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 c1614cda7..0099fd771 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 9725d6d10..19ded07b8 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 d25263df4..c3fd1eeba 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 4257aa618..c1a73310d 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 d38c104bc..c37d82fc7 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 d7bbb614b..77888e58a 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 869e58b4f..594c4fa00 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 e2b4a2eb1..41da92c1a 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 9b5da88c7..ede21403a 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 080/239] 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 22d3c6b3f..000000000 --- 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 99585f939..000000000 --- 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 3f0688774..000000000 --- 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 081/239] 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 e85900001..379fcc850 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 17248f853..280e48fb0 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 082/239] 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 379fcc850..d780e5c0c 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 280e48fb0..6eb2357c5 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 058bf3c1c..2b4a7a7e1 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 396840670..f626c12bf 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 33c668349..de7369cda 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 083/239] 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 3c3cc3611..a98a728f6 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 a363d1afb..163d65c05 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 e2a33973c..1cf2cd2f1 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 110b75b14e8de3a12ab951085f977b27fc8c5c05 Mon Sep 17 00:00:00 2001 From: Kubernetes Publisher Date: Fri, 8 Mar 2024 13:45:16 -0800 Subject: [PATCH 084/239] Merge pull request #123344 from nilekhc/svm-controller [Storage Version Migration] feat: implements Storage Version Migration Kubernetes-commit: 28c4d00c7dcc9a72853a4da0885e6fac09a2f40e --- go.mod | 4 ++-- go.sum | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 0f7ae166f..4c3eacf67 100644 --- a/go.mod +++ b/go.mod @@ -24,7 +24,7 @@ require ( golang.org/x/term v0.17.0 golang.org/x/time v0.3.0 google.golang.org/protobuf v1.33.0 - k8s.io/api v0.0.0-20240308035331-170523fbf722 + k8s.io/api v0.0.0-20240308214516-0cf49f55b90f k8s.io/apimachinery v0.0.0-20240307171817-d82afe1e363a k8s.io/klog/v2 v2.120.1 k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 @@ -61,6 +61,6 @@ require ( ) replace ( - k8s.io/api => k8s.io/api v0.0.0-20240308035331-170523fbf722 + k8s.io/api => k8s.io/api v0.0.0-20240308214516-0cf49f55b90f k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20240307171817-d82afe1e363a ) diff --git a/go.sum b/go.sum index 65ec44369..739750379 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-20240308035331-170523fbf722 h1:swjp6yzL9EF0cshDk/jlg1EHNO3Iue//QmzbLZ69czQ= -k8s.io/api v0.0.0-20240308035331-170523fbf722/go.mod h1:RzL8aPQw9ZdVXCdY+Iz3AXnVX+jFyQNqcmzmS+2/Ur0= +k8s.io/api v0.0.0-20240308214516-0cf49f55b90f h1:3mFcDB/sMp+rdKFYJ0fssV6uaULlg3CEWXEtB+UdUPM= +k8s.io/api v0.0.0-20240308214516-0cf49f55b90f/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/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw= From 3be09aa8dbd6a3cadf7afa87fdfb2e7950b307ff Mon Sep 17 00:00:00 2001 From: Akihiro Suda Date: Sat, 9 Mar 2024 09:48:12 +0900 Subject: [PATCH 085/239] api: KEP-3857: Recursive Read-only (RRO) mounts This commit modifies the following files: - pkg/apis/core/types.go - staging/src/k8s.io/api/core/v1/types.go Other changes were auto-generated by running `make update`. Signed-off-by: Akihiro Suda Kubernetes-commit: d940886d0a4ee9aa8a7ca075fee175b002baf883 --- .../core/v1/containerstatus.go | 14 ++++ .../core/v1/noderuntimeclass.go | 48 +++++++++++++ .../core/v1/noderuntimeclassfeatures.go | 39 +++++++++++ applyconfigurations/core/v1/nodestatus.go | 14 ++++ applyconfigurations/core/v1/volumemount.go | 21 ++++-- .../core/v1/volumemountstatus.go | 70 +++++++++++++++++++ applyconfigurations/internal/internal.go | 50 +++++++++++++ applyconfigurations/utils.go | 6 ++ 8 files changed, 256 insertions(+), 6 deletions(-) create mode 100644 applyconfigurations/core/v1/noderuntimeclass.go create mode 100644 applyconfigurations/core/v1/noderuntimeclassfeatures.go create mode 100644 applyconfigurations/core/v1/volumemountstatus.go diff --git a/applyconfigurations/core/v1/containerstatus.go b/applyconfigurations/core/v1/containerstatus.go index 2b98c4658..e3f774bbb 100644 --- a/applyconfigurations/core/v1/containerstatus.go +++ b/applyconfigurations/core/v1/containerstatus.go @@ -36,6 +36,7 @@ type ContainerStatusApplyConfiguration struct { Started *bool `json:"started,omitempty"` AllocatedResources *corev1.ResourceList `json:"allocatedResources,omitempty"` Resources *ResourceRequirementsApplyConfiguration `json:"resources,omitempty"` + VolumeMounts []VolumeMountStatusApplyConfiguration `json:"volumeMounts,omitempty"` } // ContainerStatusApplyConfiguration constructs an declarative configuration of the ContainerStatus type for use with @@ -131,3 +132,16 @@ func (b *ContainerStatusApplyConfiguration) WithResources(value *ResourceRequire b.Resources = value return b } + +// WithVolumeMounts adds the given value to the VolumeMounts 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 VolumeMounts field. +func (b *ContainerStatusApplyConfiguration) WithVolumeMounts(values ...*VolumeMountStatusApplyConfiguration) *ContainerStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithVolumeMounts") + } + b.VolumeMounts = append(b.VolumeMounts, *values[i]) + } + return b +} diff --git a/applyconfigurations/core/v1/noderuntimeclass.go b/applyconfigurations/core/v1/noderuntimeclass.go new file mode 100644 index 000000000..497416957 --- /dev/null +++ b/applyconfigurations/core/v1/noderuntimeclass.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 v1 + +// NodeRuntimeClassApplyConfiguration represents an declarative configuration of the NodeRuntimeClass type for use +// with apply. +type NodeRuntimeClassApplyConfiguration struct { + Name *string `json:"name,omitempty"` + Features *NodeRuntimeClassFeaturesApplyConfiguration `json:"features,omitempty"` +} + +// NodeRuntimeClassApplyConfiguration constructs an declarative configuration of the NodeRuntimeClass type for use with +// apply. +func NodeRuntimeClass() *NodeRuntimeClassApplyConfiguration { + return &NodeRuntimeClassApplyConfiguration{} +} + +// 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 *NodeRuntimeClassApplyConfiguration) WithName(value string) *NodeRuntimeClassApplyConfiguration { + b.Name = &value + 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 *NodeRuntimeClassApplyConfiguration) WithFeatures(value *NodeRuntimeClassFeaturesApplyConfiguration) *NodeRuntimeClassApplyConfiguration { + b.Features = value + return b +} diff --git a/applyconfigurations/core/v1/noderuntimeclassfeatures.go b/applyconfigurations/core/v1/noderuntimeclassfeatures.go new file mode 100644 index 000000000..d3960eed9 --- /dev/null +++ b/applyconfigurations/core/v1/noderuntimeclassfeatures.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 + +// NodeRuntimeClassFeaturesApplyConfiguration represents an declarative configuration of the NodeRuntimeClassFeatures type for use +// with apply. +type NodeRuntimeClassFeaturesApplyConfiguration struct { + RecursiveReadOnlyMounts *bool `json:"recursiveReadOnlyMounts,omitempty"` +} + +// NodeRuntimeClassFeaturesApplyConfiguration constructs an declarative configuration of the NodeRuntimeClassFeatures type for use with +// apply. +func NodeRuntimeClassFeatures() *NodeRuntimeClassFeaturesApplyConfiguration { + return &NodeRuntimeClassFeaturesApplyConfiguration{} +} + +// WithRecursiveReadOnlyMounts sets the RecursiveReadOnlyMounts field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the RecursiveReadOnlyMounts field is set to the value of the last call. +func (b *NodeRuntimeClassFeaturesApplyConfiguration) WithRecursiveReadOnlyMounts(value bool) *NodeRuntimeClassFeaturesApplyConfiguration { + b.RecursiveReadOnlyMounts = &value + return b +} diff --git a/applyconfigurations/core/v1/nodestatus.go b/applyconfigurations/core/v1/nodestatus.go index aa3603f4f..46e93ac85 100644 --- a/applyconfigurations/core/v1/nodestatus.go +++ b/applyconfigurations/core/v1/nodestatus.go @@ -36,6 +36,7 @@ type NodeStatusApplyConfiguration struct { VolumesInUse []v1.UniqueVolumeName `json:"volumesInUse,omitempty"` VolumesAttached []AttachedVolumeApplyConfiguration `json:"volumesAttached,omitempty"` Config *NodeConfigStatusApplyConfiguration `json:"config,omitempty"` + RuntimeClasses []NodeRuntimeClassApplyConfiguration `json:"runtimeClasses,omitempty"` } // NodeStatusApplyConfiguration constructs an declarative configuration of the NodeStatus type for use with @@ -153,3 +154,16 @@ func (b *NodeStatusApplyConfiguration) WithConfig(value *NodeConfigStatusApplyCo b.Config = value return b } + +// WithRuntimeClasses adds the given value to the RuntimeClasses 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 RuntimeClasses field. +func (b *NodeStatusApplyConfiguration) WithRuntimeClasses(values ...*NodeRuntimeClassApplyConfiguration) *NodeStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithRuntimeClasses") + } + b.RuntimeClasses = append(b.RuntimeClasses, *values[i]) + } + return b +} diff --git a/applyconfigurations/core/v1/volumemount.go b/applyconfigurations/core/v1/volumemount.go index b0bec9ffe..358658350 100644 --- a/applyconfigurations/core/v1/volumemount.go +++ b/applyconfigurations/core/v1/volumemount.go @@ -25,12 +25,13 @@ import ( // VolumeMountApplyConfiguration represents an declarative configuration of the VolumeMount type for use // with apply. type VolumeMountApplyConfiguration struct { - Name *string `json:"name,omitempty"` - ReadOnly *bool `json:"readOnly,omitempty"` - MountPath *string `json:"mountPath,omitempty"` - SubPath *string `json:"subPath,omitempty"` - MountPropagation *v1.MountPropagationMode `json:"mountPropagation,omitempty"` - SubPathExpr *string `json:"subPathExpr,omitempty"` + Name *string `json:"name,omitempty"` + ReadOnly *bool `json:"readOnly,omitempty"` + RecursiveReadOnly *v1.RecursiveReadOnlyMode `json:"recursiveReadOnly,omitempty"` + MountPath *string `json:"mountPath,omitempty"` + SubPath *string `json:"subPath,omitempty"` + MountPropagation *v1.MountPropagationMode `json:"mountPropagation,omitempty"` + SubPathExpr *string `json:"subPathExpr,omitempty"` } // VolumeMountApplyConfiguration constructs an declarative configuration of the VolumeMount type for use with @@ -55,6 +56,14 @@ func (b *VolumeMountApplyConfiguration) WithReadOnly(value bool) *VolumeMountApp return b } +// WithRecursiveReadOnly sets the RecursiveReadOnly field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the RecursiveReadOnly field is set to the value of the last call. +func (b *VolumeMountApplyConfiguration) WithRecursiveReadOnly(value v1.RecursiveReadOnlyMode) *VolumeMountApplyConfiguration { + b.RecursiveReadOnly = &value + return b +} + // WithMountPath sets the MountPath field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the MountPath field is set to the value of the last call. diff --git a/applyconfigurations/core/v1/volumemountstatus.go b/applyconfigurations/core/v1/volumemountstatus.go new file mode 100644 index 000000000..c3d187fdf --- /dev/null +++ b/applyconfigurations/core/v1/volumemountstatus.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 applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "k8s.io/api/core/v1" +) + +// VolumeMountStatusApplyConfiguration represents an declarative configuration of the VolumeMountStatus type for use +// with apply. +type VolumeMountStatusApplyConfiguration struct { + Name *string `json:"name,omitempty"` + MountPath *string `json:"mountPath,omitempty"` + ReadOnly *bool `json:"readOnly,omitempty"` + RecursiveReadOnly *v1.RecursiveReadOnlyMode `json:"recursiveReadOnly,omitempty"` +} + +// VolumeMountStatusApplyConfiguration constructs an declarative configuration of the VolumeMountStatus type for use with +// apply. +func VolumeMountStatus() *VolumeMountStatusApplyConfiguration { + return &VolumeMountStatusApplyConfiguration{} +} + +// 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 *VolumeMountStatusApplyConfiguration) WithName(value string) *VolumeMountStatusApplyConfiguration { + b.Name = &value + return b +} + +// WithMountPath sets the MountPath field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MountPath field is set to the value of the last call. +func (b *VolumeMountStatusApplyConfiguration) WithMountPath(value string) *VolumeMountStatusApplyConfiguration { + b.MountPath = &value + return b +} + +// WithReadOnly sets the ReadOnly field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ReadOnly field is set to the value of the last call. +func (b *VolumeMountStatusApplyConfiguration) WithReadOnly(value bool) *VolumeMountStatusApplyConfiguration { + b.ReadOnly = &value + return b +} + +// WithRecursiveReadOnly sets the RecursiveReadOnly field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the RecursiveReadOnly field is set to the value of the last call. +func (b *VolumeMountStatusApplyConfiguration) WithRecursiveReadOnly(value v1.RecursiveReadOnlyMode) *VolumeMountStatusApplyConfiguration { + b.RecursiveReadOnly = &value + return b +} diff --git a/applyconfigurations/internal/internal.go b/applyconfigurations/internal/internal.go index 62a8e823a..1016ceeee 100644 --- a/applyconfigurations/internal/internal.go +++ b/applyconfigurations/internal/internal.go @@ -5080,6 +5080,14 @@ var schemaYAML = typed.YAMLObject(`types: type: namedType: io.k8s.api.core.v1.ContainerState default: {} + - name: volumeMounts + type: + list: + elementType: + namedType: io.k8s.api.core.v1.VolumeMountStatus + elementRelationship: associative + keys: + - mountPath - name: io.k8s.api.core.v1.DaemonEndpoint map: fields: @@ -6065,6 +6073,22 @@ var schemaYAML = typed.YAMLObject(`types: type: namedType: io.k8s.api.core.v1.DaemonEndpoint default: {} +- name: io.k8s.api.core.v1.NodeRuntimeClass + map: + fields: + - name: features + type: + namedType: io.k8s.api.core.v1.NodeRuntimeClassFeatures + - name: name + type: + scalar: string + default: "" +- name: io.k8s.api.core.v1.NodeRuntimeClassFeatures + map: + fields: + - name: recursiveReadOnlyMounts + type: + scalar: boolean - name: io.k8s.api.core.v1.NodeSelector map: fields: @@ -6187,6 +6211,12 @@ var schemaYAML = typed.YAMLObject(`types: - name: phase type: scalar: string + - name: runtimeClasses + type: + list: + elementType: + namedType: io.k8s.api.core.v1.NodeRuntimeClass + elementRelationship: atomic - name: volumesAttached type: list: @@ -8186,12 +8216,32 @@ var schemaYAML = typed.YAMLObject(`types: - name: readOnly type: scalar: boolean + - name: recursiveReadOnly + type: + scalar: string - name: subPath type: scalar: string - name: subPathExpr type: scalar: string +- name: io.k8s.api.core.v1.VolumeMountStatus + map: + fields: + - name: mountPath + type: + scalar: string + default: "" + - name: name + type: + scalar: string + default: "" + - name: readOnly + type: + scalar: boolean + - name: recursiveReadOnly + type: + scalar: string - name: io.k8s.api.core.v1.VolumeNodeAffinity map: fields: diff --git a/applyconfigurations/utils.go b/applyconfigurations/utils.go index 604900272..4aa30503a 100644 --- a/applyconfigurations/utils.go +++ b/applyconfigurations/utils.go @@ -801,6 +801,10 @@ func ForKind(kind schema.GroupVersionKind) interface{} { return &applyconfigurationscorev1.NodeConfigStatusApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("NodeDaemonEndpoints"): return &applyconfigurationscorev1.NodeDaemonEndpointsApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("NodeRuntimeClass"): + return &applyconfigurationscorev1.NodeRuntimeClassApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("NodeRuntimeClassFeatures"): + return &applyconfigurationscorev1.NodeRuntimeClassFeaturesApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("NodeSelector"): return &applyconfigurationscorev1.NodeSelectorApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("NodeSelectorRequirement"): @@ -983,6 +987,8 @@ func ForKind(kind schema.GroupVersionKind) interface{} { return &applyconfigurationscorev1.VolumeDeviceApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("VolumeMount"): return &applyconfigurationscorev1.VolumeMountApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("VolumeMountStatus"): + return &applyconfigurationscorev1.VolumeMountStatusApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("VolumeNodeAffinity"): return &applyconfigurationscorev1.VolumeNodeAffinityApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("VolumeProjection"): From 7ebe0ea60e0a6bea3e8280871c1241d0405cdb32 Mon Sep 17 00:00:00 2001 From: Kubernetes Publisher Date: Sat, 9 Mar 2024 11:01:50 -0800 Subject: [PATCH 086/239] Merge pull request #123180 from AkihiroSuda/rro KEP-3857: Recursive Read-only (RRO) mounts Kubernetes-commit: eafd2897e24b5b069bcdf83ac7a9b2c0b894dbb8 --- go.mod | 4 ++-- go.sum | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 4c3eacf67..3a3750323 100644 --- a/go.mod +++ b/go.mod @@ -24,7 +24,7 @@ require ( golang.org/x/term v0.17.0 golang.org/x/time v0.3.0 google.golang.org/protobuf v1.33.0 - k8s.io/api v0.0.0-20240308214516-0cf49f55b90f + k8s.io/api v0.0.0-20240309190150-089c7cae4c5d k8s.io/apimachinery v0.0.0-20240307171817-d82afe1e363a k8s.io/klog/v2 v2.120.1 k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 @@ -61,6 +61,6 @@ require ( ) replace ( - k8s.io/api => k8s.io/api v0.0.0-20240308214516-0cf49f55b90f + k8s.io/api => k8s.io/api v0.0.0-20240309190150-089c7cae4c5d k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20240307171817-d82afe1e363a ) diff --git a/go.sum b/go.sum index 739750379..687b7b8e7 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-20240308214516-0cf49f55b90f h1:3mFcDB/sMp+rdKFYJ0fssV6uaULlg3CEWXEtB+UdUPM= -k8s.io/api v0.0.0-20240308214516-0cf49f55b90f/go.mod h1:RzL8aPQw9ZdVXCdY+Iz3AXnVX+jFyQNqcmzmS+2/Ur0= +k8s.io/api v0.0.0-20240309190150-089c7cae4c5d h1:+Da06Nik1YMNkEve7HOo7NuzbWiOpLkdouF8Ww1U4Ao= +k8s.io/api v0.0.0-20240309190150-089c7cae4c5d/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/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw= From 45e17fede08496913c4ce21def96bdff28987d76 Mon Sep 17 00:00:00 2001 From: Lukasz Szaszkiewicz Date: Mon, 11 Mar 2024 12:56:40 +0100 Subject: [PATCH 087/239] 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 f733e244c..14221cd24 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 76eacb5a5..a2eec9193 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 00e4609774f85ccbd8f018ebaac8d03e7bd83e84 Mon Sep 17 00:00:00 2001 From: Akihiro Suda Date: Thu, 14 Mar 2024 07:21:47 +0900 Subject: [PATCH 088/239] api: NodeStatus: rename RuntimeClasses to RuntimeHandlers The runtime classes are apiserver's concept, while the handlers are kubelet's concept. For NodeStatus, it makes more sense to return the latter ones here. This commit modifies the following files: - pkg/apis/core/types.go - staging/src/k8s.io/api/core/v1/types.go - pkg/kubelet/nodestatus/setters.go - pkg/kubelet/kubelet_node_status.go - pkg/registry/core/node/strategy.go - test/e2e_node/mount_rro_linux_test.go Other changes were auto-generated by running `make update`. Signed-off-by: Akihiro Suda Kubernetes-commit: 1dc05009fe7f4e1d139b0c8394683edb54f8d082 --- ...deruntimeclass.go => noderuntimehandler.go} | 18 +++++++++--------- ...atures.go => noderuntimehandlerfeatures.go} | 12 ++++++------ applyconfigurations/core/v1/nodestatus.go | 12 ++++++------ applyconfigurations/internal/internal.go | 10 +++++----- applyconfigurations/utils.go | 8 ++++---- 5 files changed, 30 insertions(+), 30 deletions(-) rename applyconfigurations/core/v1/{noderuntimeclass.go => noderuntimehandler.go} (60%) rename applyconfigurations/core/v1/{noderuntimeclassfeatures.go => noderuntimehandlerfeatures.go} (64%) diff --git a/applyconfigurations/core/v1/noderuntimeclass.go b/applyconfigurations/core/v1/noderuntimehandler.go similarity index 60% rename from applyconfigurations/core/v1/noderuntimeclass.go rename to applyconfigurations/core/v1/noderuntimehandler.go index 497416957..9ada0a18e 100644 --- a/applyconfigurations/core/v1/noderuntimeclass.go +++ b/applyconfigurations/core/v1/noderuntimehandler.go @@ -18,23 +18,23 @@ limitations under the License. package v1 -// NodeRuntimeClassApplyConfiguration represents an declarative configuration of the NodeRuntimeClass type for use +// NodeRuntimeHandlerApplyConfiguration represents an declarative configuration of the NodeRuntimeHandler type for use // with apply. -type NodeRuntimeClassApplyConfiguration struct { - Name *string `json:"name,omitempty"` - Features *NodeRuntimeClassFeaturesApplyConfiguration `json:"features,omitempty"` +type NodeRuntimeHandlerApplyConfiguration struct { + Name *string `json:"name,omitempty"` + Features *NodeRuntimeHandlerFeaturesApplyConfiguration `json:"features,omitempty"` } -// NodeRuntimeClassApplyConfiguration constructs an declarative configuration of the NodeRuntimeClass type for use with +// NodeRuntimeHandlerApplyConfiguration constructs an declarative configuration of the NodeRuntimeHandler type for use with // apply. -func NodeRuntimeClass() *NodeRuntimeClassApplyConfiguration { - return &NodeRuntimeClassApplyConfiguration{} +func NodeRuntimeHandler() *NodeRuntimeHandlerApplyConfiguration { + return &NodeRuntimeHandlerApplyConfiguration{} } // 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 *NodeRuntimeClassApplyConfiguration) WithName(value string) *NodeRuntimeClassApplyConfiguration { +func (b *NodeRuntimeHandlerApplyConfiguration) WithName(value string) *NodeRuntimeHandlerApplyConfiguration { b.Name = &value return b } @@ -42,7 +42,7 @@ func (b *NodeRuntimeClassApplyConfiguration) WithName(value string) *NodeRuntime // 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 *NodeRuntimeClassApplyConfiguration) WithFeatures(value *NodeRuntimeClassFeaturesApplyConfiguration) *NodeRuntimeClassApplyConfiguration { +func (b *NodeRuntimeHandlerApplyConfiguration) WithFeatures(value *NodeRuntimeHandlerFeaturesApplyConfiguration) *NodeRuntimeHandlerApplyConfiguration { b.Features = value return b } diff --git a/applyconfigurations/core/v1/noderuntimeclassfeatures.go b/applyconfigurations/core/v1/noderuntimehandlerfeatures.go similarity index 64% rename from applyconfigurations/core/v1/noderuntimeclassfeatures.go rename to applyconfigurations/core/v1/noderuntimehandlerfeatures.go index d3960eed9..a3e3a52e8 100644 --- a/applyconfigurations/core/v1/noderuntimeclassfeatures.go +++ b/applyconfigurations/core/v1/noderuntimehandlerfeatures.go @@ -18,22 +18,22 @@ limitations under the License. package v1 -// NodeRuntimeClassFeaturesApplyConfiguration represents an declarative configuration of the NodeRuntimeClassFeatures type for use +// NodeRuntimeHandlerFeaturesApplyConfiguration represents an declarative configuration of the NodeRuntimeHandlerFeatures type for use // with apply. -type NodeRuntimeClassFeaturesApplyConfiguration struct { +type NodeRuntimeHandlerFeaturesApplyConfiguration struct { RecursiveReadOnlyMounts *bool `json:"recursiveReadOnlyMounts,omitempty"` } -// NodeRuntimeClassFeaturesApplyConfiguration constructs an declarative configuration of the NodeRuntimeClassFeatures type for use with +// NodeRuntimeHandlerFeaturesApplyConfiguration constructs an declarative configuration of the NodeRuntimeHandlerFeatures type for use with // apply. -func NodeRuntimeClassFeatures() *NodeRuntimeClassFeaturesApplyConfiguration { - return &NodeRuntimeClassFeaturesApplyConfiguration{} +func NodeRuntimeHandlerFeatures() *NodeRuntimeHandlerFeaturesApplyConfiguration { + return &NodeRuntimeHandlerFeaturesApplyConfiguration{} } // WithRecursiveReadOnlyMounts sets the RecursiveReadOnlyMounts field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the RecursiveReadOnlyMounts field is set to the value of the last call. -func (b *NodeRuntimeClassFeaturesApplyConfiguration) WithRecursiveReadOnlyMounts(value bool) *NodeRuntimeClassFeaturesApplyConfiguration { +func (b *NodeRuntimeHandlerFeaturesApplyConfiguration) WithRecursiveReadOnlyMounts(value bool) *NodeRuntimeHandlerFeaturesApplyConfiguration { b.RecursiveReadOnlyMounts = &value return b } diff --git a/applyconfigurations/core/v1/nodestatus.go b/applyconfigurations/core/v1/nodestatus.go index 46e93ac85..a4a30a268 100644 --- a/applyconfigurations/core/v1/nodestatus.go +++ b/applyconfigurations/core/v1/nodestatus.go @@ -36,7 +36,7 @@ type NodeStatusApplyConfiguration struct { VolumesInUse []v1.UniqueVolumeName `json:"volumesInUse,omitempty"` VolumesAttached []AttachedVolumeApplyConfiguration `json:"volumesAttached,omitempty"` Config *NodeConfigStatusApplyConfiguration `json:"config,omitempty"` - RuntimeClasses []NodeRuntimeClassApplyConfiguration `json:"runtimeClasses,omitempty"` + RuntimeHandlers []NodeRuntimeHandlerApplyConfiguration `json:"runtimeHandlers,omitempty"` } // NodeStatusApplyConfiguration constructs an declarative configuration of the NodeStatus type for use with @@ -155,15 +155,15 @@ func (b *NodeStatusApplyConfiguration) WithConfig(value *NodeConfigStatusApplyCo return b } -// WithRuntimeClasses adds the given value to the RuntimeClasses field in the declarative configuration +// WithRuntimeHandlers adds the given value to the RuntimeHandlers 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 RuntimeClasses field. -func (b *NodeStatusApplyConfiguration) WithRuntimeClasses(values ...*NodeRuntimeClassApplyConfiguration) *NodeStatusApplyConfiguration { +// If called multiple times, values provided by each call will be appended to the RuntimeHandlers field. +func (b *NodeStatusApplyConfiguration) WithRuntimeHandlers(values ...*NodeRuntimeHandlerApplyConfiguration) *NodeStatusApplyConfiguration { for i := range values { if values[i] == nil { - panic("nil value passed to WithRuntimeClasses") + panic("nil value passed to WithRuntimeHandlers") } - b.RuntimeClasses = append(b.RuntimeClasses, *values[i]) + b.RuntimeHandlers = append(b.RuntimeHandlers, *values[i]) } return b } diff --git a/applyconfigurations/internal/internal.go b/applyconfigurations/internal/internal.go index 1016ceeee..0d753b07b 100644 --- a/applyconfigurations/internal/internal.go +++ b/applyconfigurations/internal/internal.go @@ -6073,17 +6073,17 @@ var schemaYAML = typed.YAMLObject(`types: type: namedType: io.k8s.api.core.v1.DaemonEndpoint default: {} -- name: io.k8s.api.core.v1.NodeRuntimeClass +- name: io.k8s.api.core.v1.NodeRuntimeHandler map: fields: - name: features type: - namedType: io.k8s.api.core.v1.NodeRuntimeClassFeatures + namedType: io.k8s.api.core.v1.NodeRuntimeHandlerFeatures - name: name type: scalar: string default: "" -- name: io.k8s.api.core.v1.NodeRuntimeClassFeatures +- name: io.k8s.api.core.v1.NodeRuntimeHandlerFeatures map: fields: - name: recursiveReadOnlyMounts @@ -6211,11 +6211,11 @@ var schemaYAML = typed.YAMLObject(`types: - name: phase type: scalar: string - - name: runtimeClasses + - name: runtimeHandlers type: list: elementType: - namedType: io.k8s.api.core.v1.NodeRuntimeClass + namedType: io.k8s.api.core.v1.NodeRuntimeHandler elementRelationship: atomic - name: volumesAttached type: diff --git a/applyconfigurations/utils.go b/applyconfigurations/utils.go index 4aa30503a..2529f03f9 100644 --- a/applyconfigurations/utils.go +++ b/applyconfigurations/utils.go @@ -801,10 +801,10 @@ func ForKind(kind schema.GroupVersionKind) interface{} { return &applyconfigurationscorev1.NodeConfigStatusApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("NodeDaemonEndpoints"): return &applyconfigurationscorev1.NodeDaemonEndpointsApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("NodeRuntimeClass"): - return &applyconfigurationscorev1.NodeRuntimeClassApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("NodeRuntimeClassFeatures"): - return &applyconfigurationscorev1.NodeRuntimeClassFeaturesApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("NodeRuntimeHandler"): + return &applyconfigurationscorev1.NodeRuntimeHandlerApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("NodeRuntimeHandlerFeatures"): + return &applyconfigurationscorev1.NodeRuntimeHandlerFeaturesApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("NodeSelector"): return &applyconfigurationscorev1.NodeSelectorApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("NodeSelectorRequirement"): From 650f39267a15ca778ad5fb0cec62dbe4ebd607c2 Mon Sep 17 00:00:00 2001 From: Patrick Ohly Date: Thu, 14 Mar 2024 14:08:17 +0100 Subject: [PATCH 089/239] dra api: NodeResourceModel -> ResourceModel When renaming NodeResourceSlice to ResourceSlice, the embedded [Node]ResourceModel also should have been renamed. Kubernetes-commit: a0add8d2c7578cd9f94fc302d6212f9f7d16175b --- .../{noderesourcemodel.go => resourcemodel.go} | 12 ++++++------ .../resource/v1alpha2/resourceslice.go | 10 +++++----- applyconfigurations/utils.go | 4 ++-- 3 files changed, 13 insertions(+), 13 deletions(-) rename applyconfigurations/resource/v1alpha2/{noderesourcemodel.go => resourcemodel.go} (66%) diff --git a/applyconfigurations/resource/v1alpha2/noderesourcemodel.go b/applyconfigurations/resource/v1alpha2/resourcemodel.go similarity index 66% rename from applyconfigurations/resource/v1alpha2/noderesourcemodel.go rename to applyconfigurations/resource/v1alpha2/resourcemodel.go index 20b7ea861..8ad7bdf23 100644 --- a/applyconfigurations/resource/v1alpha2/noderesourcemodel.go +++ b/applyconfigurations/resource/v1alpha2/resourcemodel.go @@ -18,22 +18,22 @@ limitations under the License. package v1alpha2 -// NodeResourceModelApplyConfiguration represents an declarative configuration of the NodeResourceModel type for use +// ResourceModelApplyConfiguration represents an declarative configuration of the ResourceModel type for use // with apply. -type NodeResourceModelApplyConfiguration struct { +type ResourceModelApplyConfiguration struct { NamedResources *NamedResourcesResourcesApplyConfiguration `json:"namedResources,omitempty"` } -// NodeResourceModelApplyConfiguration constructs an declarative configuration of the NodeResourceModel type for use with +// ResourceModelApplyConfiguration constructs an declarative configuration of the ResourceModel type for use with // apply. -func NodeResourceModel() *NodeResourceModelApplyConfiguration { - return &NodeResourceModelApplyConfiguration{} +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 *NodeResourceModelApplyConfiguration) WithNamedResources(value *NamedResourcesResourcesApplyConfiguration) *NodeResourceModelApplyConfiguration { +func (b *ResourceModelApplyConfiguration) WithNamedResources(value *NamedResourcesResourcesApplyConfiguration) *ResourceModelApplyConfiguration { b.NamedResources = value return b } diff --git a/applyconfigurations/resource/v1alpha2/resourceslice.go b/applyconfigurations/resource/v1alpha2/resourceslice.go index 91ff2a3e5..ff737ce67 100644 --- a/applyconfigurations/resource/v1alpha2/resourceslice.go +++ b/applyconfigurations/resource/v1alpha2/resourceslice.go @@ -30,11 +30,11 @@ import ( // ResourceSliceApplyConfiguration represents an declarative configuration of the ResourceSlice type for use // with apply. type ResourceSliceApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` - *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` - NodeName *string `json:"nodeName,omitempty"` - DriverName *string `json:"driverName,omitempty"` - NodeResourceModelApplyConfiguration `json:",inline"` + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + NodeName *string `json:"nodeName,omitempty"` + DriverName *string `json:"driverName,omitempty"` + ResourceModelApplyConfiguration `json:",inline"` } // ResourceSlice constructs an declarative configuration of the ResourceSlice type for use with diff --git a/applyconfigurations/utils.go b/applyconfigurations/utils.go index 2529f03f9..75d9c5c04 100644 --- a/applyconfigurations/utils.go +++ b/applyconfigurations/utils.go @@ -1559,8 +1559,6 @@ func ForKind(kind schema.GroupVersionKind) interface{} { return &resourcev1alpha2.NamedResourcesResourcesApplyConfiguration{} case v1alpha2.SchemeGroupVersion.WithKind("NamedResourcesStringSlice"): return &resourcev1alpha2.NamedResourcesStringSliceApplyConfiguration{} - case v1alpha2.SchemeGroupVersion.WithKind("NodeResourceModel"): - return &resourcev1alpha2.NodeResourceModelApplyConfiguration{} case v1alpha2.SchemeGroupVersion.WithKind("PodSchedulingContext"): return &resourcev1alpha2.PodSchedulingContextApplyConfiguration{} case v1alpha2.SchemeGroupVersion.WithKind("PodSchedulingContextSpec"): @@ -1597,6 +1595,8 @@ func ForKind(kind schema.GroupVersionKind) interface{} { 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"): From 4467b1e4375ab06abab1beec60691767334379c6 Mon Sep 17 00:00:00 2001 From: Kubernetes Publisher Date: Thu, 14 Mar 2024 11:02:39 -0700 Subject: [PATCH 090/239] Merge pull request #123909 from AkihiroSuda/fix-123906 kubelet: fix mixing up runtime classes with runtime handlers Kubernetes-commit: 6ef2fec0dfef0c1fc456fac90d028b5c9431b6a0 --- go.mod | 4 ++-- go.sum | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 3a3750323..c17dea8ad 100644 --- a/go.mod +++ b/go.mod @@ -24,7 +24,7 @@ require ( golang.org/x/term v0.17.0 golang.org/x/time v0.3.0 google.golang.org/protobuf v1.33.0 - k8s.io/api v0.0.0-20240309190150-089c7cae4c5d + k8s.io/api v0.0.0-20240314180239-b048bd80bc44 k8s.io/apimachinery v0.0.0-20240307171817-d82afe1e363a k8s.io/klog/v2 v2.120.1 k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 @@ -61,6 +61,6 @@ require ( ) replace ( - k8s.io/api => k8s.io/api v0.0.0-20240309190150-089c7cae4c5d + k8s.io/api => k8s.io/api v0.0.0-20240314180239-b048bd80bc44 k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20240307171817-d82afe1e363a ) diff --git a/go.sum b/go.sum index 687b7b8e7..98e68886e 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-20240309190150-089c7cae4c5d h1:+Da06Nik1YMNkEve7HOo7NuzbWiOpLkdouF8Ww1U4Ao= -k8s.io/api v0.0.0-20240309190150-089c7cae4c5d/go.mod h1:RzL8aPQw9ZdVXCdY+Iz3AXnVX+jFyQNqcmzmS+2/Ur0= +k8s.io/api v0.0.0-20240314180239-b048bd80bc44 h1:e34PNgaXBr5zGyVZObwPJq4DCSrUYwbv+h/35dIMEI4= +k8s.io/api v0.0.0-20240314180239-b048bd80bc44/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/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw= From fa185a21dba355e46e1ea087d2edc656708f8a80 Mon Sep 17 00:00:00 2001 From: Lan Liang Date: Mon, 18 Mar 2024 08:10:12 +0000 Subject: [PATCH 091/239] 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 16933a4b5..abbfb0b50 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 b3c74f25b..58f81f749 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 41274b2c2..04d5817e4 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 092/239] sync: update go.mod --- go.mod | 5 ----- 1 file changed, 5 deletions(-) diff --git a/go.mod b/go.mod index 04bfce009..4c2cbf814 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 093/239] 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 0d753b07b..f3314a39e 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 094/239] 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 4c2cbf814..7d92a4168 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 26627599b..5f7f66084 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 095/239] 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 7d92a4168..3e496abf3 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 5f7f66084..0fb64c119 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 096/239] 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 ee19a5af9..c6f6f52fa 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 097/239] 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 c6f6f52fa..e523a6652 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 14221cd24..157436da7 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 611357b7d..84a8d2697 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 098/239] 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 efda7c197..1f9567881 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 c1df72030..958b96a80 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 3c589e17c..5eac320bc 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 a98a728f6..552ec7a8f 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 163d65c05..ff715482c 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 1cf2cd2f1..6cec86ee6 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 3e4016fb0..fe45afa5a 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 77e161307..3c55f829c 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 099/239] 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 9f908941c..7468b9167 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 94fd79f4b..7019f6968 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 100/239] 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 000000000..20bede85f --- /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 101/239] 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 20bede85f..2ae6dfc6a 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 000000000..9f6385a7e --- /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 000000000..ce69f1668 --- /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 000000000..5a742e1ca --- /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 000000000..b16229680 --- /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 000000000..8e9a2437b --- /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 000000000..d7e78a8aa --- /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 000000000..68e673f15 --- /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 000000000..4b6070652 --- /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 000000000..5d8e70214 --- /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 000000000..9c2724e3a --- /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 000000000..8436fb775 --- /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 102/239] 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 405858115..992c1f5a4 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 7160bb1ee..ce74dfb6f 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 103/239] 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 1e84a85a1..52a0725d4 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 b2ef5c912..7019f6968 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 104/239] 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 420ca7b2a..a60f44943 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 105/239] 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 52a0725d4..7e049fdbf 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 7019f6968..c7fc39ef3 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 106/239] 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 7468b9167..52a0725d4 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 107/239] 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 4b22d5d91..8c059be8e 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 56cc6cf42..913aa6cb5 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 108/239] 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 a3a037a1d..4122955c1 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 b8684218d..ee1358c11 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 109/239] 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 af840c4a2..5a1194b4a 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 110/239] 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 e854840ae..b8825dc1e 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 dc22b6ec4..e76f65812 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 111/239] 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 4122955c1..49fb47bb1 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 ee1358c11..e70b478fa 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 112/239] 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 000000000..22d3c6b3f --- /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 000000000..99585f939 --- /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 000000000..2d178ce37 --- /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 113/239] 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 f3314a39e..610b4d13d 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 49fb47bb1..b691350b7 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 e70b478fa..c1ef8037c 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 114/239] 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 abc0a7293..b9afc700e 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 bd867a9b8..15221adf8 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 115/239] 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 b9afc700e..10fe4d8ad 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 15221adf8..2b6899854 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 116/239] 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 157436da7..67e6feb97 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 a2eec9193..c2fbeca82 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 117/239] 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 10fe4d8ad..339c3da9a 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 2b6899854..368f51c5a 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 118/239] 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 67e6feb97..7b0816068 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 119/239] 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 120/239] 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 7b0816068..a617147bd 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 aa3027d71..0aacee4a0 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 3c7eda7de..a878e488b 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 121/239] 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 336202e24..32946345d 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 122/239] 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 0745fb4a3..0b3b14f8d 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 f1bdef78e..a988a4afc 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 58f81f749..04df262ce 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 123/239] 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 9f0251c0b..9163c051d 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 89e86974c..e4680399d 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 124/239] 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 4c28a3d3d..430fb77ac 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 c083475f7..47226d484 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 125/239] 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 f9edfdf0d..8c3f887dc 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 247c7cb79..87a12da59 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 a6089be5c..5a6830376 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 126/239] 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 000000000..4f4c3ed4d --- /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 bc22e58b6..5048f9df9 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 127/239] 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 4ebfe81bb..badd871fa 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 128/239] 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 339c3da9a..4c28a3d3d 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 368f51c5a..c083475f7 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 129/239] 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 a878e488b..81affb75d 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 130/239] 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 131/239] 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 132/239] 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 0aacee4a0..ce5348381 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 81affb75d..8ce0e3127 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 133/239] 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 ce5348381..084f13226 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 8ce0e3127..9cbe036ea 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 134/239] 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 000000000..bd857de7a --- /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 000000000..7d0d8bb62 --- /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 084f13226..64288eb86 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 9cbe036ea..c6d21754e 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 135/239] 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 000000000..7610c05c2 --- /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 000000000..3e61e1f2b --- /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 136/239] 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 137/239] 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 edbc826d1..93eb62aa8 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 0b0b05acd..9bd895051 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 83a8ef163..872bacc65 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 065e3c834..585dc22de 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 1d994b5ab..dafd92237 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 39823ca82..c8a6c768b 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 ca6bb8bd5..8e1833448 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 bea51b587..2cb47362e 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 bba37bb04..6f0536079 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 5ba5974d7..671ec8116 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 18789c7f8..7f0d60ce3 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 f4b198265..6a12cc398 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 53e539287..251d98e0b 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 ccc2049ff..c97894f15 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 917ed521f..e28f784f9 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 d1fbb915d..2e94e1a6a 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 0c3f49ba1..044101c95 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 281758c43..47edb1c8f 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 3f1aebcff..e39d7cf5e 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 e1643277a..9a97558ea 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 1391df87d..2411dda80 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 5bda0d92c..ced67eb0d 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 988d898f7..17f9a737d 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 0416675d6..0ddb1095f 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 19afde66d..bba453183 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 3a077d71d..2eb1165e6 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 5080912a1..5912300c2 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 0ddb9108b..518e0c26a 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 925026321..a16ec5ba5 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 c076c80af..6663bceb2 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 d687339ae..0401f2249 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 0d6b68b29..79c9daf3e 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 970fb15e6..c4e0ca65a 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 ec0b9d266..d88d4020c 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 9e6b169a8..032787c67 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 1bbd57bdd..e6841ffd9 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 0fef56429..f2ea72e46 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 b68177720..27d19b8bd 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 cdf464b06..cf811572b 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 8274d85ff..9873dbdb0 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 e6883b607..92f6b2f54 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 06c77b4c4..709d53ad8 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 d9725b2f9..4a4fc825c 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 a8e229597..63442dd9b 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 2e7f4fb44..3b3c61c6b 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 63122cf3f..a275bd2c7 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 ff90fc0e6..f65704653 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 49c75d967..1ff2371f1 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 8444d164e..32d0e33eb 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 4aba33038..d0eee6691 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 3fe22ba44..b87f5acdc 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 bdf589b96..ea08445ec 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 63e616b03..eb9503bdd 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 2ade83302..97f9bbb1e 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 c9f2bbed5..b34940c80 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 dfdf8b897..cc7174aa5 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 ffe219fda..128d585e3 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 c41d8dbc2..245e05ad9 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 dd4012cc2..c5c0376c3 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 978b26db0..9bbe42579 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 3c907a3a0..1ac971cfa 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 bd36c5e6a..504338ea5 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 797fe9403..15328d0dc 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 a9d38becf..b6a6ea584 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 41f35cbcc..7dff54530 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 3a1f12b6a..326405096 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 f028869f1..a1621fc2d 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 5fa39d6ba..93bd35532 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 49f05257c..d419be5f8 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 9923d6cba..dbdf32b90 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 16c8e48bf..4ca832c90 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 d7454ce14..1fd8bd034 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 fff193d68..fcf63fc85 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 100f290a1..392f30d2e 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 b309281af..92df698e8 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 50ccdfdbb..577a4d87e 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 5ec38b203..c8911b1e6 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 039a7ace1..c9fdaae5a 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 f8990adf1..341a1e096 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 58db3acf9..37d93a2b2 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 168728992..86fa7a689 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 000d737f0..c072389a7 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 31db43d98..09003ceb2 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 93810a3ff..fd2b92c03 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 2ace93860..567c4b51c 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 d6d30e99e..b8021be3a 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 2eded92ac..f55f7db39 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 43c16fde7..babc5d245 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 3129c9b4e..1804457ea 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 a3d67f031..e61f4ce37 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 ae39cbb9a..a80e99be3 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 e789e42fe..2dbb713d5 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 1461ba3b6..dfb60abc4 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 72e81a29e..f5158bb63 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 cfb27c9db..bd1e574f4 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 d08afcb61..4f37f1672 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 3f4e32006..b9d7ab833 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 95a4ac566..6a30db0bf 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 8ac9be078..7603c8b05 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 302f370d5..29440c579 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 c68ec5da4..c7eb4c616 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 a9b8c19c7..40ce34379 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 155476e4c..d22d9bafc 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 d9dc4151e..afb106693 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 17dbc8c1c..4d5ce7899 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 6bb50e0da..4c3e1f249 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 8e97d90a0..cce61b2c0 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 c1dbec84f..c29fe4486 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 bf5d64ddd..2d464baa6 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 58abb748f..69aa9d8a2 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 6633a4dc1..e049d94b2 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 04e677db0..861a9c051 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 c3760b5ce..effe3d98a 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 98ba936dc..eb4e04455 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 9b4ef231c..b38a78db6 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 35a8b64fc..e82276772 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 be66a5b94..17fe4ac2e 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 138/239] 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 64288eb86..2a5d20987 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 c6d21754e..a7c692899 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 139/239] 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 0b3b14f8d..55947d209 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 140/239] 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 141/239] 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 e3f774bbb..5918f3603 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 000000000..e538a46d6 --- /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 000000000..fdafd78e1 --- /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 6b340294e..344c40fb8 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 610b4d13d..4b500dee0 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 75d9c5c04..623c10376 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 664bb1999..9f0251c0b 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 94faeba7e..89e86974c 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 142/239] 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 84a8d2697..336202e24 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 143/239] 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 cd5eb4407..1f8e16c2e 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 144/239] 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 09f44c696..34afbf2f4 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 22e078b5c..3d023a1f7 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 145/239] 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 4b5485953..9ea8ef369 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 146/239] 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 2a5d20987..b33d08032 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 a7c692899..59682a68a 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 147/239] 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 148/239] 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 3e61e1f2b..655d9c998 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 149/239] 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 59682a68a..f4165fe88 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 150/239] 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 34afbf2f4..d1adb5f71 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 3d023a1f7..ec9de6701 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 151/239] 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 f4165fe88..300e8d9ea 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 152/239] 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 655d9c998..0a0debd7e 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 153/239] 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 0a0debd7e..945e07310 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 154/239] 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 155/239] 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 d1adb5f71..0beaf6924 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 ec9de6701..a61d5e516 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 156/239] 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 0beaf6924..46450b3fb 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 a61d5e516..587aa97f9 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 157/239] 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 945e07310..e0a250166 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 000000000..cda5fc205 --- /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 158/239] 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 bd857de7a..a7e0d9c43 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 159/239] 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 160/239] 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 000000000..84106458a --- /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 000000000..b3cc10e1a --- /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 161/239] 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 7d0d8bb62..000000000 --- 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 162/239] 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 163/239] 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 10b7e6512..f5708ffeb 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 164/239] 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 a617147bd..5e7dd5740 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 32946345d..1b4904a62 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 165/239] 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 93eb62aa8..4a5030684 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 9bd895051..33260641a 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 872bacc65..eac9f604e 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 585dc22de..eb7df7efe 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 dafd92237..7c2e9fd21 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 c8a6c768b..d4e4b8337 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 8e1833448..9ca778b6f 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 2cb47362e..563e887b2 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 6f0536079..f7f06218f 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 671ec8116..d20801a1f 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 7f0d60ce3..100f486a2 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 6a12cc398..acf50b58c 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 251d98e0b..60741f088 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 c97894f15..256dd69bb 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 e28f784f9..f8c6ca8ec 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 2e94e1a6a..ed667566b 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 044101c95..efa2e74db 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 47edb1c8f..c46987acc 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 e39d7cf5e..bdddacec4 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 9a97558ea..62c539efc 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 2411dda80..e4006bc51 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 ced67eb0d..43e48cdb2 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 17f9a737d..5d815771c 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 0ddb1095f..923a10cb3 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 bba453183..66a3d7924 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 2eb1165e6..278614af8 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 5912300c2..76c9ce3f5 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 518e0c26a..3da8fa928 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 a16ec5ba5..763176c4c 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 6663bceb2..148b68aed 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 0401f2249..e6ee1fc14 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 79c9daf3e..bcc6841a1 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 c4e0ca65a..bfb1659b2 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 d88d4020c..3abb541f5 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 032787c67..669f8548c 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 e6841ffd9..4a990053b 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 f2ea72e46..de958c6e9 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 27d19b8bd..916786d53 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 cf811572b..02a87b532 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 9873dbdb0..d045c99f3 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 92f6b2f54..e5f54e1f6 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 709d53ad8..6d430cf99 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 4a4fc825c..a3ea2a8a9 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 63442dd9b..c25233054 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 3b3c61c6b..a31824064 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 a275bd2c7..23f80160a 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 f65704653..47f358809 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 1ff2371f1..d7c485137 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 32d0e33eb..3e28a0b05 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 d0eee6691..61998f848 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 b87f5acdc..07c6a59da 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 ea08445ec..956059161 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 eb9503bdd..1a364e384 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 97f9bbb1e..00966f850 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 b34940c80..129ec9a80 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 cc7174aa5..edd3ea223 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 128d585e3..fc8ceaab4 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 245e05ad9..794124b37 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 c5c0376c3..dcb8f369f 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 9bbe42579..7140ff5fc 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 1ac971cfa..363857e6d 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 504338ea5..966e12b8d 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 15328d0dc..2859a5f47 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 b6a6ea584..33bd0e1c2 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 7dff54530..42ac35353 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 326405096..88e7951ed 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 a1621fc2d..e1cd06024 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 93bd35532..1f61872e1 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 d419be5f8..c83412787 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 dbdf32b90..bb87b1c9f 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 4ca832c90..22de5240b 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 1fd8bd034..1fcd85825 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 fcf63fc85..c942f1c48 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 392f30d2e..b3a81ffd2 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 92df698e8..e4b9b4a5c 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 577a4d87e..1591e8d58 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 c8911b1e6..7b86fe909 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 c9fdaae5a..1df0b5904 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 341a1e096..cf5f95ecd 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 37d93a2b2..f629d67ef 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 86fa7a689..27e20786a 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 c072389a7..6462a2d3d 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 09003ceb2..e2f3d9477 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 fd2b92c03..cac029866 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 567c4b51c..2cbead33a 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 b8021be3a..f22b5b3e3 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 f55f7db39..f3ef56791 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 babc5d245..13f4b80af 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 1804457ea..30285ccaf 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 e61f4ce37..3df9c1c65 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 a80e99be3..0820a7bcd 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 2dbb713d5..a2e9cbb97 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 dfb60abc4..f44cc4a6c 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 f5158bb63..260d4318f 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 bd1e574f4..4fb2de3dc 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 4f37f1672..c1a733e17 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 b9d7ab833..6257b6a4c 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 6a30db0bf..0990fcb90 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 7603c8b05..cedf4300c 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 29440c579..9f6ce4322 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 c7eb4c616..ebc575e04 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 40ce34379..605ae7706 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 d22d9bafc..561c9adc9 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 afb106693..b07cb4f35 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 4d5ce7899..308ae9ce0 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 4c3e1f249..f80825633 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 cce61b2c0..e012275b4 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 c29fe4486..503093e42 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 2d464baa6..b8923b0fc 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 69aa9d8a2..c782f4621 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 e049d94b2..c9bf5b2dd 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 861a9c051..c6205cb86 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 effe3d98a..4c0fefc76 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 eb4e04455..a001e70ef 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 b38a78db6..4a8963482 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 e82276772..0492a7a16 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 17fe4ac2e..5b9356f9c 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 166/239] 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 8fb74a418..7fcc2492b 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 167/239] 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 168/239] 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 61c8f667d..50eeae308 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 fc96a8bdc..881da7fcd 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 5bc41a0f5..871991629 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 811bfdf0b..95b1419f6 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 c860b85cf..f8bd4dbc7 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 dc0822640..2e2e3a48f 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 10dd034e2..99e2be0b8 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 e144bc9f7..b03f78c0c 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 0dc06aede..637d350b3 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 75f1b9d71..d48b5454e 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 6b9f17839..5727164e4 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 c4e208507..efd62b07f 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 cc9fdcd5d..89f0076ac 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 13edda772..2f4d7ae3b 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 4e7818e53..ed4532059 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 24041d99f..5de53d102 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 827c06359..1b2ea8066 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 e22f76b66..35bdabefa 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 ed5cfab41..26c57cccc 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 4abab6851..7b236f7e0 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 906a8ca46..0969bcf65 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 7e39e6751..38bec8043 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 d9303e1b2..d9b02afaa 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 0e89668cb..d84db27e8 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 03d5428b4..848dfb975 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 38fa20584..fbf844e3d 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 f77092280..e3266be56 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 31061de85..c3de7ecf8 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 66b8d5f73..ce63233de 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 1c750cb16..2e7a0a474 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 5225a5a07..4162e67bc 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 fb10ba396..1ef2136f3 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 b37a81568..5ed6e5a92 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 1d735a840..3b20cf12c 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 f925d65a7..d3f7bc51f 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 3d02c0be8..7cd68f0e2 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 788d2a07d..42816e552 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 83a0edc18..9913c8b1d 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 618f12fb2..11543f09a 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 867e0f58b..46fd39c5f 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 300e52694..e5526366c 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 f4cc7024d..64e421d32 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 b98fed085..5185b5ac8 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 60aff6b5b..d35f0ae51 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 eaf635c76..70362d3e9 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 bdc9ef167..ca3701a08 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 047f4ac1c..59109da0d 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 2599c197e..8cd01390b 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 a0a001701..b19ada16c 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 894d04f0b..a616c4d40 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 7210bd983..ef8b540dd 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 7fe51d9e1..826f71b12 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 82878a9ac..05e89ec66 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 7cd71460a..aa4ae9a90 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 6b22ebdc5..fd304166d 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 3f7e1eb03..d62ca0697 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 3fa119523..541aa3d50 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 53a819375..a413b38c2 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 640613753..96c10dc5b 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 74a24773c..75d1b8b28 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 767e3dfc7..2c6b8addf 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 cfc4a851f..12fd53898 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 eae399d32..7efbff07f 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 878083f82..d16ebed90 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 46c541048..26b42c049 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 27ea5d9dd..9f5869e46 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 b2afc835d..391e91031 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 60a1a8430..2a2065728 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 8809fafba..2faaa1e33 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 e8a1b97c9..32ca46905 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 f44313f54..bacc2fc03 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 84324dbfd..018758f0b 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 63a5f0aa3..9b0d20ad2 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 3256b3630..7589d9ebe 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 c95635360..0523d2140 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 6fbbbea8f..b21e43851 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 a25558cc8..caff2c192 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 9b290e968..1cc948f68 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 b5146902d..b08d3e6f7 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 e33d0b2d9..0013f8cb3 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 409507310..3387ab07d 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 da6822111..36ccd06bc 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 f6d0a91e0..e3762aaa5 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 56f65c30a..2435c8531 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 b65d4b307..6098280d4 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 3c9d1fc46..0db2598fd 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 e680e12de..f49d1a08c 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 f5487665c..a291b264b 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 76a9533a6..c9660c1f7 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 6b547c269..8896c2c3d 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 d2a361d1b..640167ccc 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 cef51a279..7372cc6b5 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 3a5660fe1..04535e4b2 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 625ad72c4..81379a855 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 97df25fb6..3c8dd3c97 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 7270f07e4..2d9176cc8 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 19b1180fa..eeb954466 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 a1723efc3..aa0b66073 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 cd256397a..8080a43a0 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 a0ec20d0b..740a8f5bb 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 cf714ecc2..9a5fb58e1 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 b97cbcba2..db1466850 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 53a751eb3..1e322141b 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 ecccdf91b..c5c4fb9cc 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 1dfb6ff97..05fcd42c7 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 6c219f837..a076ed110 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 ea13570e3..61f8bac07 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 fc2209b8f..213b6cf01 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 2f38ea036..90efefc20 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 364fda9d0..7cab033c0 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 028d0d612..2eda76434 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 ff737ce67..447afe2df 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 b57e8ba57..62f144a4f 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 0cd09d5d1..dbf207de9 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 98cfb14c7..9696f44bf 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 aeead0861..a00157a1d 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 d8296e485..22755e529 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 c47c6b821..34ebcd796 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 98c4c2233..8c2abac2e 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 4c74f09aa..483cf595b 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 8b810fed1..6a28d857a 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 bcefb5778..770d1e166 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 9d4c47625..566bca328 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 4266f0b6e..28393e8ed 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 91588fd9f..fb9f85bea 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 2854a15da..2e0c6f35c 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 02194f108..1e727cc95 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 9fccaf5cf..ed44241bb 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 cc57b2b12..b76769f5c 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 169/239] 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 64422c1df..0d50d44ac 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 38b7475cc..1f890bcfc 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 ea1dc377b..d8a816f1e 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 d8e982894..e8e371d7d 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 faff51a04..cd8096f90 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 50eeae308..58b71d6d5 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 be8d5206c..eda3bf635 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 b77a30cf9..07577929a 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 b52becda5..73cda9b04 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 41d4179df..36a93643c 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 59bbb8fe3..92bddd502 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 2cd55d9ea..239780664 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 8621ce71e..723d10ecf 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 881da7fcd..841209cae 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 871991629..1acad056f 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 da6ecbe37..eb426af42 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 eb930b9b1..1635b30a6 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 25cd67f08..e6f4e8459 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 613856bac..a2c705eb5 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 95b1419f6..0d1a6c81a 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 ac29d1436..2a828b6b4 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 d55f29a38..9dd20afa7 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 aa358ae20..77f2227b9 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 023695139..958a53740 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 f8b511f51..f36c2f0f5 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 186c750f9..7f983dcb2 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 a6710ac7e..e443535b6 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 bb2a7ba89..5e6744fd7 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 350993cea..daf17fb24 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 0951cae8a..c4fff1d47 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 42a917071..d1a7fff50 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 f8bd4dbc7..fe60eb5f2 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 2e2e3a48f..0c11ee594 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 c9a4ff7ab..0f8e4e435 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 7ee320e42..d5d352994 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 821184c8a..2fec5ba47 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 9a5fc8475..5f7304373 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 2c70a8cfb..0459dae65 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 e92fba0dd..8718db944 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 059c1b94b..66cfc8cdc 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 d099b6b6e..63db7fc80 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 25d4139db..4005e55a3 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 54845341f..b2ab76aef 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 99e2be0b8..51bb82389 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 fa346c4a5..5de70c7ad 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 6050e6025..398312528 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 2be98dbc5..0a94ae067 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 c21b57490..70cc6b5b2 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 07baf334c..cea6e11de 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 b03f78c0c..c29ee56cb 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 637d350b3..4347c4810 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 d20a78eff..bddc3a40c 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 c6e938910..8b235337d 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 e3e6d417e..4612af0cf 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 8c5c341ba..1e107d68f 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 d48b5454e..c3535c180 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 ed9ff1ac0..019e8e7aa 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 0fc294c65..0ece197db 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 490f9d5f3..76ff71b4a 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 81c56330b..8394298b9 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 5727164e4..d734328b0 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 75b625647..68d894d0c 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 43b0bf71b..2e25d6752 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 efd62b07f..25b645059 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 89f0076ac..a15785651 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 283ae10a2..de91745b8 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 5e808874b..99dc5abae 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 d1c4462aa..a40dc1651 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 f1ba18226..15af4e66b 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 2f4d7ae3b..52b7a21b7 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 774704413..84df752bc 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 812253dae..063f1c276 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 7b48b4255..747813ade 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 e9571edab..dc4b97c55 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 ed4532059..35ca4e4df 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 19b0355d1..32da80842 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 ca3286583..039058486 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 12f41490f..a1408ae25 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 ebe8e86d1..e898f5081 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 ca9daaf24..2bc293724 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 c1b5dea85..dd0de81a6 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 5de53d102..6f2b340da 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 f9d47850d..c62a5e854 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 9778f1c4a..86f39e16c 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 ba01d5d3c..cd65fd436 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 81afdca59..1848a963c 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 d88881b65..637a1c649 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 5268a1e06..b59e10735 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 1b2ea8066..606de58a1 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 35bdabefa..145aaed70 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 9da8ce089..504dddd94 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 5e18476bd..5531c756f 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 f8d1cf5d2..adc023a34 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 7279318a8..2c322b4ac 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 131e57a39..775f82eef 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 dde5f064b..244701a5e 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 8989a08d2..94c297134 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 26c57cccc..270593886 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 97e994ab7..8a17391cd 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 8f349a2d2..2e3049e5e 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 0048724c0..69a8ee0f0 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 1eb1ba7b0..ac325d717 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 f31066b6f..27ae7540f 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 895c1e7f8..7714ebbb7 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 7b236f7e0..5f75a4551 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 0969bcf65..9ffda6182 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 55dc1f487..8315050f0 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 48137819a..74d8bf51c 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 29cda7a90..6b0fda895 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 07fc07fc6..7d66f1da4 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 38bec8043..485da788a 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 852a2c683..192427874 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 6898941ac..1b55130c6 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 fe99ca991..5fa912233 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 8714e153e..c769436ee 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 d9b02afaa..d8608aa51 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 47776bfa2..beec546f7 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 14d548169..1d77b9e0f 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 7c1b8fb29..d3c92e274 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 b586b678d..ad6021d37 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 78ef21008..b0cc3a4ee 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 4a12e51c0..0046c264b 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 d84db27e8..126ab2d8b 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 848dfb975..3d2b5d191 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 c33e68b5e..aa45db686 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 c586da775..a899243a5 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 aee27803d..318e5f464 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 b6165fbd9..bebf80c89 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 63835904c..a647cd7d2 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 03c291491..81d4ba1df 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 0eac22692..51ec66501 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 fbf844e3d..8150635ee 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 561ac60d3..0ca2f84ea 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 abc2e05aa..fcb231c3b 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 e3266be56..40f3db8c5 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 2339a8fef..025004ba5 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 81c8d1b30..51f96d235 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 15ef216d1..b6e071e84 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 34213bca3..46bd2bac2 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 19045706d..645f09857 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 11a8eff26..a9c45b31a 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 3b1a0329b..4280086f5 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 c3de7ecf8..e26b530c1 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 e6fdabd7c..05750cc21 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 c020eccd3..844c6dc86 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 c36bc3f22..e34ababc5 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 d4d551df8..f1a2c3f4e 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 139f0fb5c..b8b735747 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 e768076aa..c7020f77b 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 312ad3ddd..2f99f7d0b 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 094ead6c1..89e6b5c68 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 c65ad446f..86ae3348b 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 f301e4d2b..bf68a1c34 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 e8474b189..59732548b 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 a9482565e..2391fa5c2 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 70ba43bed..9ffd0c180 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 0a7a5c259..28a35a2ae 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 865fcc33e..4614282ce 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 25a065fef..ffc9042b9 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 fb5625afa..0fdbfcb55 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 2594e8e07..f41c5af10 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 ae897237c..4cd56eea3 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 fe3d15e86..f03261612 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 c118e6ca1..8dce4529d 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 ab771214e..4034d7e55 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 ce63233de..93e37eaff 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 de3e6ea5c..8bb82298d 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 761d94a85..6f111ceaf 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 95ec5be43..391b57725 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 70beec84e..961e2c5b4 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 b03ea2f9e..587b5a1f8 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 07d467972..a9e2eead4 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 b5e0d3e3d..4d3be8df6 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 a4122b898..cfcd752e2 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 d6172011b..f7a7777fd 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 804f3f492..ad97d83c3 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 5fdc29c13..78fbeaad0 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 aa334744e..1050165ea 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 bf0822a06..708f68bc6 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 2903629bc..c281084b1 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 80053a6b3..d34ca1149 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 71ac35adb..be29e607f 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 2e7a0a474..ce666f0f3 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 ec41bfade..e9b1a9fb9 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 0f0cae75d..a73e7ebaa 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 c60adee58..9629e4bd5 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 881a874e5..1eee64505 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 2a535891a..b799f99e0 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 57c917b89..f7e8d9ae3 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 70cbd4e81..e8b2abb0e 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 1e7ee1419..3ec710861 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 353ec6d94..40d32795b 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 fbf006a5a..aeec3102e 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 5796a0b4c..cc409fc28 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 eed31dab6..17b492fa0 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 175e2120d..e87417f2e 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 036588095..6ecbb1807 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 e6f98be8c..cd1029726 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 cc8118d5e..c482d75f4 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 0ab56be0f..eb13e90b7 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 4162e67bc..8b26816e5 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 22a34dcb6..62f9b5298 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 b7cc2bdfb..095dfe017 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 1ef2136f3..1333e9184 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 388ca7a1c..4f15bc604 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 bbcff71c8..2104fe113 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 e8e472f8f..071a0153f 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 5ed6e5a92..901c4228e 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 6da98386c..05a68b3c9 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 65f625181..cd32296ca 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 da1556ff8..07af4fb0e 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 d43524353..b004921d3 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 327aa1f5a..a3f4f39e2 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 4c862e682..2b5e3d91f 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 1409303ff..ff6b57b86 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 3b20cf12c..765ed5e65 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 68c0777de..21043690d 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 8dca14f66..335f9e0dc 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 d3f7bc51f..5fd2485c6 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 7cd68f0e2..e30bb6242 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 13d69cfce..7a4bfce01 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 81ca214a9..9c4a85693 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 59d593033..897f6d1e9 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 42816e552..9cd10bc56 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 d1aea1d6d..7bb36f708 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 9913c8b1d..d6e08824a 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 2c32a3272..6e3692d1c 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 9554b1f40..9284eca3a 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 9d8c5d458..f82e8aed3 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 11543f09a..ffd84583f 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 a5f6a6ebb..3eea890b2 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 46fd39c5f..9aa0703e8 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 865eb7645..9a0a9ab2f 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 df6d1c64e..45484f140 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 7f3c22afa..1d698fd61 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 970bf24c4..e4c2fff3f 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 6ff335e9d..d08786965 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 b2774735a..40ad5ac78 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 f17393833..70a6b17be 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 a7f7f33d8..ff0c86791 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 c3d176c4d..1c463aef5 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 a41936fe3..f3ee2d03e 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 0ea070ba5..77d53d6eb 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 7754cf92f..b26573488 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 51271e279..131cbf219 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 2153570fc..fcd4e664e 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 a666e8faa..02c4e55e1 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 5aa686782..bcfbac63e 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 1ef65f5a0..0044c7c0b 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 e5526366c..195bde721 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 64e421d32..576b7a3d6 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 8802fff48..b1fccd700 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 2a8c800af..26c2a75b5 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 da9655a54..135bb7d42 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 7297d3a43..308b28f57 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 deaebde31..8e0e8dc0f 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 32d715606..eed5f7d02 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 d5c874a7c..bc9428fd1 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 a23ad9268..7acc0638f 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 bbbcbc9f1..ea60e3d98 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 6cbfc7fd9..b958e0177 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 6c1d7311e..6eec9f7f2 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 0383c9dd9..b067aa211 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 e51b778c0..7756c7da0 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 5918f3603..bdf696aaa 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 e538a46d6..34ec8e414 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 2fc681604..a614d1080 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 c2a32df8d..b58d9bbb4 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 13a2e948f..5be27ec0c 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 f88a87c0b..ed6b8b1bb 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 b25ff25fa..ec9d013dd 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 6913bb521..eef9d7ef8 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 021280daf..a619fdb07 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 52a54b600..536e697a9 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 cc00d0e49..d0d96230c 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 5185b5ac8..98dc69aaa 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 cd0657a80..33cd8496a 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 9e46d25de..7aa181cf1 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 a83528a28..5894166ca 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 70c695bd5..a3a55ea7a 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 5fa79a246..a15ac6ec3 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 8cded29a9..d5d13d27a 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 31859404c..d2c8c6722 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 d35f0ae51..65d6577ab 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 e66fb4127..18069c0d1 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 2eb4aa8e4..97edb0493 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 1df52144d..b7208a91c 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 43069de9a..000ff2cc6 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 47e7c746e..355c2c82d 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 7c09516a9..08ae9e1be 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 74896d55a..e4ecbba0e 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 0869d3eaa..56c4d03fa 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 825e02e4e..4ed92317c 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 21a3925e5..c9a23ca5d 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 7ce6f0b39..8c27f8c70 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 f94e55937..0f3a88671 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 861508ef5..ec9ea1741 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 c2a42cf74..439b5ce2d 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 8b15689ee..10dfedfde 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 e4ecdd430..5ecbc27fe 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 d55f36bfd..252637166 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 c7b248181..42f420c56 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 c95941a9c..61055434b 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 d58676d34..c961b0795 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 db9abf8af..e37a30f59 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 e4ae9c49f..b7c706d58 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 70362d3e9..7770200a0 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 084650fda..61d8344e8 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 5eee5c498..8d69c1c0c 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 fdafd78e1..fbab4815a 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 a48dac681..1a7d99815 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 2fcc0cad1..bb3d616c1 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 7662e32b3..c55d6803d 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 5d289bd12..db711d993 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 4ff1d040c..704c32165 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 ca3701a08..0b77af183 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 8651978b0..9784c3e6f 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 9bc02d1fa..6d7b7f1f9 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 d950fd316..314908109 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 cb300ee81..ed49a87a9 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 59109da0d..ef1339259 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 a1d4fbe04..a9cb036c5 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 e28ced6e4..5d11d746d 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 eb81ca543..a1b8ed0f3 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 60567aa43..00a671fc0 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 71447fe9c..d5ccc45c6 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 4cabc7f52..11228b369 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 9ada0a18e..c7c664974 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 a3e3a52e8..d6273ceb1 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 5489097f5..6eab10979 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 a6e43e607..7c383e06c 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 13b3ddbc1..9d0d780f3 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 63b61078d..8ac349712 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 a4a30a268..43dea7e57 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 2634ea984..11ac50713 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 0c2402b3c..c129c998b 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 667fa84a8..4cd3f226e 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 8cd01390b..020f87411 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 b19ada16c..81cf79144 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 65449e92e..80038c067 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 4db12fadb..5ce671cd9 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 1f6d5ae32..3eebf95ad 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 a616c4d40..ed4970291 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 a498fa6a5..ccccdfb49 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 0576e7dd3..aba012462 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 8a30dab64..074fa55d1 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 a473c0e92..95ba90f48 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 43587d676..d8dc103e2 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 ef8b540dd..507d57d6f 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 7049c6212..23fed9546 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 ac1eab3d8..3afce026d 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 42681c54c..ae9848963 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 610209f3c..98968d26d 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 0fe6a0834..2e0ce9a91 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 327bf803b..458b333bf 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 3c6e6b87a..73f089856 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 a5315d636..7f156f817 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 9d3ad458a..09746df1b 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 69b250d47..8206210f7 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 ae79ca01b..f60ad4b05 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 f7649c2e9..3d9109277 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 344c40fb8..55085e630 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 a9acd36fc..8134e044f 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 1a58ab6be..0b68996cd 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 826f71b12..b4c8a658a 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 05e89ec66..6146c01c7 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 8c70c8f6c..5e738cabd 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 19cbb82ed..29715e021 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 a373e4afe..b88a3646f 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 10730557a..3be1c9650 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 54f3344ac..1f88745ea 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 0a9d1d88e..c922ec8cc 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 646052ea4..9a042a0a1 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 ffcb836eb..64f25724a 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 8e7c81732..8dae198c0 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 aa4ae9a90..b28f422dc 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 c3d56cc69..0d74c1db9 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 dd4e081d9..07bac9f4c 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 1b994cfb8..c8046aa5a 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 064dd4e2e..a9d79ae34 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 2741227dd..1b4918a63 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 fd304166d..2b78ba703 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 feb454bc4..0012ace25 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 4dced90f7..364b96eec 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 9482b8d71..51197862c 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 fffb5b186..b07f46de9 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 b54e1161e..740c05ebb 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 c901a2ae6..c6ec87827 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 3251e9dc1..a9fb9a1b1 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 9818a00e7..eb3077a05 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 d62ca0697..1d850b00b 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 7b22a8d0b..ba99b7f5f 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 b8464a348..2d490b810 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 e8edc6127..65ce3c66d 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 95579d003..f5e0de23a 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 bcb441e9f..9f765d354 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 4146b765d..99faab72d 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 2938faa18..bad01300f 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 541aa3d50..2dac0589d 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 a413b38c2..26d33deb9 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 a52fad7d8..fab81bf8a 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 8bc63bd95..e889f2134 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 5cfbcb700..41367dce4 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 2347cec67..11c3f8a80 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 7016f836a..13b045fff 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 8b3284536..b4115609b 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 00ed39ccb..7381a498e 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 7f3b810cf..81d9373c1 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 deab9e0b3..7719eb7d6 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 4672b8742..a34fb0552 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 bd038fc3a..cba1a7d08 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 1a92a8c66..1bcc85b65 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 9581490de..674ddec93 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 a025b8a2a..7812ae520 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 fbfa8fa88..b21d23351 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 cdc2eb7d3..1e63b7988 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 d9a01c9c3..f07de8902 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 db0686bce..25de1fac9 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 ea18ca8d9..0bc52aad2 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 358658350..49f22cc4e 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 c3d187fdf..a0a9b5401 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 32bfd8292..9198c25dc 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 a2ef0a994..c14e9fe69 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 89ad1da8b..ae849f774 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 4a8d316dd..59fc805ae 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 ff3e3e27d..ea8fd8d62 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 eb99d06ff..c49ef93eb 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 20692e014..bb37a500b 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 d8c2359a3..df45a6fb8 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 68c25dd57..20f0b9712 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 6eb9f21a5..d2d0f6776 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 c71295600..12908deb6 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 96c10dc5b..97002d2bb 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 192a5ad2e..505d11ae2 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 724c2d007..5d87dae72 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 bc0438f90..13f5fa557 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 41d80206b..99f69027a 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 9a3a31b96..07cfc684b 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 75d1b8b28..888319bc0 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 4d1455ed3..4af09cc49 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 2c6b8addf..a6e98d1c8 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 e66fb4127..18069c0d1 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 12fd53898..890d95748 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 640a26517..75d936e8b 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 7efbff07f..ff778529c 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 bbf718f0f..9b8057e69 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 b5d7a0c16..d62896918 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 be6b3b285..373f9ef97 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 2c827e62d..e597b15a6 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 d16ebed90..6badc64d8 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 d8a214b7f..79e109a77 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 5e18476bd..5531c756f 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 f8d1cf5d2..adc023a34 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 7c17b4072..2d88406eb 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 361605d8c..3826e0ddd 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 3137bc5eb..124545223 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 26b42c049..6738bf07b 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 f19c2f2ee..9d386f160 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 20bf63780..12dbc3596 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 e16dd2363..e896ab341 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 083653797..4ee3f0161 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 015541eeb..dc0f93aaa 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 2d03c7b13..4a6412475 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 1ab4d8bb7..58fbde8b3 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 faa7e2446..3aed61688 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 8ca93a0bc..63648cd46 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 a90d3b220..4a671130b 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 9f5869e46..fb1f95a6d 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 6335ec375..ca3e174f9 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 2ecc4c8c6..160713720 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 c69b28122..8a0fa5741 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 0140d771b..6bc1c1977 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 179e4bd02..4454329c5 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 391e91031..24c6b6ad1 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 b71736517..21a25ae81 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 5d0c57014..27653dd1a 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 45dc4bf31..9a5b468a3 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 131e57a39..775f82eef 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 3aa5e2f89..4352f7fac 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 dde5f064b..244701a5e 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 2a2065728..101aa055b 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 cd21214f5..4e5805f39 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 d9c8a79cc..0f3b61af9 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 2faaa1e33..9e3978af5 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 808ab09a5..5f26a66d2 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 2785f5baf..4efd5d287 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 7c61360a5..6f951967e 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 92a03d862..0be9eddfd 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 c19f09703..8e2764298 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 03ff6d910..454ed8beb 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 d9f8c2ecc..29c26b340 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 b193efa8b..088afdc58 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 32ca46905..bcce2679c 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 6ce588c8d..42ccbfbf9 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 0638aee8b..f445713f0 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 5d8874959..2262dedca 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 322871edc..ff650bc3d 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 69fd2c23c..7488f9bbe 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 0991ce944..7428582a8 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 55787ca76..58ad10764 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 f02b03bdc..1ec77ae89 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 2d17c111c..fd90067d4 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 071048090..45ccc5cb7 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 6dc1bb4d6..29a8999b8 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 bacc2fc03..09bd25890 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 b62e9a22f..d1c3dbec6 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 8d72c2d0d..1d6e8fc58 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 6bc6d0543..5ad8a432b 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 95b416e42..cc274fe2f 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 6f57169e1..0fe5feca1 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 86e1bef6b..66f327601 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 594ebc991..3c571ccb0 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 ea5b266b4..32a082dc7 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 018758f0b..c4243f874 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 59bc61051..1ad4a554b 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 c44bcc08b..b5e773e82 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 19146d9f6..b013845f4 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 3c27e6aa6..875b01efe 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 5e6e6e7b0..85a8b8863 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 2e12ee1cc..5c67dad75 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 f5a146a9b..439e5ff75 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 af571029f..b5c231f6d 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 35bf27a59..bc2deae4c 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 d6bc330fe..0c02d9b38 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 924f966d4..e3c4b97a7 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 9b0d20ad2..ffc3af950 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 04dfcbf11..44571d263 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 a5477e276..6eab63bfa 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 67c5be2cb..70ac997e4 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 b670f2cfd..25207d7c1 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 563b185c7..298dd4637 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 a9b7661fb..38a513d30 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 cb8ba0afd..5032ee489 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 179c3979d..2bb8c8718 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 7589d9ebe..7d52ca2c2 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 f742adeff..ddb17e984 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 581b451ff..bbf718b60 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 994a8a16a..c083ad0ba 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 b55e32be0..7a1f8790b 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 06246fb27..19c34c5f8 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 b67ea1c7f..070d2ed46 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 b6cfdcad3..c0d44721c 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 7030785b8..2cfaab43d 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 8c77b3e8a..c249f042d 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 b03c11d0d..b9bf6993a 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 cd4572593..49d84bd86 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 0523d2140..1f69c43b2 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 0ef3a2c92..41d623aeb 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 e077ed3fd..7141f6a6a 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 18db1c932..294ddc909 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 b919b711b..6576e716e 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 269a48721..bd98dd683 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 b7a64ebfe..8deaabdeb 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 ecb47f52c..2dd0d2b06 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 e30aace19..cc64dc585 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 b21e43851..e7d1a3a5f 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 6e36b6a07..8e9687bb9 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 cb827b1e6..566aaa916 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 5b0680d91..9fa1112ce 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 0ee9e306e..be2436457 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 fc86c4443..f9a3c6d1a 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 72623ffe4..e38f711db 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 e2d6b1b21..a5ed40c2a 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 f13b8f3ec..c412b2a7a 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 3db3abbc1..7b3ec2ba8 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 caff2c192..91944002d 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 a5bfaff93..adfdb3258 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 8a2bf4202..7efc36a32 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 58d400f3a..e26a427e6 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 c84102cdd..466aaebb6 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 7a1d23114..313bb9784 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 6d24bc363..1f33c94e0 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 ff70f365e..bd9db9659 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 f4d7e2681..6913df822 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 1cc948f68..a9419975e 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 b3117d6a4..277615232 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 f627733f1..8f8b6c6b3 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 877b0890e..979044384 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 07b6a67f6..e39670f29 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 fef529d69..ad9a7a677 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 b08d3e6f7..607c26e94 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 575713599..b014b7bee 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 0013f8cb3..14acc7dbd 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 a020d3a8d..0dba1ebc5 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 ec0423e70..23e848434 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 444275a12..d0feb44da 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 8e01a301a..08c841f06 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 82b5babd9..b6411199f 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 8153e88fe..a8c83f8e9 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 d0e094387..1e13e378b 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 399739631..07876afd1 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 635514ecf..0572153aa 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 7131bf8d0..bd1327c93 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 4d8d369f7..44092503f 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 1efd6edfd..f3447a8f1 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 3387ab07d..3f8c8a535 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 e5751c441..46e2706ec 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 630fe1fab..6e9875978 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 909b651c0..046de3e23 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 73dbed1d8..581ef1c34 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 882d8233a..da5ed5d35 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 ec278960c..517f97483 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 36ccd06bc..999c23fa1 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 064963d69..bf025a8c1 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 ce1049709..d5a52d503 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 e3762aaa5..984e049f2 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 302d69194..7875ff403 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 5afc549a6..34715e3a4 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 b12907e81..61b458f7e 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 3137bc5eb..124545223 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 2435c8531..0df53ea65 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 f19c2f2ee..9d386f160 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 6098280d4..b0e877b57 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 e6ca805e4..2a307a676 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 51040462c..eefbf62b8 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 20bf63780..12dbc3596 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 e16dd2363..e896ab341 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 083653797..4ee3f0161 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 015541eeb..dc0f93aaa 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 2d03c7b13..4a6412475 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 1ab4d8bb7..58fbde8b3 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 faa7e2446..3aed61688 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 8ca93a0bc..63648cd46 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 9eec00267..6694538fc 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 0db2598fd..6ce01a319 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 e01db85d7..2d084e0f5 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 1ddaa64ac..84770a092 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 f49d1a08c..9f139ee1b 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 86e8585ad..1aa43eb13 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 d4117d6bc..6ce49ad86 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 e8c489550..cf767e702 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 a291b264b..fa6c9f45b 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 10831d0ff..23d0b9752 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 c9660c1f7..3a051619f 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 8896c2c3d..a765a7b62 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 67d9ba6bb..291714545 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 2dd427b9e..d0f9baf41 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 640167ccc..d4121af20 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 7372cc6b5..813b57bae 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 0ba3ea1c2..405f1148b 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 d0813590e..e66a7fb38 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 fda9205c2..5ae4dc37f 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 04535e4b2..c5b0075ec 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 81379a855..91a9d5df3 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 65ee1d4fe..a2e66d109 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 3c8dd3c97..b51f90426 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 2d9176cc8..e59c8e6d3 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 ef03a4882..646a3bb19 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 ebc87fdc4..e1d9c5cfb 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 63cdc3fcc..ff4aeb59e 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 eeb954466..dc0e34e53 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 aa0b66073..d3c12ec50 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 12143af13..89d7a2914 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 8080a43a0..db0a4f716 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 740a8f5bb..8efcddd69 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 40dbc3307..4b2553117 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 46640dbbe..665b42af5 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 d52ac3db9..e9bb68dcb 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 9a5fb58e1..5e9c23854 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 db1466850..2f088b93e 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 c63dc68c6..dc630df20 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 1e322141b..4b1b6112b 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 c5c4fb9cc..246928553 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 e6a02dc60..19d0420a8 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 b616da8b1..f7c1a21a9 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 bc6078aa9..7eef38459 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 0c8be0e6a..3250fd5d1 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 a1f082fad..f44db7921 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 805291578..79cc04c24 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 311edbac8..7baf9558d 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 d9545d054..38df3195b 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 e0b19650a..d9ef2682e 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 e483d8622..439eb0663 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 4f01372e4..4ec6fd7ab 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 ea00bffe5..f3d74e7b9 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 5adfd84ee..b0722df48 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 f01ff8699..0ef056555 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 1e9387354..27295b896 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 05fcd42c7..1eae9582d 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 c95d3295e..7cee78ec8 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 a8b10b9a0..4a8f00ffc 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 a076ed110..8ad61dfbd 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 41bb9e9a1..a383f461d 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 61f8bac07..b3a2be9c8 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 27820ede6..7900152ca 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 e74679aed..f9e07b746 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 0c73e64e9..2ecd95ec8 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 c6fa61090..635a4c4dc 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 213b6cf01..0ee0ae36e 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 90efefc20..334de324e 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 7cab033c0..cf559cfb2 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 2eda76434..e09b1ed4e 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 d67e4d397..052d7365e 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 15371b44a..1617275f0 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 4f8d138f7..648d319d4 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 b4f3da735..9a8410d9e 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 8ad7bdf23..b3c8540d4 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 0243d06f8..b93ed8540 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 35bd1d88f..b0e86483e 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 447afe2df..90cde67d7 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 e6efcbfef..10794f81f 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 f7a8ff9ec..851c7cdfb 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 62f144a4f..f2f135abc 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 dbf207de9..098517675 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 9696f44bf..075862fe3 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 a00157a1d..39d835702 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 a1ef00656..b2dcb0fee 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 22755e529..8a53e7984 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 6219ef115..8c69e435e 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 30d1d4546..21d3ba7cc 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 34ebcd796..0e293248d 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 8c2abac2e..26d70bc8b 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 6665a1ff2..77b96db2f 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 483cf595b..72c351208 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 2bf3f7720..477855398 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 a55f7c8ea..896539235 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 015b08e6e..14293376d 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 4bf829f8a..039e5f32b 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 3c5fd3dc2..735853c48 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 6a28d857a..aa949e28c 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 770d1e166..9648621ac 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 82872cc35..be7da5dd1 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 2710ff886..e97487a64 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 43803496e..a287fc6b2 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 566bca328..f95bc5547 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 cbff16fd0..ef8f6bbe6 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 28393e8ed..b9a807bd8 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 6097a615b..5f4e068f0 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 fb9f85bea..af0f41cf0 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 2c7de497b..65ad771bb 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 94ff1b461..c9cbea1d9 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 2e0c6f35c..19350e5a6 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 1e727cc95..fa504a44e 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 89c99d560..e0f2df28e 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 ed44241bb..b0711d731 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 9700b38ee..b08dd3148 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 1d5e304bb..3bdaeb45d 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 fa1855a24..f7046cdb3 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 3f255fce7..fec1c9ade 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 4b69b64c9..b42c9decc 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 c733ac5c0..c8f9f009a 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 d0f863446..dcdbc60c7 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 b76769f5c..7e6452a77 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 6c7c5b264..02ddb540f 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 b8d397548..fc957cb15 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 170/239] 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 000000000..b5be84318 --- /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 473789141..4e631b0a4 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 a3fdf57a9..424357232 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 be1116db1..4f720fb92 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 bdf7bfed8..df86253b0 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 8b6e0e932..a2d4d70d4 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 4937fd1a3..9a6f78138 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 562f8d5e4..4ddbaa31a 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 5c409ac99..bd75b8a38 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 853187feb..2c7e95b72 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 c003671f5..d7c28987c 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 171/239] 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 4a5030684..e863766c6 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 33260641a..1b20e6960 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 eac9f604e..44694b232 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 eb7df7efe..11b4ac059 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 7c2e9fd21..c2b7c825c 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 d4e4b8337..d8d0796ea 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 9ca778b6f..7a5bc8b9b 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 563e887b2..0023d8837 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 f7f06218f..8168d8cbc 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 d20801a1f..5abd96823 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 100f486a2..436593f7f 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 acf50b58c..252f47ba2 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 60741f088..28917a796 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 256dd69bb..871d51cfe 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 f8c6ca8ec..d6dec016b 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 ed667566b..b25ed0723 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 efa2e74db..185f7cc4e 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 c46987acc..06e4b7bf9 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 bdddacec4..1ff69eb99 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 62c539efc..6caee6a72 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 e4006bc51..766dc6d43 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 43e48cdb2..6592ee8cd 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 5d815771c..90380ca98 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 923a10cb3..f2d673abb 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 bfb9603d6..720dd9e7e 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 ca7cd47d2..52c55fab0 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 7f8b12a46..f034bcdbe 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 9d54826a3..d083ba8fa 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 5da122433..982534935 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 84b2efe16..3d058941a 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 2006196c1..9e874bee5 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 25d99f7b5..567b63ec4 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 8ac0566a2..52e8d74e5 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 78584ba94..302c094b3 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 0286c93fe..4b413dc4f 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 d772973ec..b64cec301 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 aebe8398c..3fca833a1 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 66a3d7924..4d29ac522 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 278614af8..dbce8d102 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 76c9ce3f5..6bc1b7776 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 3da8fa928..6f464661a 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 763176c4c..7907a5bf5 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 148b68aed..83dbe6fa4 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 e6ee1fc14..a6f7399d8 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 bcc6841a1..9fa3300e6 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 bfb1659b2..74fe9fa14 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 3abb541f5..de9915c5d 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 669f8548c..97834d6ac 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 4a990053b..62341e53b 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 de958c6e9..ab9458a5c 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 916786d53..72aa2361f 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 02a87b532..9b9fc5fc1 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 d045c99f3..5ff0f0690 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 e5f54e1f6..f8e4048f9 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 6d430cf99..75d20648f 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 a3ea2a8a9..df1a7817f 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 c25233054..8be40f866 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 a31824064..7721b0092 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 23f80160a..470b7de7b 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 47f358809..060a05909 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 d7c485137..9b275ed1b 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 3e28a0b05..4b2dcd3b5 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 61998f848..12a8d1178 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 07c6a59da..ec935a324 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 956059161..eb995d454 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 1a364e384..1f927055c 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 00966f850..298cfbc87 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 129ec9a80..d021a76c4 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 edd3ea223..77ca2e775 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 fc8ceaab4..f86194bf0 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 794124b37..021fbb3b3 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 dcb8f369f..4511c93fc 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 7140ff5fc..afa8203c3 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 363857e6d..8973948f3 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 966e12b8d..2606cee07 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 2859a5f47..64907af60 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 33bd0e1c2..3c6805b9b 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 42ac35353..049f4049d 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 88e7951ed..270615762 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 e1cd06024..00ead4c60 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 1f61872e1..35f600cdf 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 c83412787..93842e0cf 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 bb87b1c9f..afaff4912 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 22de5240b..3301e8799 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 1fcd85825..ba2ef32db 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 c942f1c48..33e90d18a 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 b3a81ffd2..b72fe5b69 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 e4b9b4a5c..90be275ad 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 1591e8d58..c55da4168 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 7b86fe909..6c8110640 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 1df0b5904..60aa4a213 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 cf5f95ecd..8e15d5288 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 cd1aac9c2..22173d36d 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 f629d67ef..6d011cbce 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 12e8e76ed..e003ece6b 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 27e20786a..411181237 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 6462a2d3d..19fff0ee4 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 e2f3d9477..77fb3785e 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 cac029866..b75b055f0 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 2cbead33a..fcbb1c0e2 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 f22b5b3e3..f91e2c50a 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 f3ef56791..3f04526f0 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 13f4b80af..4a1876a7d 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 30285ccaf..6473132f1 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 3df9c1c65..ed398333a 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 0820a7bcd..3010a99ae 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 a2e9cbb97..92e51da1b 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 f44cc4a6c..ad31bd051 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 260d4318f..0ffdc1501 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 4fb2de3dc..0f81e5008 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 c1a733e17..e3fb474cd 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 6257b6a4c..3b6451a9a 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 0990fcb90..c4600d347 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 cedf4300c..e7cdddce4 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 9f6ce4322..fafeab706 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 ebc575e04..a28ef2fd4 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 605ae7706..5c78f3de9 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 561c9adc9..9fef1d759 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 b07cb4f35..2e14db600 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 308ae9ce0..6d28d7ed1 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 f80825633..8a762b9ff 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 e012275b4..d7b6ff68a 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 503093e42..3a0404284 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 b8923b0fc..6819deff6 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 c782f4621..0982d5568 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 c9bf5b2dd..40cff7588 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 c6205cb86..2748919b4 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 4c0fefc76..fe6fe228e 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 a001e70ef..e9ffc1df9 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 4a8963482..fed699cc8 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 0492a7a16..01024ce48 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 5b9356f9c..5fc0fd519 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 172/239] 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 555727d29..4fc74f545 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 173/239] 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 4d3adf8bc..0b0433141 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 000000000..3047d79b9 --- /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 000000000..76b02137d --- /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 000000000..1863938f1 --- /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 000000000..4ef8e9eca --- /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 000000000..1f283532d --- /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 000000000..f2dd92404 --- /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 a0b2d9037..7672fb091 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 d85117587..db1eb4a83 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 2dcc3129a..974a8fd5b 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 000000000..2a2dfa290 --- /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 000000000..d5a9ce014 --- /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 000000000..d8352bb79 --- /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 b8792a306..bd72d5929 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 000000000..0eb5b2f2b --- /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 f74c7257a..ac1ffbb98 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 000000000..09e4139e7 --- /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 851634ed0..d35225abd 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 000000000..d3336f2ec --- /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 d8c99c186..320af736e 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 000000000..361406670 --- /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 000000000..2902fa7f1 --- /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 174/239] 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 fcd4e664e..000000000 --- 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 8206210f7..b0bd67fa1 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 917836861..4d3adf8bc 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 a43705fed..a0b2d9037 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 175/239] 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 1db4fc3f0..416bd7b09 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 f3e77eb93..62055557a 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 176/239] 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 416bd7b09..078d57f86 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 62055557a..743882563 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 177/239] 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 3efde3c58..78620d33c 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 178/239] 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 5f8f05cbb..95a051356 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 66ed1f591..1eea79815 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 179/239] 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 4b500dee0..f2235f31a 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 180/239] 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 f2235f31a..416567b64 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 181/239] 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 416567b64..b240df027 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 182/239] 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 b240df027..917836861 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 183/239] 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 078d57f86..4fc2b570f 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 743882563..d7604e605 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 184/239] 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 c8ae0aaf5..270cc4ddb 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 185/239] 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 f626c12bf..d288a3aa4 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 fb947f818..efa6777c4 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 186/239] 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 623c10376..a43705fed 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 a62b8f7c4..7808a94a2 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 560bc0bfd..54c1b265e 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 b2036825d..2d371e6fc 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 f7ef06681..d6c7bec89 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 b6cd66fc0..5b6719be0 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 afd5879d2..ff7fc4301 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 fd8a17b2f..ef4d843e0 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 ca6d25235..f7cc966fb 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 aa864b12f..767154932 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 024fdec05..e30891c77 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 9d6ff5153..207db3752 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 2c76bb9ac..f78a31ee0 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 bf66e0f3b..e9f0b78d4 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 1c1244329..c609ef534 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 c1b1d7948..bac3fc122 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 c903e3f7b..8d5a77ec4 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 5df759dac..d5bf2cda0 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 89848d56a..f970e1d0c 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 d42773736..7ea2b2e11 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 f45355a08..05c557ecb 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 ea6b517de..c38690554 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 5e8ca6df2..45b205070 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 b554c2249..61ceeb141 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 c2a10e8ef..d849856a4 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 5af517d44..1f957f084 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 a439fe9db..5a32eba21 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 158b7f805..7e7c3138a 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 656bd8f07..a22f33542 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 5252eedaa..680460f45 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 eedfebb6f..33e130e9c 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 cd1f1333a..b512f5c14 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 491116f6e..dd23481d3 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 e2f1377f3..d04b8502f 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 39edde853..71ed326f8 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 c22cb2613..358ba9aa7 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 95ccfe795..e2bf62773 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 1547c17d0..996e4d410 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 cfc11b542..6e4c75890 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 972d49e4d..aab6e08dc 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 fe661a332..23e2c391d 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 57ce30f17..2ca3d27c9 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 ad81314bf..7f99b5e8f 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 becd8eeb8..e037e8ac4 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 e14fbf68c..171bb8232 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 b13d5f736..23e66953c 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 a624e8daa..71cd4f165 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 a46be0352..f3fc99f83 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 39a1e0643..1c4e97bd4 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 7fdbdf878..ff5a9bd4c 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 1649eba8f..03f833f37 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 e15737b06..112784af9 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 2d8cd6c19..dbd305280 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 37ad42be6..ae760add7 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 aa221b2da..7e2e91cfa 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 9bb0f5fb2..a438ba473 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 03b1ca032..4cc36131a 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 7a28220d2..093990571 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 538f0ab0c..451f992da 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 2d5b0714c..16a1f2201 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 67295ce42..12617c243 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 839f985a7..d2b46e8e3 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 7f00b22f5..dc9affdd0 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 25d10d17b..6b3497f08 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 298b155f9..5e2e02afc 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 e5dbb6bf1..ec0fc65b5 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 064abc18f..2a3cf45fb 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 1ff5bbcba..f3ad8d40f 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 843e96606..6bbbde82e 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 48b2aa90a..65cf69b9d 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 4207d2d6b..1e79eb984 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 cba822297..b00f2126a 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 3bedb4264..f14943082 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 16be81f40..ea41524d4 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 69f3dc9ba..ae95682fc 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 8e36b1027..d829a0c63 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 b8031f709..caa7935e9 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 20e9dbdb8..bf2b63fb2 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 239a07136..053de56ed 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 9a94a0d34..8b4435a8a 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 edacdaf25..e139e4dce 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 956becdc7..41cad9b7a 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 40c763ff5..f9eac85d5 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 9f632abcf..70dca796a 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 91205e85a..45836a645 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 49cded65b..a9693338b 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 7d9cd478a..cdbd59445 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 9b3e7c19f..9098bf42e 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 cffe0d63d..6ce62b331 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 754985d16..27a78e1ba 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 b2adf27b6..59bf762a0 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 5a98f982b..3001de8e4 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 a512e9f09..0a5270628 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 808bd4d40..bcd261d00 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 a450fb86a..a3c8c018c 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 1916b7d28..de2bcc1b0 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 6015f367b..fbd9d01e0 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 ef6c57d76..6df91b1a8 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 5ffc0be3e..6f3251408 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 ef5e73670..ba9161940 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 e9624cd2e..6d7d7d193 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 f953a91c6..34c9a853e 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 7b0ee96c7..d42f76342 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 738180ce8..9b0ba7cac 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 3fb9549b8..f572945ac 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 da45ac6f0..b7996c106 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 fc7de1d68..8843757ac 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 6f7b59c2c..aa0fe28a1 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 7bbf5acef..26c3c8045 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 6fda8c53a..b20841552 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 30fb78ce8..f0d028ba2 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 0bd86e4f8..e141835ac 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 014356091..f3bca1991 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 6c4ea1045..660f7c7f1 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 e07d43fa8..b58eedeca 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 713f0ef57..7890e8af4 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 b96659226..92847184b 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 c76820cb1..055d458a3 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 0ca92e215..49d82a7ed 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 27a795913..1df7c034b 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 e8e48fce8..e2b8e8cc8 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 8dd75b759..a86014855 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 a44b58f42..8910be1db 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 d68b6782f..3d3d71ec5 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 0099fd771..0bcaccd20 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 19ded07b8..a07247f8f 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 c3fd1eeba..0d7fe9aa8 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 c1a73310d..2b230707f 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 c37d82fc7..c5c2b5825 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 77888e58a..59a9aaf9d 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 594c4fa00..954a34608 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 41da92c1a..247f7ca62 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 ede21403a..c3ff23591 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 187/239] 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 4fc2b570f..5f8f05cbb 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 d7604e605..66ed1f591 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 188/239] 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 5d49817e2..bbe242394 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 2d69e7b2f..1ba7d6de5 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 189/239] 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 efa6777c4..e2a5ea8f3 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 190/239] 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 bbe242394..a1cbcfcdf 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 1ba7d6de5..591023653 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 191/239] 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 881541c9e..61a1a3c0d 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 e5b5ea598..727d841d8 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 192/239] 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 61a1a3c0d..6a01f67c6 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 727d841d8..53c948498 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 193/239] 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 6a01f67c6..4ce1788e2 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 53c948498..2e429ae56 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 194/239] 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 4ce1788e2..e81c1a471 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 2e429ae56..72056745c 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 195/239] 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 90d2ec204..6c3eff5bf 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 2eb576cbe..457c0ccc9 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 196/239] 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 5e27358f4..669aba00b 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 f96185d0f..73d6608d6 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 197/239] 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 f27f2a433..e95eb13cb 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 dbd7b46cd..3c8f1a17c 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 1b4904a62..e9b14b3a4 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 e0a250166..a4bd8c9cd 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 198/239] 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 f8a78e1ef..e5d9e7f80 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 946b484fa..44c5d7441 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 199/239] 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 b10ef4449..ed72ce35c 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 fc714cbda..063ac556c 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 200/239] 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 24bd4447c..b10ef4449 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 ecc25d29e..fc714cbda 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 201/239] 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 e95c020b2..9e1e04d14 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 202/239] 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 2ef6fb150..32afd0174 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 7913a462e..c8c5fd709 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 203/239] 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 0b0433141..8c1bcf674 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 204/239] 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 2f16abb88..c812b0164 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 9ea8ef369..326da7cbd 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 205/239] 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 345699b43..96e52b2aa 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 7a2b80f70..934bbdc0e 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 206/239] 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 9c338c837..345699b43 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 0b4bec8ee..7a2b80f70 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 207/239] 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 d6273ceb1..a295b6096 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 8c1bcf674..04563c1bf 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 208/239] 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 28d250117..cae7feedc 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 89784f7f9..c6f1784cf 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 209/239] 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 000000000..678b0e36d --- /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 43dea7e57..8411c57ac 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 04563c1bf..ebaa3a15e 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 7672fb091..7633e84f0 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 210/239] 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 000000000..340f15040 --- /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 25de1fac9..9a48f8349 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 59fc805ae..aeead953c 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 ebaa3a15e..21adbdc48 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 7633e84f0..a086500ff 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 211/239] 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 dc0f93aaa..dc676f7b6 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 a8c83f8e9..4ef871f07 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 dc0f93aaa..dc676f7b6 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 212/239] 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 8d5a77ec4..8ed843288 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 d5bf2cda0..942a4e64a 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 f970e1d0c..ae4e811fb 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 5a32eba21..ac8945aa7 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 ea41524d4..b81d4a96c 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 caa7935e9..5d94ba73b 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 213/239] 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 cae7feedc..cc53de6a5 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 c6f1784cf..522657944 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 214/239] 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 21adbdc48..40dd7efa5 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 215/239] 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 1a6805f12..70583958e 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 52e1f7b16..0dcca2063 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 4a333b0b2..e1b69c004 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 216/239] 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 0dcca2063..b82c7bedf 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 e1b69c004..b70afcacb 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 217/239] 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 4b8ced4b9..5597df4a5 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 2c530fa4d..f6d4fed3a 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 218/239] 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 40dd7efa5..0a9b23bb2 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 7eef38459..cf3cde948 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 3250fd5d1..197f88288 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 f44db7921..787c02660 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 79cc04c24..f322e7930 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 7baf9558d..89509eecb 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 38df3195b..502859781 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 d9ef2682e..8b6d90d50 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 439eb0663..3a47beada 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 4ec6fd7ab..ff028814d 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 f3d74e7b9..fa336b4ae 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 b0722df48..da6ac3efc 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 0ef056555..3e467922a 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 27295b896..8f21f8190 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 1eae9582d..ee8e73ebe 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 7cee78ec8..fd25df7a5 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 4a8f00ffc..a06e370cc 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 8ad61dfbd..616159558 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 a383f461d..96196d7c9 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 b3a2be9c8..ef29f99bf 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 7900152ca..1d677011c 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 f9e07b746..caab89acd 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 2ecd95ec8..ea6503689 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 635a4c4dc..fa1545e52 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 0ee0ae36e..6f371d0c0 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 334de324e..5b03ab755 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 cf559cfb2..a42ea7422 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 e09b1ed4e..7413fbfe7 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 052d7365e..db469e5ee 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 1617275f0..4c5542692 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 648d319d4..0de3f12f6 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 9a8410d9e..6c8a697fa 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 b3c8540d4..2999d447d 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 b93ed8540..d0d047e75 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 b0e86483e..35d182531 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 90cde67d7..7486e75c8 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 10794f81f..0d58994c9 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 851c7cdfb..71f86a159 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 a086500ff..0bc1607a4 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 db1eb4a83..42c8f22aa 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 3fcce8ae9..170d29d80 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 aa4a5ae7d..36b9f1c78 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 b4aabb376..62fb3614f 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 3af936891..fa644579b 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 3064ac9f5..86df71624 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 13f4ad835..294755661 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 cb76d78fe..f63141a70 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 71fbefe16..cb2172f5c 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 da9d2a024..108083530 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 eaa206ff6..ce17f8ed8 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 7808a94a2..63f384b13 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 339983fe0..2cd83ecb5 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 8ebfb7cea..1b15a4f24 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 baaf2d985..fdb23fd37 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 b20841552..54898993e 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 6f69d0fa7..d01b28c66 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 f0d028ba2..db38b3d60 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 e141835ac..1f646101e 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 f3bca1991..28db7261f 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 660f7c7f1..7de190886 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 b58eedeca..c61412de5 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 7890e8af4..c355fc454 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 d11410bb9..2f5289dab 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 0ffdc1501..af5984321 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 8e258b3e1..4cc6238b1 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 0f81e5008..2ac65c005 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 e3fb474cd..8ae3476f6 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 3b6451a9a..87997bfee 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 c4600d347..0d88e96ed 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 e7cdddce4..42db8f705 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 fafeab706..081904140 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 68861832d..bc580e3d2 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 9aca7bfbf..ed9b04943 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 8d789314d..ac6a3e156 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 ad751a6ce..aa5636b33 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 7ad1c769f..6c15f82bb 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 ecbe18a76..0c911003b 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 f731bfe13..beb0645a9 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 c5937df82..ae87b8b66 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 219/239] 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 0a9b23bb2..56536c2bb 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 ea6503689..38bd0c557 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 220/239] 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 56536c2bb..36dd3698d 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 cf3cde948..e6d1df863 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 ef29f99bf..fe00f1dad 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 221/239] 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 a9d79ae34..b00c69248 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 36dd3698d..018530854 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 e6d1df863..3090b2f9d 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 197f88288..000000000 --- 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 000000000..e6b774508 --- /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 3a47beada..c59b6a2e3 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 89509eecb..efdb5f37a 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 000000000..342e724ef --- /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 000000000..0cfb264b4 --- /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 000000000..6b0b7a40a --- /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 000000000..ce3ab56d8 --- /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 000000000..4cabe9859 --- /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 fe00f1dad..abaadbb36 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 000000000..cb3758a3e --- /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 000000000..d40a43de6 --- /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 000000000..62c0d997d --- /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 000000000..479acd57c --- /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 000000000..e5c87efe4 --- /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 000000000..712b9bf9b --- /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 000000000..574299d15 --- /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 787c02660..000000000 --- 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 f322e7930..000000000 --- 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 502859781..000000000 --- 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 8b6d90d50..000000000 --- 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 ff028814d..000000000 --- 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 fa336b4ae..000000000 --- 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 da6ac3efc..000000000 --- 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 3e467922a..000000000 --- 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 8f21f8190..000000000 --- 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 71f86a159..caf9d059c 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 1d677011c..000000000 --- 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 38bd0c557..7c5b65681 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 fa1545e52..a52af3ec3 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 a42ea7422..000000000 --- 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 7413fbfe7..000000000 --- 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 db469e5ee..000000000 --- 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 4c5542692..000000000 --- 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 0de3f12f6..000000000 --- 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 6c8a697fa..000000000 --- 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 2999d447d..000000000 --- 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 000000000..23825d137 --- /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 d0d047e75..000000000 --- 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 35d182531..000000000 --- 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 7486e75c8..aaad68612 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 000000000..2ded75907 --- /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 0d58994c9..000000000 --- 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 0bc1607a4..64ffaa9f4 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 42c8f22aa..c7df13f25 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 f63141a70..c0bcbd190 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 36b9f1c78..481a7de45 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 86df71624..000000000 --- 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 cb2172f5c..000000000 --- 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 000000000..35455dfa3 --- /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 000000000..d96cbd221 --- /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 d01b28c66..4523d9f09 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 1f646101e..000000000 --- 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 7de190886..000000000 --- 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 c61412de5..000000000 --- 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 2f5289dab..747e564b7 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 4cc6238b1..879f0990d 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 8ae3476f6..000000000 --- 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 0d88e96ed..000000000 --- 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 42db8f705..000000000 --- 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 0c911003b..0950691e2 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 bc580e3d2..b6642f635 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 aa5636b33..000000000 --- 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 beb0645a9..000000000 --- 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 222/239] 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 5597df4a5..2bbf76592 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 f6d4fed3a..829154cc3 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 223/239] 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 624dd5473..8286a8eb5 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 39baba4b3..c03565d1a 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 224/239] 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 d81dc4357..8431d02fc 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 fff3a46c4..297661aae 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 225/239] 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 018530854..d0400ba10 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 000000000..7b221d277 --- /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 64ffaa9f4..98079c23a 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 c7df13f25..7cca8a154 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 77b77c08e..743395185 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 000000000..ede90ce43 --- /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 6b5bb02fd..470281607 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 000000000..3cef7291a --- /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 1a202a928..ebf78e10b 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 4c7604bd2..3d1b59e36 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 000000000..47eadcac6 --- /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 c2b0d5b17..4f56776be 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 000000000..2ff71e3d7 --- /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 226/239] 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 3eea890b2..01d0df138 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 000000000..ef7684779 --- /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 000000000..61d3dca10 --- /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 9a0a9ab2f..8c7fddfc6 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 157e132df..43c9ae05a 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 eb88e1c4d..0955b8f44 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 54cfd7b9f..026b4d947 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 000000000..4058af280 --- /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 000000000..21bc47a8e --- /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 7cca8a154..39a9d3bf4 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 ce17f8ed8..9cddb0bbe 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 63f384b13..132f917ab 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 2cd83ecb5..157abae5f 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 1b15a4f24..5262b0f04 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 000000000..dd75e5d01 --- /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 000000000..df51baa4d --- /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 000000000..16f443990 --- /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 000000000..2e7d4be26 --- /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 000000000..c3de2303c --- /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 000000000..2dc2f30cf --- /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 000000000..868185135 --- /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 000000000..233bda975 --- /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 000000000..b5e5fac9e --- /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 227/239] 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 5a1194b4a..c61c600a7 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 de481e0ad..91959ae38 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 000000000..f071dd33a --- /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 000000000..5265abfc3 --- /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 483753d63..053a7570d 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 8a9d7d60f..7cd2a8b9c 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 228/239] 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 2bbf76592..41c70690e 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 829154cc3..c6d489022 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 229/239] 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 bdf696aaa..6a28939c2 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 000000000..5169cb4bc --- /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 000000000..1e63c87f8 --- /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 d0400ba10..157e132df 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 98079c23a..eb88e1c4d 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 230/239] 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 f071dd33a..98871213c 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 5265abfc3..43e0d2d11 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 231/239] 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 c61c600a7..d9d87d55f 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 98871213c..fa07066f0 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 43e0d2d11..d1378228b 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 232/239] 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 d1378228b..92dc199f0 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 233/239] 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 fa07066f0..c75fc3bdf 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 92dc199f0..c50059180 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 234/239] 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 b2ad1105a..114a995fb 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 34e813b01..4cc32bc71 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 235/239] 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 114a995fb..9922e71b1 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 4cc32bc71..2899cbfc9 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 236/239] 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 9922e71b1..114a995fb 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 2899cbfc9..4cc32bc71 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 237/239] 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 c75fc3bdf..74cf5bb5c 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 238/239] 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 3487280a2..7a39903a8 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 866a1b525..2af64b271 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 f2fef0e0b..86c24551e 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 ef98edcb9b36eb034c63d3139f8aad048775afe4 Mon Sep 17 00:00:00 2001 From: Kubernetes Publisher Date: Thu, 21 Nov 2024 04:17:44 +0000 Subject: [PATCH 239/239] Update dependencies to v0.31.3 tag --- go.mod | 4 ++-- go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 7a39903a8..d6f4a658a 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.3 + k8s.io/apimachinery v0.31.3 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 2af64b271..6a65ca126 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.3 h1:umzm5o8lFbdN/hIXbrK9oRpOproJO62CV1zqxXrLgk8= +k8s.io/api v0.31.3/go.mod h1:UJrkIp9pnMOI9K2nlL6vwpxRzzEX5sWgn8kGQe92kCE= +k8s.io/apimachinery v0.31.3 h1:6l0WhcYgasZ/wk9ktLq5vLaoXJJr5ts6lkaQzgeYPq4= +k8s.io/apimachinery v0.31.3/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=