diff --git a/cmd/nginx-ingress/main.go b/cmd/nginx-ingress/main.go index bad0918ee8..875329a556 100644 --- a/cmd/nginx-ingress/main.go +++ b/cmd/nginx-ingress/main.go @@ -737,7 +737,7 @@ func createPlusAndLatencyCollectors( serverZoneVariableLabels := []string{"resource_type", "resource_name", "resource_namespace"} streamServerZoneVariableLabels := []string{"resource_type", "resource_name", "resource_namespace"} variableLabelNames := nginxCollector.NewVariableLabelNames(upstreamServerVariableLabels, serverZoneVariableLabels, upstreamServerPeerVariableLabelNames, - streamUpstreamServerVariableLabels, streamServerZoneVariableLabels, streamUpstreamServerPeerVariableLabelNames, nil, nil) + streamUpstreamServerVariableLabels, streamServerZoneVariableLabels, streamUpstreamServerPeerVariableLabelNames, nil) logger := kitlog.NewLogfmtLogger(os.Stdout) logger = level.NewFilter(logger, level.AllowError()) plusCollector = nginxCollector.NewNginxPlusCollector(plusClient, "nginx_ingress_nginxplus", variableLabelNames, constLabels, logger) diff --git a/config/crd/bases/appprotectdos.f5.com_dosprotectedresources.yaml b/config/crd/bases/appprotectdos.f5.com_dosprotectedresources.yaml index b7019df408..587abb3df2 100644 --- a/config/crd/bases/appprotectdos.f5.com_dosprotectedresources.yaml +++ b/config/crd/bases/appprotectdos.f5.com_dosprotectedresources.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.15.0 + controller-gen.kubebuilder.io/version: v0.16.0 name: dosprotectedresources.appprotectdos.f5.com spec: group: appprotectdos.f5.com diff --git a/config/crd/bases/externaldns.nginx.org_dnsendpoints.yaml b/config/crd/bases/externaldns.nginx.org_dnsendpoints.yaml index 0275738afc..3d3a9d06ff 100644 --- a/config/crd/bases/externaldns.nginx.org_dnsendpoints.yaml +++ b/config/crd/bases/externaldns.nginx.org_dnsendpoints.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.15.0 + controller-gen.kubebuilder.io/version: v0.16.0 name: dnsendpoints.externaldns.nginx.org spec: group: externaldns.nginx.org diff --git a/config/crd/bases/k8s.nginx.org_globalconfigurations.yaml b/config/crd/bases/k8s.nginx.org_globalconfigurations.yaml index 51fce137cd..a3aacab5bd 100644 --- a/config/crd/bases/k8s.nginx.org_globalconfigurations.yaml +++ b/config/crd/bases/k8s.nginx.org_globalconfigurations.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.15.0 + controller-gen.kubebuilder.io/version: v0.16.0 name: globalconfigurations.k8s.nginx.org spec: group: k8s.nginx.org diff --git a/config/crd/bases/k8s.nginx.org_policies.yaml b/config/crd/bases/k8s.nginx.org_policies.yaml index f275d3a441..9126b958ec 100644 --- a/config/crd/bases/k8s.nginx.org_policies.yaml +++ b/config/crd/bases/k8s.nginx.org_policies.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.15.0 + controller-gen.kubebuilder.io/version: v0.16.0 name: policies.k8s.nginx.org spec: group: k8s.nginx.org diff --git a/config/crd/bases/k8s.nginx.org_transportservers.yaml b/config/crd/bases/k8s.nginx.org_transportservers.yaml index 64ac70e949..50acfffdd2 100644 --- a/config/crd/bases/k8s.nginx.org_transportservers.yaml +++ b/config/crd/bases/k8s.nginx.org_transportservers.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.15.0 + controller-gen.kubebuilder.io/version: v0.16.0 name: transportservers.k8s.nginx.org spec: group: k8s.nginx.org diff --git a/config/crd/bases/k8s.nginx.org_virtualserverroutes.yaml b/config/crd/bases/k8s.nginx.org_virtualserverroutes.yaml index 0125eef8a1..c8fa9ce452 100644 --- a/config/crd/bases/k8s.nginx.org_virtualserverroutes.yaml +++ b/config/crd/bases/k8s.nginx.org_virtualserverroutes.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.15.0 + controller-gen.kubebuilder.io/version: v0.16.0 name: virtualserverroutes.k8s.nginx.org spec: group: k8s.nginx.org diff --git a/config/crd/bases/k8s.nginx.org_virtualservers.yaml b/config/crd/bases/k8s.nginx.org_virtualservers.yaml index 774449f8cc..946db7ea64 100644 --- a/config/crd/bases/k8s.nginx.org_virtualservers.yaml +++ b/config/crd/bases/k8s.nginx.org_virtualservers.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.15.0 + controller-gen.kubebuilder.io/version: v0.16.0 name: virtualservers.k8s.nginx.org spec: group: k8s.nginx.org diff --git a/deploy/crds-nap-dos.yaml b/deploy/crds-nap-dos.yaml index e7faf33730..04cf36a963 100644 --- a/deploy/crds-nap-dos.yaml +++ b/deploy/crds-nap-dos.yaml @@ -148,7 +148,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.15.0 + controller-gen.kubebuilder.io/version: v0.16.0 name: dosprotectedresources.appprotectdos.f5.com spec: group: appprotectdos.f5.com diff --git a/deploy/crds.yaml b/deploy/crds.yaml index b80f35c763..c040609877 100644 --- a/deploy/crds.yaml +++ b/deploy/crds.yaml @@ -2,7 +2,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.15.0 + controller-gen.kubebuilder.io/version: v0.16.0 name: dnsendpoints.externaldns.nginx.org spec: group: externaldns.nginx.org @@ -99,7 +99,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.15.0 + controller-gen.kubebuilder.io/version: v0.16.0 name: globalconfigurations.k8s.nginx.org spec: group: k8s.nginx.org @@ -205,7 +205,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.15.0 + controller-gen.kubebuilder.io/version: v0.16.0 name: policies.k8s.nginx.org spec: group: k8s.nginx.org @@ -565,7 +565,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.15.0 + controller-gen.kubebuilder.io/version: v0.16.0 name: transportservers.k8s.nginx.org spec: group: k8s.nginx.org @@ -897,7 +897,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.15.0 + controller-gen.kubebuilder.io/version: v0.16.0 name: virtualserverroutes.k8s.nginx.org spec: group: k8s.nginx.org @@ -1626,7 +1626,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.15.0 + controller-gen.kubebuilder.io/version: v0.16.0 name: virtualservers.k8s.nginx.org spec: group: k8s.nginx.org diff --git a/go.mod b/go.mod index 5f1fc12900..9d106ea557 100644 --- a/go.mod +++ b/go.mod @@ -11,26 +11,26 @@ require ( github.com/go-chi/chi/v5 v5.1.0 github.com/go-kit/log v0.2.1 github.com/golang-jwt/jwt/v4 v4.5.0 - github.com/golang/glog v1.2.0 + github.com/golang/glog v1.2.1 github.com/google/go-cmp v0.6.0 github.com/jinzhu/copier v0.4.0 github.com/kr/pretty v0.3.1 - github.com/nginxinc/nginx-plus-go-client v1.2.1 - github.com/nginxinc/nginx-prometheus-exporter v1.1.2 + github.com/nginxinc/nginx-plus-go-client v1.2.2 + github.com/nginxinc/nginx-prometheus-exporter v1.3.0 github.com/nginxinc/nginx-service-mesh v1.7.0 github.com/nginxinc/telemetry-exporter v0.1.0 - github.com/prometheus/client_golang v1.18.0 + github.com/prometheus/client_golang v1.19.1 github.com/spiffe/go-spiffe/v2 v2.3.0 github.com/stretchr/testify v1.9.0 go.opentelemetry.io/otel v1.28.0 go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.28.0 - golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 - k8s.io/api v0.30.3 - k8s.io/apimachinery v0.30.3 - k8s.io/client-go v0.30.3 - k8s.io/code-generator v0.30.3 - k8s.io/utils v0.0.0-20240502163921-fe8a2dddb1d0 - sigs.k8s.io/controller-tools v0.15.0 + golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 + k8s.io/api v0.31.0 + k8s.io/apimachinery v0.31.0 + k8s.io/client-go v0.31.0 + k8s.io/code-generator v0.31.0 + k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 + sigs.k8s.io/controller-tools v0.16.0 ) require ( @@ -56,9 +56,9 @@ require ( github.com/coreos/go-systemd/v22 v22.5.0 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/emicklei/go-restful/v3 v3.12.0 // indirect - github.com/evanphx/json-patch v5.9.0+incompatible // indirect - github.com/fatih/color v1.16.0 // indirect + github.com/fatih/color v1.17.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect + github.com/fxamacker/cbor/v2 v2.7.0 // indirect github.com/gkampitakis/ciinfo v0.3.0 // indirect github.com/gkampitakis/go-diff v1.3.2 // indirect github.com/go-asn1-ber/asn1-ber v1.5.6 // indirect @@ -95,21 +95,22 @@ require ( github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.47.0 // indirect - github.com/prometheus/procfs v0.15.0 // indirect + github.com/prometheus/common v0.55.0 // indirect + github.com/prometheus/procfs v0.15.1 // indirect github.com/rogpeppe/go-internal v1.12.0 // indirect - github.com/spf13/cobra v1.8.0 // indirect + github.com/spf13/cobra v1.8.1 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/tidwall/gjson v1.17.0 // indirect github.com/tidwall/match v1.1.1 // indirect github.com/tidwall/pretty v1.2.1 // indirect github.com/tidwall/sjson v1.2.5 // indirect + github.com/x448/float16 v0.8.4 // indirect github.com/zeebo/errs v1.3.0 // indirect - go.etcd.io/etcd/api/v3 v3.5.13 // indirect - go.etcd.io/etcd/client/pkg/v3 v3.5.13 // indirect - go.etcd.io/etcd/client/v3 v3.5.13 // indirect - go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.51.0 // indirect - go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.51.0 // indirect + go.etcd.io/etcd/api/v3 v3.5.14 // indirect + go.etcd.io/etcd/client/pkg/v3 v3.5.14 // indirect + go.etcd.io/etcd/client/v3 v3.5.14 // indirect + go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.53.0 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.28.0 // indirect go.opentelemetry.io/otel/metric v1.28.0 // indirect go.opentelemetry.io/otel/sdk v1.28.0 // indirect @@ -117,28 +118,29 @@ require ( go.opentelemetry.io/proto/otlp v1.3.1 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect - golang.org/x/crypto v0.24.0 // indirect - golang.org/x/mod v0.18.0 // indirect - golang.org/x/net v0.26.0 // indirect + golang.org/x/crypto v0.26.0 // indirect + golang.org/x/mod v0.20.0 // indirect + golang.org/x/net v0.28.0 // indirect golang.org/x/oauth2 v0.21.0 // indirect - golang.org/x/sync v0.7.0 // indirect - golang.org/x/sys v0.21.0 // indirect - golang.org/x/term v0.21.0 // indirect - golang.org/x/text v0.16.0 // indirect + golang.org/x/sync v0.8.0 // indirect + golang.org/x/sys v0.23.0 // indirect + golang.org/x/term v0.23.0 // indirect + golang.org/x/text v0.17.0 // indirect golang.org/x/time v0.5.0 // indirect - golang.org/x/tools v0.22.0 // indirect + golang.org/x/tools v0.24.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240701130421-f6361c86f094 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094 // indirect - google.golang.org/grpc v1.64.1 // indirect + google.golang.org/grpc v1.65.0 // indirect google.golang.org/protobuf v1.34.2 // indirect + gopkg.in/evanphx/json-patch.v4 v4.12.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 - k8s.io/apiextensions-apiserver v0.30.1 // indirect - k8s.io/apiserver v0.30.1 // indirect - k8s.io/component-base v0.30.1 // indirect + k8s.io/apiextensions-apiserver v0.31.0 // indirect + k8s.io/apiserver v0.31.0 // indirect + k8s.io/component-base v0.31.0 // indirect k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70 // indirect - k8s.io/klog/v2 v2.120.1 // indirect + k8s.io/klog/v2 v2.130.1 // indirect k8s.io/kube-openapi v0.0.0-20240430033511-f0e62f92d13f // indirect sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.30.3 // indirect sigs.k8s.io/gateway-api v1.1.0 // indirect diff --git a/go.sum b/go.sum index aaa419b9ca..ee34ad113b 100644 --- a/go.sum +++ b/go.sum @@ -46,7 +46,7 @@ github.com/coreos/go-semver v0.3.1 h1:yi21YpKnrx1gt5R+la8n5WgS0kCrsPp33dmEyHReZr github.com/coreos/go-semver v0.3.1/go.mod h1:irMmmIw/7yzSRPWryHsK7EYSg09caPQL03VsM8rvUec= github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs= github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= -github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= 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= @@ -58,14 +58,14 @@ github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkp github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= github.com/emicklei/go-restful/v3 v3.12.0 h1:y2DdzBAURM29NFF94q6RaY4vjIH1rtwDapwQtU84iWk= github.com/emicklei/go-restful/v3 v3.12.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= -github.com/evanphx/json-patch v5.9.0+incompatible h1:fBXyNpNMuTTDdquAq/uisOr2lShz4oaXpDTX2bLe7ls= -github.com/evanphx/json-patch v5.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= -github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= +github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4= +github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI= github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= +github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv5E= +github.com/fxamacker/cbor/v2 v2.7.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ= github.com/gkampitakis/ciinfo v0.3.0 h1:gWZlOC2+RYYttL0hBqcoQhM7h1qNkVqvRCV1fOvpAv8= github.com/gkampitakis/ciinfo v0.3.0/go.mod h1:1NIwaOcFChN4fa/B0hEBdAb6npDlFL8Bwx4dfRLRqAo= github.com/gkampitakis/go-diff v1.3.2 h1:Qyn0J9XJSDTgnsgHRdz9Zp24RaJeKMUHg2+PDZZdC4M= @@ -98,7 +98,6 @@ github.com/go-openapi/jsonreference v0.21.0 h1:Rs+Y7hSXT83Jacb7kFyjn4ijOuVGSvOdF github.com/go-openapi/jsonreference v0.21.0/go.mod h1:LmZmgsrTkVg9LG4EaHeY8cBDslNPMo06cago5JNLkm4= github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE= github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ= -github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= 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/gobuffalo/flect v1.0.2 h1:eqjPGSo2WmjgY2XlpGwo2NXgL3RucAKo4k4qQMNA5sA= @@ -122,8 +121,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-20240424215950-a892ee059fd6 h1:k7nVchz72niMH6YLQNvHSdIE7iqsQxK1P41mySCvssg= -github.com/google/pprof v0.0.0-20240424215950-a892ee059fd6/go.mod h1:kf6iHlnVGwgKolg33glAes7Yg/8iWP8ukqeldJSO7jw= +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/gorilla/securecookie v1.1.1/go.mod h1:ra0sb63/xPlUeL+yeDciTfxMRAA+MP+HVt/4epWDjd4= @@ -189,10 +188,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/nginxinc/glog v1.1.2 h1:zyoZXhCoYvNMJq4qMsKislUCGyJ4eU2gNl3Nt7cjESg= github.com/nginxinc/glog v1.1.2/go.mod h1:Q2FpGp/qFhJEVnuC88BVfbLDPmio9aHYUj4al6w0138= -github.com/nginxinc/nginx-plus-go-client v1.2.1 h1:65L9xgPDNbEbd23FTTCcaZ2qF9TX5/Z6vkkEl7RKiVo= -github.com/nginxinc/nginx-plus-go-client v1.2.1/go.mod h1:n8OFLzrJulJ2fur28Cwa1Qp5DZNS2VicLV+Adt30LQ4= -github.com/nginxinc/nginx-prometheus-exporter v1.1.2 h1:X2Oe/TOvOF4Ef/2mw72xj2BEWG+7Fud0PRngJlIy9GI= -github.com/nginxinc/nginx-prometheus-exporter v1.1.2/go.mod h1:A1Fy5uLQonVGmwLC5xNxBX+vPFgYzBOvPjNRs8msT0k= +github.com/nginxinc/nginx-plus-go-client v1.2.2 h1:sl7HqNDDZq2EVu0eQQVoZ6PKYGa4h2dB/Qr5Ib0YKGw= +github.com/nginxinc/nginx-plus-go-client v1.2.2/go.mod h1:n8OFLzrJulJ2fur28Cwa1Qp5DZNS2VicLV+Adt30LQ4= +github.com/nginxinc/nginx-prometheus-exporter v1.3.0 h1:1JtdxsZH0Uwhu1nL/j/QyOXytP5V5j68AEo2X+DFWb0= +github.com/nginxinc/nginx-prometheus-exporter v1.3.0/go.mod h1:hXoH+X6aIKSyQuO6QTIiPKH3eZyxqy/wW8GYiE3dflU= github.com/nginxinc/nginx-service-mesh v1.7.0 h1:oxKr+Jdbxkos10VTy5xF2UHCcmfIhqWNlsOK/zPnZDM= github.com/nginxinc/nginx-service-mesh v1.7.0/go.mod h1:8tREM3kSEUGyk8JT8hdCf/9ol2kEo7hLR8b+m5Yd8Fs= github.com/nginxinc/telemetry-exporter v0.1.0 h1:wF71jYx4PQpHv5ML0Ba4qN/o37ZNLfiHENXMZsVO7EQ= @@ -203,22 +202,22 @@ github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= 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/onsi/gomega v1.34.1 h1:EUMJIKUjM8sKjYbtxQI9A4z2o+rruxnzNvpknOXie6k= +github.com/onsi/gomega v1.34.1/go.mod h1:kU1QgUvBDLXBJq618Xvm2LUX6rSAfRaFRTcdOeDLwwY= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= 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/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk= -github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA= +github.com/prometheus/client_golang v1.19.1 h1:wZWJDwK+NameRJuPGDhlnFgx8e8HN3XHQeLaYJFJBOE= +github.com/prometheus/client_golang v1.19.1/go.mod h1:mP78NwGzrVks5S2H6ab8+ZZGJLZUq1hoULYBAYBw1Ho= github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= -github.com/prometheus/common v0.47.0 h1:p5Cz0FNHo7SnWOmWmoRozVcjEp0bIVU8cV7OShpjL1k= -github.com/prometheus/common v0.47.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc= -github.com/prometheus/procfs v0.15.0 h1:A82kmvXJq2jTu5YUhSGNlYoxh85zLnKgPz4bMZgI5Ek= -github.com/prometheus/procfs v0.15.0/go.mod h1:Y0RJ/Y5g5wJpkTisOtqwDSo4HwhGmLB4VQSw2sQJLHk= +github.com/prometheus/common v0.55.0 h1:KEi6DK7lXW/m7Ig5i47x0vRzuBsHuvJdi5ee6Y3G1dc= +github.com/prometheus/common v0.55.0/go.mod h1:2SECS4xJG1kd8XF9IcM1gMX6510RAEL65zxzNImwdc8= +github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= +github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= 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= @@ -227,8 +226,8 @@ github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/soheilhy/cmux v0.1.5 h1:jjzc5WVemNEDTLwv9tlmemhC73tI08BNOIGwBOo10Js= github.com/soheilhy/cmux v0.1.5/go.mod h1:T7TcVDs9LWfQgPlPsdngu6I6QIoyIFZDDC6sNE1GqG0= -github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= -github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= +github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= +github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= 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/spiffe/go-spiffe/v2 v2.3.0 h1:g2jYNb/PDMB8I7mBGL2Zuq/Ur6hUhoroxGQFyD6tTj8= @@ -255,6 +254,8 @@ github.com/tidwall/sjson v1.2.5 h1:kLy8mja+1c9jlljvWTlSazM7cKDRfJuR/bOJhcY5NcY= github.com/tidwall/sjson v1.2.5/go.mod h1:Fvgq9kS/6ociJEDnK0Fk1cpYF4FIW6ZF7LAe+6jwd28= github.com/tmc/grpc-websocket-proxy v0.0.0-20220101234140-673ab2c3ae75 h1:6fotK7otjonDflCTK0BCfls4SPy3NcCVb5dqqmbRknE= github.com/tmc/grpc-websocket-proxy v0.0.0-20220101234140-673ab2c3ae75/go.mod h1:KO6IkyS8Y3j8OdNO85qEYBsRPuteD+YciPomcXdrMnk= +github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= +github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 h1:eY9dn8+vbi4tKz5Qo6v2eYzo7kUS51QINcR5jNpbZS8= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -262,26 +263,26 @@ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9dec github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/zeebo/errs v1.3.0 h1:hmiaKqgYZzcVgRL1Vkc1Mn2914BbzB0IBxs+ebeutGs= github.com/zeebo/errs v1.3.0/go.mod h1:sgbWHsvVuTPHcqJJGQ1WhI5KbWlHYz+2+2C/LSEtCw4= -go.etcd.io/bbolt v1.3.8 h1:xs88BrvEv273UsB79e0hcVrlUWmS0a8upikMFhSyAtA= -go.etcd.io/bbolt v1.3.8/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw= -go.etcd.io/etcd/api/v3 v3.5.13 h1:8WXU2/NBge6AUF1K1gOexB6e07NgsN1hXK0rSTtgSp4= -go.etcd.io/etcd/api/v3 v3.5.13/go.mod h1:gBqlqkcMMZMVTMm4NDZloEVJzxQOQIls8splbqBDa0c= -go.etcd.io/etcd/client/pkg/v3 v3.5.13 h1:RVZSAnWWWiI5IrYAXjQorajncORbS0zI48LQlE2kQWg= -go.etcd.io/etcd/client/pkg/v3 v3.5.13/go.mod h1:XxHT4u1qU12E2+po+UVPrEeL94Um6zL58ppuJWXSAB8= -go.etcd.io/etcd/client/v2 v2.305.10 h1:MrmRktzv/XF8CvtQt+P6wLUlURaNpSDJHFZhe//2QE4= -go.etcd.io/etcd/client/v2 v2.305.10/go.mod h1:m3CKZi69HzilhVqtPDcjhSGp+kA1OmbNn0qamH80xjA= -go.etcd.io/etcd/client/v3 v3.5.13 h1:o0fHTNJLeO0MyVbc7I3fsCf6nrOqn5d+diSarKnB2js= -go.etcd.io/etcd/client/v3 v3.5.13/go.mod h1:cqiAeY8b5DEEcpxvgWKsbLIWNM/8Wy2xJSDMtioMcoI= -go.etcd.io/etcd/pkg/v3 v3.5.10 h1:WPR8K0e9kWl1gAhB5A7gEa5ZBTNkT9NdNWrR8Qpo1CM= -go.etcd.io/etcd/pkg/v3 v3.5.10/go.mod h1:TKTuCKKcF1zxmfKWDkfz5qqYaE3JncKKZPFf8c1nFUs= -go.etcd.io/etcd/raft/v3 v3.5.10 h1:cgNAYe7xrsrn/5kXMSaH8kM/Ky8mAdMqGOxyYwpP0LA= -go.etcd.io/etcd/raft/v3 v3.5.10/go.mod h1:odD6kr8XQXTy9oQnyMPBOr0TVe+gT0neQhElQ6jbGRc= -go.etcd.io/etcd/server/v3 v3.5.10 h1:4NOGyOwD5sUZ22PiWYKmfxqoeh72z6EhYjNosKGLmZg= -go.etcd.io/etcd/server/v3 v3.5.10/go.mod h1:gBplPHfs6YI0L+RpGkTQO7buDbHv5HJGG/Bst0/zIPo= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.51.0 h1:A3SayB3rNyt+1S6qpI9mHPkeHTZbD7XILEqWnYZb2l0= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.51.0/go.mod h1:27iA5uvhuRNmalO+iEUdVn5ZMj2qy10Mm+XRIpRmyuU= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.51.0 h1:Xs2Ncz0gNihqu9iosIZ5SkBbWo5T8JhhLJFMQL1qmLI= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.51.0/go.mod h1:vy+2G/6NvVMpwGX/NyLqcC41fxepnuKHk16E6IZUcJc= +go.etcd.io/bbolt v1.3.9 h1:8x7aARPEXiXbHmtUwAIv7eV2fQFHrLLavdiJ3uzJXoI= +go.etcd.io/bbolt v1.3.9/go.mod h1:zaO32+Ti0PK1ivdPtgMESzuzL2VPoIG1PCQNvOdo/dE= +go.etcd.io/etcd/api/v3 v3.5.14 h1:vHObSCxyB9zlF60w7qzAdTcGaglbJOpSj1Xj9+WGxq0= +go.etcd.io/etcd/api/v3 v3.5.14/go.mod h1:BmtWcRlQvwa1h3G2jvKYwIQy4PkHlDej5t7uLMUdJUU= +go.etcd.io/etcd/client/pkg/v3 v3.5.14 h1:SaNH6Y+rVEdxfpA2Jr5wkEvN6Zykme5+YnbCkxvuWxQ= +go.etcd.io/etcd/client/pkg/v3 v3.5.14/go.mod h1:8uMgAokyG1czCtIdsq+AGyYQMvpIKnSvPjFMunkgeZI= +go.etcd.io/etcd/client/v2 v2.305.13 h1:RWfV1SX5jTU0lbCvpVQe3iPQeAHETWdOTb6pxhd77C8= +go.etcd.io/etcd/client/v2 v2.305.13/go.mod h1:iQnL7fepbiomdXMb3om1rHq96htNNGv2sJkEcZGDRRg= +go.etcd.io/etcd/client/v3 v3.5.14 h1:CWfRs4FDaDoSz81giL7zPpZH2Z35tbOrAJkkjMqOupg= +go.etcd.io/etcd/client/v3 v3.5.14/go.mod h1:k3XfdV/VIHy/97rqWjoUzrj9tk7GgJGH9J8L4dNXmAk= +go.etcd.io/etcd/pkg/v3 v3.5.13 h1:st9bDWNsKkBNpP4PR1MvM/9NqUPfvYZx/YXegsYEH8M= +go.etcd.io/etcd/pkg/v3 v3.5.13/go.mod h1:N+4PLrp7agI/Viy+dUYpX7iRtSPvKq+w8Y14d1vX+m0= +go.etcd.io/etcd/raft/v3 v3.5.13 h1:7r/NKAOups1YnKcfro2RvGGo2PTuizF/xh26Z2CTAzA= +go.etcd.io/etcd/raft/v3 v3.5.13/go.mod h1:uUFibGLn2Ksm2URMxN1fICGhk8Wu96EfDQyuLhAcAmw= +go.etcd.io/etcd/server/v3 v3.5.13 h1:V6KG+yMfMSqWt+lGnhFpP5z5dRUj1BDRJ5k1fQ9DFok= +go.etcd.io/etcd/server/v3 v3.5.13/go.mod h1:K/8nbsGupHqmr5MkgaZpLlH1QdX1pcNQLAkODy44XcQ= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.53.0 h1:9G6E0TXzGFVfTnawRzrPl83iHOAV7L8NJiR8RSGYV1g= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.53.0/go.mod h1:azvtTADFQJA8mX80jIH/akaE7h+dbm/sVuaHqN13w74= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0 h1:4K4tsIXefpVJtvA/8srF4V4y0akAoPHkIslgAkjixJA= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0/go.mod h1:jjdQuTGVsXV4vSs+CJ2qYDeDPf9yIJV23qlIzBm73Vg= go.opentelemetry.io/otel v1.28.0 h1:/SqNcYk+idO0CxKEUOtKQClMK/MimZihKYMruSMViUo= go.opentelemetry.io/otel v1.28.0/go.mod h1:q68ijF8Fc8CnMHKyzqL6akLO46ePnjkgfIMIjUIX9z4= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.28.0 h1:3Q/xZUyC1BBkualc9ROb4G8qkH90LXEIICcs5zv1OYY= @@ -309,16 +310,16 @@ golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= -golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI= -golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM= -golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 h1:vr/HnozRka3pE4EsMEg1lgkXJkTFJCVUX+S/ZT6wYzM= -golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842/go.mod h1:XtvwrStGgqGPLc4cjQfWqZHG1YFdYs6swckp8vpsjnc= +golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw= +golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54= +golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 h1:2dVuKD2vS7b0QIHQbpyTISPd0LeHDbnYEryqj5Q1ug8= +golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56/go.mod h1:M4RDyNAINzryxdtnbRXRL/OHtkFuWGRjvuhBJpk2IlY= 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.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.18.0 h1:5+9lSbEzPSdWkH32vYPBwEpX8KwDbM52Ud9xBUvNlb0= -golang.org/x/mod v0.18.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.20.0 h1:utOm6MM3R3dnawAiJgn0y+xvuYRsm1RKM/4giyfDgV0= +golang.org/x/mod v0.20.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-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -331,8 +332,8 @@ golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= -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/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= +golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= 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= @@ -340,8 +341,8 @@ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.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= @@ -355,24 +356,24 @@ golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -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/sys v0.23.0 h1:YfKFowiIMvtgl1UERQoTPPToxltDeZfbj4H7dVUCwmM= +golang.org/x/sys v0.23.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= -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/term v0.23.0 h1:F6D4vR+EHoL9/sWAWgAR1H2DcHr4PareCbAaCo1RpuU= +golang.org/x/term v0.23.0/go.mod h1:DgV24QBUrK6jhZXl+20l6UWznPlwAHm1Q1mGHtydmSk= 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.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.14.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/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= +golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -381,8 +382,8 @@ golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.22.0 h1:gqSGLZqv+AI9lIQzniJ0nZDRG5GBPsSi+DRNHWNz6yA= -golang.org/x/tools v0.22.0/go.mod h1:aCwcsjqvq7Yqt6TNyX7QMU2enbQ/Gt0bo6krSeEri+c= +golang.org/x/tools v0.24.0 h1:J1shsA93PJUEVaUSaay7UXAyE8aimq3GW0pjlolpa24= +golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ= 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= @@ -393,13 +394,15 @@ google.golang.org/genproto/googleapis/api v0.0.0-20240701130421-f6361c86f094 h1: google.golang.org/genproto/googleapis/api v0.0.0-20240701130421-f6361c86f094/go.mod h1:fJ/e3If/Q67Mj99hin0hMhiNyCRmt6BQ2aWIJshUSJw= google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094 h1:BwIjyKYGsK9dMCBOorzRri8MQwmi7mT9rGHsCEinZkA= google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094/go.mod h1:Ue6ibwXGpU+dqIcODieyLOcgj7z8+IcskoNIgZxtrFY= -google.golang.org/grpc v1.64.1 h1:LKtvyfbX3UGVPFcGqJ9ItpVWW6oN/2XqTxfAnwRRXiA= -google.golang.org/grpc v1.64.1/go.mod h1:hiQF4LFZelK2WKaP6W0L92zGHtiQdZxk8CrSdvyjeP0= +google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc= +google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ= 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= +gopkg.in/evanphx/json-patch.v4 v4.12.0 h1:n6jtcsulIzXPJaxegRbvFNNrZDjbij7ny3gmSPG+6V4= +gopkg.in/evanphx/json-patch.v4 v4.12.0/go.mod h1:p8EYWUEYMpynmqDbY58zCKCFZw8pRWMG4EsWvDvM72M= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc= @@ -413,32 +416,32 @@ 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.30.3 h1:ImHwK9DCsPA9uoU3rVh4QHAHHK5dTSv1nxJUapx8hoQ= -k8s.io/api v0.30.3/go.mod h1:GPc8jlzoe5JG3pb0KJCSLX5oAFIW3/qNJITlDj8BH04= -k8s.io/apiextensions-apiserver v0.30.1 h1:4fAJZ9985BmpJG6PkoxVRpXv9vmPUOVzl614xarePws= -k8s.io/apiextensions-apiserver v0.30.1/go.mod h1:R4GuSrlhgq43oRY9sF2IToFh7PVlF1JjfWdoG3pixk4= -k8s.io/apimachinery v0.30.3 h1:q1laaWCmrszyQuSQCfNB8cFgCuDAoPszKY4ucAjDwHc= -k8s.io/apimachinery v0.30.3/go.mod h1:iexa2somDaxdnj7bha06bhb43Zpa6eWH8N8dbqVjTUc= -k8s.io/apiserver v0.30.1 h1:BEWEe8bzS12nMtDKXzCF5Q5ovp6LjjYkSp8qOPk8LZ8= -k8s.io/apiserver v0.30.1/go.mod h1:i87ZnQ+/PGAmSbD/iEKM68bm1D5reX8fO4Ito4B01mo= -k8s.io/client-go v0.30.3 h1:bHrJu3xQZNXIi8/MoxYtZBBWQQXwy16zqJwloXXfD3k= -k8s.io/client-go v0.30.3/go.mod h1:8d4pf8vYu665/kUbsxWAQ/JDBNWqfFeZnvFiVdmx89U= -k8s.io/code-generator v0.30.3 h1:bmtnLJKagDS5f5uOEpLyJiDfIMKXGMKgOLBdde+w0Mc= -k8s.io/code-generator v0.30.3/go.mod h1:PFgBiv+miFV7TZYp+RXgROkhA+sWYZ+mtpbMLofMke8= -k8s.io/component-base v0.30.1 h1:bvAtlPh1UrdaZL20D9+sWxsJljMi0QZ3Lmw+kmZAaxQ= -k8s.io/component-base v0.30.1/go.mod h1:e/X9kDiOebwlI41AvBHuWdqFriSRrX50CdwA9TFaHLI= +k8s.io/api v0.31.0 h1:b9LiSjR2ym/SzTOlfMHm1tr7/21aD7fSkqgD/CVJBCo= +k8s.io/api v0.31.0/go.mod h1:0YiFF+JfFxMM6+1hQei8FY8M7s1Mth+z/q7eF1aJkTE= +k8s.io/apiextensions-apiserver v0.31.0 h1:fZgCVhGwsclj3qCw1buVXCV6khjRzKC5eCFt24kyLSk= +k8s.io/apiextensions-apiserver v0.31.0/go.mod h1:b9aMDEYaEe5sdK+1T0KU78ApR/5ZVp4i56VacZYEHxk= +k8s.io/apimachinery v0.31.0 h1:m9jOiSr3FoSSL5WO9bjm1n6B9KROYYgNZOb4tyZ1lBc= +k8s.io/apimachinery v0.31.0/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo= +k8s.io/apiserver v0.31.0 h1:p+2dgJjy+bk+B1Csz+mc2wl5gHwvNkC9QJV+w55LVrY= +k8s.io/apiserver v0.31.0/go.mod h1:KI9ox5Yu902iBnnyMmy7ajonhKnkeZYJhTZ/YI+WEMk= +k8s.io/client-go v0.31.0 h1:QqEJzNjbN2Yv1H79SsS+SWnXkBgVu4Pj3CJQgbx0gI8= +k8s.io/client-go v0.31.0/go.mod h1:Y9wvC76g4fLjmU0BA+rV+h2cncoadjvjjkkIGoTLcGU= +k8s.io/code-generator v0.31.0 h1:w607nrMi1KeDKB3/F/J4lIoOgAwc+gV9ZKew4XRfMp8= +k8s.io/code-generator v0.31.0/go.mod h1:84y4w3es8rOJOUUP1rLsIiGlO1JuEaPFXQPA9e/K6U0= +k8s.io/component-base v0.31.0 h1:/KIzGM5EvPNQcYgwq5NwoQBaOlVFrghoVGr8lG6vNRs= +k8s.io/component-base v0.31.0/go.mod h1:TYVuzI1QmN4L5ItVdMSXKvH7/DtvIuas5/mm8YT3rTo= k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70 h1:NGrVE502P0s0/1hudf8zjgwki1X/TByhmAoILTarmzo= 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/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-20240430033511-f0e62f92d13f h1:0LQagt0gDpKqvIkAMPaRGcXawNMouPECM1+F9BVxEaM= k8s.io/kube-openapi v0.0.0-20240430033511-f0e62f92d13f/go.mod h1:S9tOR0FxgyusSNR+MboCuiDpVWkAifZvaYI1Q2ubgro= -k8s.io/utils v0.0.0-20240502163921-fe8a2dddb1d0 h1:jgGTlFYnhF1PM1Ax/lAlxUPE+KfCIXHaathvJg1C3ak= -k8s.io/utils v0.0.0-20240502163921-fe8a2dddb1d0/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/apiserver-network-proxy/konnectivity-client v0.30.3 h1:2770sDpzrjjsAtVhSeUFseziht227YAWYHLGNM8QPwY= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.30.3/go.mod h1:Ve9uj1L+deCXFrPOk1LpFXqTg7LCFzFso6PA48q/XZw= -sigs.k8s.io/controller-tools v0.15.0 h1:4dxdABXGDhIa68Fiwaif0vcu32xfwmgQ+w8p+5CxoAI= -sigs.k8s.io/controller-tools v0.15.0/go.mod h1:8zUSS2T8Hx0APCNRhJWbS3CAQEbIxLa07khzh7pZmXM= +sigs.k8s.io/controller-tools v0.16.0 h1:EJPB+a5Bve861SPBPPWRbP6bbKyNxqK12oYT5zEns9s= +sigs.k8s.io/controller-tools v0.16.0/go.mod h1:0I0xqjR65YTfoO12iR+mZR6s6UAVcUARgXRlsu0ljB0= sigs.k8s.io/gateway-api v1.1.0 h1:DsLDXCi6jR+Xz8/xd0Z1PYl2Pn0TyaFMOPPZIj4inDM= sigs.k8s.io/gateway-api v1.1.0/go.mod h1:ZH4lHrL2sDi0FHZ9jjneb8kKnGzFWyrTya35sWUTrRs= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= diff --git a/internal/k8s/status_test.go b/internal/k8s/status_test.go index ea9f7c6270..7bd18a88c3 100644 --- a/internal/k8s/status_test.go +++ b/internal/k8s/status_test.go @@ -179,12 +179,12 @@ func TestUpdateTransportServerStatusMissingTransportServer(t *testing.T) { err := su.UpdateTransportServerStatus(ts, "after status", "after reason", "after message") if err != nil { - t.Errorf("unexpected error: %v, result should be empty as no matching TransportServer is present", err) + t.Fatalf("unexpected error: %v, result should be empty as no matching TransportServer is present", err) } - updatedTs, _ := fakeClient.K8sV1().TransportServers(ts.Namespace).Get(context.TODO(), ts.Name, meta_v1.GetOptions{}) - if updatedTs != nil { - t.Errorf("expected TransportServer Store would be empty as provided TransportServer was not found. Unexpected updated TransportServer: %v", updatedTs) + _, err = fakeClient.K8sV1().TransportServers(ts.Namespace).Get(context.TODO(), ts.Name, meta_v1.GetOptions{}) + if err == nil { + t.Fatalf("expected TransportServer Store would be empty as provided TransportServer was not found.") } } diff --git a/pkg/client/clientset/versioned/fake/clientset_generated.go b/pkg/client/clientset/versioned/fake/clientset_generated.go index ab5a883c4a..65ffe4b639 100644 --- a/pkg/client/clientset/versioned/fake/clientset_generated.go +++ b/pkg/client/clientset/versioned/fake/clientset_generated.go @@ -21,8 +21,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 { diff --git a/pkg/client/clientset/versioned/typed/configuration/v1/fake/fake_globalconfiguration.go b/pkg/client/clientset/versioned/typed/configuration/v1/fake/fake_globalconfiguration.go index 3ab58a3634..9af4a4cef4 100644 --- a/pkg/client/clientset/versioned/typed/configuration/v1/fake/fake_globalconfiguration.go +++ b/pkg/client/clientset/versioned/typed/configuration/v1/fake/fake_globalconfiguration.go @@ -25,22 +25,24 @@ var globalconfigurationsKind = v1.SchemeGroupVersion.WithKind("GlobalConfigurati // Get takes name of the globalConfiguration, and returns the corresponding globalConfiguration object, and an error if there is any. func (c *FakeGlobalConfigurations) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.GlobalConfiguration, err error) { + emptyResult := &v1.GlobalConfiguration{} obj, err := c.Fake. - Invokes(testing.NewGetAction(globalconfigurationsResource, c.ns, name), &v1.GlobalConfiguration{}) + Invokes(testing.NewGetActionWithOptions(globalconfigurationsResource, c.ns, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.GlobalConfiguration), err } // List takes label and field selectors, and returns the list of GlobalConfigurations that match those selectors. func (c *FakeGlobalConfigurations) List(ctx context.Context, opts metav1.ListOptions) (result *v1.GlobalConfigurationList, err error) { + emptyResult := &v1.GlobalConfigurationList{} obj, err := c.Fake. - Invokes(testing.NewListAction(globalconfigurationsResource, globalconfigurationsKind, c.ns, opts), &v1.GlobalConfigurationList{}) + Invokes(testing.NewListActionWithOptions(globalconfigurationsResource, globalconfigurationsKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -59,28 +61,30 @@ func (c *FakeGlobalConfigurations) List(ctx context.Context, opts metav1.ListOpt // Watch returns a watch.Interface that watches the requested globalConfigurations. func (c *FakeGlobalConfigurations) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(globalconfigurationsResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(globalconfigurationsResource, c.ns, opts)) } // Create takes the representation of a globalConfiguration and creates it. Returns the server's representation of the globalConfiguration, and an error, if there is any. func (c *FakeGlobalConfigurations) Create(ctx context.Context, globalConfiguration *v1.GlobalConfiguration, opts metav1.CreateOptions) (result *v1.GlobalConfiguration, err error) { + emptyResult := &v1.GlobalConfiguration{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(globalconfigurationsResource, c.ns, globalConfiguration), &v1.GlobalConfiguration{}) + Invokes(testing.NewCreateActionWithOptions(globalconfigurationsResource, c.ns, globalConfiguration, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.GlobalConfiguration), err } // Update takes the representation of a globalConfiguration and updates it. Returns the server's representation of the globalConfiguration, and an error, if there is any. func (c *FakeGlobalConfigurations) Update(ctx context.Context, globalConfiguration *v1.GlobalConfiguration, opts metav1.UpdateOptions) (result *v1.GlobalConfiguration, err error) { + emptyResult := &v1.GlobalConfiguration{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(globalconfigurationsResource, c.ns, globalConfiguration), &v1.GlobalConfiguration{}) + Invokes(testing.NewUpdateActionWithOptions(globalconfigurationsResource, c.ns, globalConfiguration, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.GlobalConfiguration), err } @@ -95,7 +99,7 @@ func (c *FakeGlobalConfigurations) Delete(ctx context.Context, name string, opts // DeleteCollection deletes a collection of objects. func (c *FakeGlobalConfigurations) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionAction(globalconfigurationsResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(globalconfigurationsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.GlobalConfigurationList{}) return err @@ -103,11 +107,12 @@ func (c *FakeGlobalConfigurations) DeleteCollection(ctx context.Context, opts me // Patch applies the patch and returns the patched globalConfiguration. func (c *FakeGlobalConfigurations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.GlobalConfiguration, err error) { + emptyResult := &v1.GlobalConfiguration{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(globalconfigurationsResource, c.ns, name, pt, data, subresources...), &v1.GlobalConfiguration{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(globalconfigurationsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.GlobalConfiguration), err } diff --git a/pkg/client/clientset/versioned/typed/configuration/v1/fake/fake_policy.go b/pkg/client/clientset/versioned/typed/configuration/v1/fake/fake_policy.go index 9d2b079243..760fdfc030 100644 --- a/pkg/client/clientset/versioned/typed/configuration/v1/fake/fake_policy.go +++ b/pkg/client/clientset/versioned/typed/configuration/v1/fake/fake_policy.go @@ -25,22 +25,24 @@ var policiesKind = v1.SchemeGroupVersion.WithKind("Policy") // Get takes name of the policy, and returns the corresponding policy object, and an error if there is any. func (c *FakePolicies) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Policy, err error) { + emptyResult := &v1.Policy{} obj, err := c.Fake. - Invokes(testing.NewGetAction(policiesResource, c.ns, name), &v1.Policy{}) + Invokes(testing.NewGetActionWithOptions(policiesResource, c.ns, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Policy), err } // List takes label and field selectors, and returns the list of Policies that match those selectors. func (c *FakePolicies) List(ctx context.Context, opts metav1.ListOptions) (result *v1.PolicyList, err error) { + emptyResult := &v1.PolicyList{} obj, err := c.Fake. - Invokes(testing.NewListAction(policiesResource, policiesKind, c.ns, opts), &v1.PolicyList{}) + Invokes(testing.NewListActionWithOptions(policiesResource, policiesKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -59,40 +61,43 @@ func (c *FakePolicies) List(ctx context.Context, opts metav1.ListOptions) (resul // Watch returns a watch.Interface that watches the requested policies. func (c *FakePolicies) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(policiesResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(policiesResource, c.ns, opts)) } // Create takes the representation of a policy and creates it. Returns the server's representation of the policy, and an error, if there is any. func (c *FakePolicies) Create(ctx context.Context, policy *v1.Policy, opts metav1.CreateOptions) (result *v1.Policy, err error) { + emptyResult := &v1.Policy{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(policiesResource, c.ns, policy), &v1.Policy{}) + Invokes(testing.NewCreateActionWithOptions(policiesResource, c.ns, policy, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Policy), err } // Update takes the representation of a policy and updates it. Returns the server's representation of the policy, and an error, if there is any. func (c *FakePolicies) Update(ctx context.Context, policy *v1.Policy, opts metav1.UpdateOptions) (result *v1.Policy, err error) { + emptyResult := &v1.Policy{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(policiesResource, c.ns, policy), &v1.Policy{}) + Invokes(testing.NewUpdateActionWithOptions(policiesResource, c.ns, policy, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Policy), 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 *FakePolicies) UpdateStatus(ctx context.Context, policy *v1.Policy, opts metav1.UpdateOptions) (*v1.Policy, error) { +func (c *FakePolicies) UpdateStatus(ctx context.Context, policy *v1.Policy, opts metav1.UpdateOptions) (result *v1.Policy, err error) { + emptyResult := &v1.Policy{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(policiesResource, "status", c.ns, policy), &v1.Policy{}) + Invokes(testing.NewUpdateSubresourceActionWithOptions(policiesResource, "status", c.ns, policy, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Policy), err } @@ -107,7 +112,7 @@ func (c *FakePolicies) Delete(ctx context.Context, name string, opts metav1.Dele // DeleteCollection deletes a collection of objects. func (c *FakePolicies) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionAction(policiesResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(policiesResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.PolicyList{}) return err @@ -115,11 +120,12 @@ func (c *FakePolicies) DeleteCollection(ctx context.Context, opts metav1.DeleteO // Patch applies the patch and returns the patched policy. func (c *FakePolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Policy, err error) { + emptyResult := &v1.Policy{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(policiesResource, c.ns, name, pt, data, subresources...), &v1.Policy{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(policiesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Policy), err } diff --git a/pkg/client/clientset/versioned/typed/configuration/v1/fake/fake_transportserver.go b/pkg/client/clientset/versioned/typed/configuration/v1/fake/fake_transportserver.go index 4162fb3c09..d8abd82d93 100644 --- a/pkg/client/clientset/versioned/typed/configuration/v1/fake/fake_transportserver.go +++ b/pkg/client/clientset/versioned/typed/configuration/v1/fake/fake_transportserver.go @@ -25,22 +25,24 @@ var transportserversKind = v1.SchemeGroupVersion.WithKind("TransportServer") // Get takes name of the transportServer, and returns the corresponding transportServer object, and an error if there is any. func (c *FakeTransportServers) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.TransportServer, err error) { + emptyResult := &v1.TransportServer{} obj, err := c.Fake. - Invokes(testing.NewGetAction(transportserversResource, c.ns, name), &v1.TransportServer{}) + Invokes(testing.NewGetActionWithOptions(transportserversResource, c.ns, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.TransportServer), err } // List takes label and field selectors, and returns the list of TransportServers that match those selectors. func (c *FakeTransportServers) List(ctx context.Context, opts metav1.ListOptions) (result *v1.TransportServerList, err error) { + emptyResult := &v1.TransportServerList{} obj, err := c.Fake. - Invokes(testing.NewListAction(transportserversResource, transportserversKind, c.ns, opts), &v1.TransportServerList{}) + Invokes(testing.NewListActionWithOptions(transportserversResource, transportserversKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -59,40 +61,43 @@ func (c *FakeTransportServers) List(ctx context.Context, opts metav1.ListOptions // Watch returns a watch.Interface that watches the requested transportServers. func (c *FakeTransportServers) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(transportserversResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(transportserversResource, c.ns, opts)) } // Create takes the representation of a transportServer and creates it. Returns the server's representation of the transportServer, and an error, if there is any. func (c *FakeTransportServers) Create(ctx context.Context, transportServer *v1.TransportServer, opts metav1.CreateOptions) (result *v1.TransportServer, err error) { + emptyResult := &v1.TransportServer{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(transportserversResource, c.ns, transportServer), &v1.TransportServer{}) + Invokes(testing.NewCreateActionWithOptions(transportserversResource, c.ns, transportServer, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.TransportServer), err } // Update takes the representation of a transportServer and updates it. Returns the server's representation of the transportServer, and an error, if there is any. func (c *FakeTransportServers) Update(ctx context.Context, transportServer *v1.TransportServer, opts metav1.UpdateOptions) (result *v1.TransportServer, err error) { + emptyResult := &v1.TransportServer{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(transportserversResource, c.ns, transportServer), &v1.TransportServer{}) + Invokes(testing.NewUpdateActionWithOptions(transportserversResource, c.ns, transportServer, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.TransportServer), 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 *FakeTransportServers) UpdateStatus(ctx context.Context, transportServer *v1.TransportServer, opts metav1.UpdateOptions) (*v1.TransportServer, error) { +func (c *FakeTransportServers) UpdateStatus(ctx context.Context, transportServer *v1.TransportServer, opts metav1.UpdateOptions) (result *v1.TransportServer, err error) { + emptyResult := &v1.TransportServer{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(transportserversResource, "status", c.ns, transportServer), &v1.TransportServer{}) + Invokes(testing.NewUpdateSubresourceActionWithOptions(transportserversResource, "status", c.ns, transportServer, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.TransportServer), err } @@ -107,7 +112,7 @@ func (c *FakeTransportServers) Delete(ctx context.Context, name string, opts met // DeleteCollection deletes a collection of objects. func (c *FakeTransportServers) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionAction(transportserversResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(transportserversResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.TransportServerList{}) return err @@ -115,11 +120,12 @@ func (c *FakeTransportServers) DeleteCollection(ctx context.Context, opts metav1 // Patch applies the patch and returns the patched transportServer. func (c *FakeTransportServers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.TransportServer, err error) { + emptyResult := &v1.TransportServer{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(transportserversResource, c.ns, name, pt, data, subresources...), &v1.TransportServer{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(transportserversResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.TransportServer), err } diff --git a/pkg/client/clientset/versioned/typed/configuration/v1/fake/fake_virtualserver.go b/pkg/client/clientset/versioned/typed/configuration/v1/fake/fake_virtualserver.go index 9d3eade2b7..63bc61e4d5 100644 --- a/pkg/client/clientset/versioned/typed/configuration/v1/fake/fake_virtualserver.go +++ b/pkg/client/clientset/versioned/typed/configuration/v1/fake/fake_virtualserver.go @@ -25,22 +25,24 @@ var virtualserversKind = v1.SchemeGroupVersion.WithKind("VirtualServer") // Get takes name of the virtualServer, and returns the corresponding virtualServer object, and an error if there is any. func (c *FakeVirtualServers) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.VirtualServer, err error) { + emptyResult := &v1.VirtualServer{} obj, err := c.Fake. - Invokes(testing.NewGetAction(virtualserversResource, c.ns, name), &v1.VirtualServer{}) + Invokes(testing.NewGetActionWithOptions(virtualserversResource, c.ns, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.VirtualServer), err } // List takes label and field selectors, and returns the list of VirtualServers that match those selectors. func (c *FakeVirtualServers) List(ctx context.Context, opts metav1.ListOptions) (result *v1.VirtualServerList, err error) { + emptyResult := &v1.VirtualServerList{} obj, err := c.Fake. - Invokes(testing.NewListAction(virtualserversResource, virtualserversKind, c.ns, opts), &v1.VirtualServerList{}) + Invokes(testing.NewListActionWithOptions(virtualserversResource, virtualserversKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -59,40 +61,43 @@ func (c *FakeVirtualServers) List(ctx context.Context, opts metav1.ListOptions) // Watch returns a watch.Interface that watches the requested virtualServers. func (c *FakeVirtualServers) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(virtualserversResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(virtualserversResource, c.ns, opts)) } // Create takes the representation of a virtualServer and creates it. Returns the server's representation of the virtualServer, and an error, if there is any. func (c *FakeVirtualServers) Create(ctx context.Context, virtualServer *v1.VirtualServer, opts metav1.CreateOptions) (result *v1.VirtualServer, err error) { + emptyResult := &v1.VirtualServer{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(virtualserversResource, c.ns, virtualServer), &v1.VirtualServer{}) + Invokes(testing.NewCreateActionWithOptions(virtualserversResource, c.ns, virtualServer, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.VirtualServer), err } // Update takes the representation of a virtualServer and updates it. Returns the server's representation of the virtualServer, and an error, if there is any. func (c *FakeVirtualServers) Update(ctx context.Context, virtualServer *v1.VirtualServer, opts metav1.UpdateOptions) (result *v1.VirtualServer, err error) { + emptyResult := &v1.VirtualServer{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(virtualserversResource, c.ns, virtualServer), &v1.VirtualServer{}) + Invokes(testing.NewUpdateActionWithOptions(virtualserversResource, c.ns, virtualServer, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.VirtualServer), 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 *FakeVirtualServers) UpdateStatus(ctx context.Context, virtualServer *v1.VirtualServer, opts metav1.UpdateOptions) (*v1.VirtualServer, error) { +func (c *FakeVirtualServers) UpdateStatus(ctx context.Context, virtualServer *v1.VirtualServer, opts metav1.UpdateOptions) (result *v1.VirtualServer, err error) { + emptyResult := &v1.VirtualServer{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(virtualserversResource, "status", c.ns, virtualServer), &v1.VirtualServer{}) + Invokes(testing.NewUpdateSubresourceActionWithOptions(virtualserversResource, "status", c.ns, virtualServer, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.VirtualServer), err } @@ -107,7 +112,7 @@ func (c *FakeVirtualServers) Delete(ctx context.Context, name string, opts metav // DeleteCollection deletes a collection of objects. func (c *FakeVirtualServers) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionAction(virtualserversResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(virtualserversResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.VirtualServerList{}) return err @@ -115,11 +120,12 @@ func (c *FakeVirtualServers) DeleteCollection(ctx context.Context, opts metav1.D // Patch applies the patch and returns the patched virtualServer. func (c *FakeVirtualServers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.VirtualServer, err error) { + emptyResult := &v1.VirtualServer{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(virtualserversResource, c.ns, name, pt, data, subresources...), &v1.VirtualServer{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(virtualserversResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.VirtualServer), err } diff --git a/pkg/client/clientset/versioned/typed/configuration/v1/fake/fake_virtualserverroute.go b/pkg/client/clientset/versioned/typed/configuration/v1/fake/fake_virtualserverroute.go index b4c644c5f6..3f6cbead38 100644 --- a/pkg/client/clientset/versioned/typed/configuration/v1/fake/fake_virtualserverroute.go +++ b/pkg/client/clientset/versioned/typed/configuration/v1/fake/fake_virtualserverroute.go @@ -25,22 +25,24 @@ var virtualserverroutesKind = v1.SchemeGroupVersion.WithKind("VirtualServerRoute // Get takes name of the virtualServerRoute, and returns the corresponding virtualServerRoute object, and an error if there is any. func (c *FakeVirtualServerRoutes) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.VirtualServerRoute, err error) { + emptyResult := &v1.VirtualServerRoute{} obj, err := c.Fake. - Invokes(testing.NewGetAction(virtualserverroutesResource, c.ns, name), &v1.VirtualServerRoute{}) + Invokes(testing.NewGetActionWithOptions(virtualserverroutesResource, c.ns, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.VirtualServerRoute), err } // List takes label and field selectors, and returns the list of VirtualServerRoutes that match those selectors. func (c *FakeVirtualServerRoutes) List(ctx context.Context, opts metav1.ListOptions) (result *v1.VirtualServerRouteList, err error) { + emptyResult := &v1.VirtualServerRouteList{} obj, err := c.Fake. - Invokes(testing.NewListAction(virtualserverroutesResource, virtualserverroutesKind, c.ns, opts), &v1.VirtualServerRouteList{}) + Invokes(testing.NewListActionWithOptions(virtualserverroutesResource, virtualserverroutesKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -59,40 +61,43 @@ func (c *FakeVirtualServerRoutes) List(ctx context.Context, opts metav1.ListOpti // Watch returns a watch.Interface that watches the requested virtualServerRoutes. func (c *FakeVirtualServerRoutes) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(virtualserverroutesResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(virtualserverroutesResource, c.ns, opts)) } // Create takes the representation of a virtualServerRoute and creates it. Returns the server's representation of the virtualServerRoute, and an error, if there is any. func (c *FakeVirtualServerRoutes) Create(ctx context.Context, virtualServerRoute *v1.VirtualServerRoute, opts metav1.CreateOptions) (result *v1.VirtualServerRoute, err error) { + emptyResult := &v1.VirtualServerRoute{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(virtualserverroutesResource, c.ns, virtualServerRoute), &v1.VirtualServerRoute{}) + Invokes(testing.NewCreateActionWithOptions(virtualserverroutesResource, c.ns, virtualServerRoute, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.VirtualServerRoute), err } // Update takes the representation of a virtualServerRoute and updates it. Returns the server's representation of the virtualServerRoute, and an error, if there is any. func (c *FakeVirtualServerRoutes) Update(ctx context.Context, virtualServerRoute *v1.VirtualServerRoute, opts metav1.UpdateOptions) (result *v1.VirtualServerRoute, err error) { + emptyResult := &v1.VirtualServerRoute{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(virtualserverroutesResource, c.ns, virtualServerRoute), &v1.VirtualServerRoute{}) + Invokes(testing.NewUpdateActionWithOptions(virtualserverroutesResource, c.ns, virtualServerRoute, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.VirtualServerRoute), 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 *FakeVirtualServerRoutes) UpdateStatus(ctx context.Context, virtualServerRoute *v1.VirtualServerRoute, opts metav1.UpdateOptions) (*v1.VirtualServerRoute, error) { +func (c *FakeVirtualServerRoutes) UpdateStatus(ctx context.Context, virtualServerRoute *v1.VirtualServerRoute, opts metav1.UpdateOptions) (result *v1.VirtualServerRoute, err error) { + emptyResult := &v1.VirtualServerRoute{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(virtualserverroutesResource, "status", c.ns, virtualServerRoute), &v1.VirtualServerRoute{}) + Invokes(testing.NewUpdateSubresourceActionWithOptions(virtualserverroutesResource, "status", c.ns, virtualServerRoute, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.VirtualServerRoute), err } @@ -107,7 +112,7 @@ func (c *FakeVirtualServerRoutes) Delete(ctx context.Context, name string, opts // DeleteCollection deletes a collection of objects. func (c *FakeVirtualServerRoutes) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionAction(virtualserverroutesResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(virtualserverroutesResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.VirtualServerRouteList{}) return err @@ -115,11 +120,12 @@ func (c *FakeVirtualServerRoutes) DeleteCollection(ctx context.Context, opts met // Patch applies the patch and returns the patched virtualServerRoute. func (c *FakeVirtualServerRoutes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.VirtualServerRoute, err error) { + emptyResult := &v1.VirtualServerRoute{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(virtualserverroutesResource, c.ns, name, pt, data, subresources...), &v1.VirtualServerRoute{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(virtualserverroutesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.VirtualServerRoute), err } diff --git a/pkg/client/clientset/versioned/typed/configuration/v1/globalconfiguration.go b/pkg/client/clientset/versioned/typed/configuration/v1/globalconfiguration.go index a24cdb715d..545dc537c3 100644 --- a/pkg/client/clientset/versioned/typed/configuration/v1/globalconfiguration.go +++ b/pkg/client/clientset/versioned/typed/configuration/v1/globalconfiguration.go @@ -4,14 +4,13 @@ package v1 import ( "context" - "time" v1 "github.com/nginxinc/kubernetes-ingress/pkg/apis/configuration/v1" scheme "github.com/nginxinc/kubernetes-ingress/pkg/client/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" ) // GlobalConfigurationsGetter has a method to return a GlobalConfigurationInterface. @@ -35,128 +34,18 @@ type GlobalConfigurationInterface interface { // globalConfigurations implements GlobalConfigurationInterface type globalConfigurations struct { - client rest.Interface - ns string + *gentype.ClientWithList[*v1.GlobalConfiguration, *v1.GlobalConfigurationList] } // newGlobalConfigurations returns a GlobalConfigurations func newGlobalConfigurations(c *K8sV1Client, namespace string) *globalConfigurations { return &globalConfigurations{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithList[*v1.GlobalConfiguration, *v1.GlobalConfigurationList]( + "globalconfigurations", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1.GlobalConfiguration { return &v1.GlobalConfiguration{} }, + func() *v1.GlobalConfigurationList { return &v1.GlobalConfigurationList{} }), } } - -// Get takes name of the globalConfiguration, and returns the corresponding globalConfiguration object, and an error if there is any. -func (c *globalConfigurations) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.GlobalConfiguration, err error) { - result = &v1.GlobalConfiguration{} - err = c.client.Get(). - Namespace(c.ns). - Resource("globalconfigurations"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of GlobalConfigurations that match those selectors. -func (c *globalConfigurations) List(ctx context.Context, opts metav1.ListOptions) (result *v1.GlobalConfigurationList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.GlobalConfigurationList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("globalconfigurations"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested globalConfigurations. -func (c *globalConfigurations) 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("globalconfigurations"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a globalConfiguration and creates it. Returns the server's representation of the globalConfiguration, and an error, if there is any. -func (c *globalConfigurations) Create(ctx context.Context, globalConfiguration *v1.GlobalConfiguration, opts metav1.CreateOptions) (result *v1.GlobalConfiguration, err error) { - result = &v1.GlobalConfiguration{} - err = c.client.Post(). - Namespace(c.ns). - Resource("globalconfigurations"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(globalConfiguration). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a globalConfiguration and updates it. Returns the server's representation of the globalConfiguration, and an error, if there is any. -func (c *globalConfigurations) Update(ctx context.Context, globalConfiguration *v1.GlobalConfiguration, opts metav1.UpdateOptions) (result *v1.GlobalConfiguration, err error) { - result = &v1.GlobalConfiguration{} - err = c.client.Put(). - Namespace(c.ns). - Resource("globalconfigurations"). - Name(globalConfiguration.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(globalConfiguration). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the globalConfiguration and deletes it. Returns an error if one occurs. -func (c *globalConfigurations) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("globalconfigurations"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *globalConfigurations) 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("globalconfigurations"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched globalConfiguration. -func (c *globalConfigurations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.GlobalConfiguration, err error) { - result = &v1.GlobalConfiguration{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("globalconfigurations"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/client/clientset/versioned/typed/configuration/v1/policy.go b/pkg/client/clientset/versioned/typed/configuration/v1/policy.go index 63fd8d564a..c8cdf41d84 100644 --- a/pkg/client/clientset/versioned/typed/configuration/v1/policy.go +++ b/pkg/client/clientset/versioned/typed/configuration/v1/policy.go @@ -4,14 +4,13 @@ package v1 import ( "context" - "time" v1 "github.com/nginxinc/kubernetes-ingress/pkg/apis/configuration/v1" scheme "github.com/nginxinc/kubernetes-ingress/pkg/client/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" ) // PoliciesGetter has a method to return a PolicyInterface. @@ -24,6 +23,7 @@ type PoliciesGetter interface { type PolicyInterface interface { Create(ctx context.Context, policy *v1.Policy, opts metav1.CreateOptions) (*v1.Policy, error) Update(ctx context.Context, policy *v1.Policy, opts metav1.UpdateOptions) (*v1.Policy, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, policy *v1.Policy, opts metav1.UpdateOptions) (*v1.Policy, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -36,144 +36,18 @@ type PolicyInterface interface { // policies implements PolicyInterface type policies struct { - client rest.Interface - ns string + *gentype.ClientWithList[*v1.Policy, *v1.PolicyList] } // newPolicies returns a Policies func newPolicies(c *K8sV1Client, namespace string) *policies { return &policies{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithList[*v1.Policy, *v1.PolicyList]( + "policies", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1.Policy { return &v1.Policy{} }, + func() *v1.PolicyList { return &v1.PolicyList{} }), } } - -// Get takes name of the policy, and returns the corresponding policy object, and an error if there is any. -func (c *policies) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Policy, err error) { - result = &v1.Policy{} - err = c.client.Get(). - Namespace(c.ns). - Resource("policies"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Policies that match those selectors. -func (c *policies) List(ctx context.Context, opts metav1.ListOptions) (result *v1.PolicyList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.PolicyList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("policies"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested policies. -func (c *policies) 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("policies"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a policy and creates it. Returns the server's representation of the policy, and an error, if there is any. -func (c *policies) Create(ctx context.Context, policy *v1.Policy, opts metav1.CreateOptions) (result *v1.Policy, err error) { - result = &v1.Policy{} - err = c.client.Post(). - Namespace(c.ns). - Resource("policies"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(policy). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a policy and updates it. Returns the server's representation of the policy, and an error, if there is any. -func (c *policies) Update(ctx context.Context, policy *v1.Policy, opts metav1.UpdateOptions) (result *v1.Policy, err error) { - result = &v1.Policy{} - err = c.client.Put(). - Namespace(c.ns). - Resource("policies"). - Name(policy.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(policy). - 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 *policies) UpdateStatus(ctx context.Context, policy *v1.Policy, opts metav1.UpdateOptions) (result *v1.Policy, err error) { - result = &v1.Policy{} - err = c.client.Put(). - Namespace(c.ns). - Resource("policies"). - Name(policy.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(policy). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the policy and deletes it. Returns an error if one occurs. -func (c *policies) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("policies"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *policies) 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("policies"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched policy. -func (c *policies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Policy, err error) { - result = &v1.Policy{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("policies"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/client/clientset/versioned/typed/configuration/v1/transportserver.go b/pkg/client/clientset/versioned/typed/configuration/v1/transportserver.go index 53b5788c42..e9dbb35cc9 100644 --- a/pkg/client/clientset/versioned/typed/configuration/v1/transportserver.go +++ b/pkg/client/clientset/versioned/typed/configuration/v1/transportserver.go @@ -4,14 +4,13 @@ package v1 import ( "context" - "time" v1 "github.com/nginxinc/kubernetes-ingress/pkg/apis/configuration/v1" scheme "github.com/nginxinc/kubernetes-ingress/pkg/client/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" ) // TransportServersGetter has a method to return a TransportServerInterface. @@ -24,6 +23,7 @@ type TransportServersGetter interface { type TransportServerInterface interface { Create(ctx context.Context, transportServer *v1.TransportServer, opts metav1.CreateOptions) (*v1.TransportServer, error) Update(ctx context.Context, transportServer *v1.TransportServer, opts metav1.UpdateOptions) (*v1.TransportServer, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, transportServer *v1.TransportServer, opts metav1.UpdateOptions) (*v1.TransportServer, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -36,144 +36,18 @@ type TransportServerInterface interface { // transportServers implements TransportServerInterface type transportServers struct { - client rest.Interface - ns string + *gentype.ClientWithList[*v1.TransportServer, *v1.TransportServerList] } // newTransportServers returns a TransportServers func newTransportServers(c *K8sV1Client, namespace string) *transportServers { return &transportServers{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithList[*v1.TransportServer, *v1.TransportServerList]( + "transportservers", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1.TransportServer { return &v1.TransportServer{} }, + func() *v1.TransportServerList { return &v1.TransportServerList{} }), } } - -// Get takes name of the transportServer, and returns the corresponding transportServer object, and an error if there is any. -func (c *transportServers) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.TransportServer, err error) { - result = &v1.TransportServer{} - err = c.client.Get(). - Namespace(c.ns). - Resource("transportservers"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of TransportServers that match those selectors. -func (c *transportServers) List(ctx context.Context, opts metav1.ListOptions) (result *v1.TransportServerList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.TransportServerList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("transportservers"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested transportServers. -func (c *transportServers) 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("transportservers"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a transportServer and creates it. Returns the server's representation of the transportServer, and an error, if there is any. -func (c *transportServers) Create(ctx context.Context, transportServer *v1.TransportServer, opts metav1.CreateOptions) (result *v1.TransportServer, err error) { - result = &v1.TransportServer{} - err = c.client.Post(). - Namespace(c.ns). - Resource("transportservers"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(transportServer). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a transportServer and updates it. Returns the server's representation of the transportServer, and an error, if there is any. -func (c *transportServers) Update(ctx context.Context, transportServer *v1.TransportServer, opts metav1.UpdateOptions) (result *v1.TransportServer, err error) { - result = &v1.TransportServer{} - err = c.client.Put(). - Namespace(c.ns). - Resource("transportservers"). - Name(transportServer.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(transportServer). - 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 *transportServers) UpdateStatus(ctx context.Context, transportServer *v1.TransportServer, opts metav1.UpdateOptions) (result *v1.TransportServer, err error) { - result = &v1.TransportServer{} - err = c.client.Put(). - Namespace(c.ns). - Resource("transportservers"). - Name(transportServer.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(transportServer). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the transportServer and deletes it. Returns an error if one occurs. -func (c *transportServers) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("transportservers"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *transportServers) 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("transportservers"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched transportServer. -func (c *transportServers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.TransportServer, err error) { - result = &v1.TransportServer{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("transportservers"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/client/clientset/versioned/typed/configuration/v1/virtualserver.go b/pkg/client/clientset/versioned/typed/configuration/v1/virtualserver.go index 4d9b39944a..1ba396faf6 100644 --- a/pkg/client/clientset/versioned/typed/configuration/v1/virtualserver.go +++ b/pkg/client/clientset/versioned/typed/configuration/v1/virtualserver.go @@ -4,14 +4,13 @@ package v1 import ( "context" - "time" v1 "github.com/nginxinc/kubernetes-ingress/pkg/apis/configuration/v1" scheme "github.com/nginxinc/kubernetes-ingress/pkg/client/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" ) // VirtualServersGetter has a method to return a VirtualServerInterface. @@ -24,6 +23,7 @@ type VirtualServersGetter interface { type VirtualServerInterface interface { Create(ctx context.Context, virtualServer *v1.VirtualServer, opts metav1.CreateOptions) (*v1.VirtualServer, error) Update(ctx context.Context, virtualServer *v1.VirtualServer, opts metav1.UpdateOptions) (*v1.VirtualServer, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, virtualServer *v1.VirtualServer, opts metav1.UpdateOptions) (*v1.VirtualServer, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -36,144 +36,18 @@ type VirtualServerInterface interface { // virtualServers implements VirtualServerInterface type virtualServers struct { - client rest.Interface - ns string + *gentype.ClientWithList[*v1.VirtualServer, *v1.VirtualServerList] } // newVirtualServers returns a VirtualServers func newVirtualServers(c *K8sV1Client, namespace string) *virtualServers { return &virtualServers{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithList[*v1.VirtualServer, *v1.VirtualServerList]( + "virtualservers", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1.VirtualServer { return &v1.VirtualServer{} }, + func() *v1.VirtualServerList { return &v1.VirtualServerList{} }), } } - -// Get takes name of the virtualServer, and returns the corresponding virtualServer object, and an error if there is any. -func (c *virtualServers) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.VirtualServer, err error) { - result = &v1.VirtualServer{} - err = c.client.Get(). - Namespace(c.ns). - Resource("virtualservers"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of VirtualServers that match those selectors. -func (c *virtualServers) List(ctx context.Context, opts metav1.ListOptions) (result *v1.VirtualServerList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.VirtualServerList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("virtualservers"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested virtualServers. -func (c *virtualServers) 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("virtualservers"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a virtualServer and creates it. Returns the server's representation of the virtualServer, and an error, if there is any. -func (c *virtualServers) Create(ctx context.Context, virtualServer *v1.VirtualServer, opts metav1.CreateOptions) (result *v1.VirtualServer, err error) { - result = &v1.VirtualServer{} - err = c.client.Post(). - Namespace(c.ns). - Resource("virtualservers"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(virtualServer). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a virtualServer and updates it. Returns the server's representation of the virtualServer, and an error, if there is any. -func (c *virtualServers) Update(ctx context.Context, virtualServer *v1.VirtualServer, opts metav1.UpdateOptions) (result *v1.VirtualServer, err error) { - result = &v1.VirtualServer{} - err = c.client.Put(). - Namespace(c.ns). - Resource("virtualservers"). - Name(virtualServer.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(virtualServer). - 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 *virtualServers) UpdateStatus(ctx context.Context, virtualServer *v1.VirtualServer, opts metav1.UpdateOptions) (result *v1.VirtualServer, err error) { - result = &v1.VirtualServer{} - err = c.client.Put(). - Namespace(c.ns). - Resource("virtualservers"). - Name(virtualServer.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(virtualServer). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the virtualServer and deletes it. Returns an error if one occurs. -func (c *virtualServers) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("virtualservers"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *virtualServers) 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("virtualservers"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched virtualServer. -func (c *virtualServers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.VirtualServer, err error) { - result = &v1.VirtualServer{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("virtualservers"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/client/clientset/versioned/typed/configuration/v1/virtualserverroute.go b/pkg/client/clientset/versioned/typed/configuration/v1/virtualserverroute.go index 76290fd5eb..eedc95d825 100644 --- a/pkg/client/clientset/versioned/typed/configuration/v1/virtualserverroute.go +++ b/pkg/client/clientset/versioned/typed/configuration/v1/virtualserverroute.go @@ -4,14 +4,13 @@ package v1 import ( "context" - "time" v1 "github.com/nginxinc/kubernetes-ingress/pkg/apis/configuration/v1" scheme "github.com/nginxinc/kubernetes-ingress/pkg/client/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" ) // VirtualServerRoutesGetter has a method to return a VirtualServerRouteInterface. @@ -24,6 +23,7 @@ type VirtualServerRoutesGetter interface { type VirtualServerRouteInterface interface { Create(ctx context.Context, virtualServerRoute *v1.VirtualServerRoute, opts metav1.CreateOptions) (*v1.VirtualServerRoute, error) Update(ctx context.Context, virtualServerRoute *v1.VirtualServerRoute, opts metav1.UpdateOptions) (*v1.VirtualServerRoute, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, virtualServerRoute *v1.VirtualServerRoute, opts metav1.UpdateOptions) (*v1.VirtualServerRoute, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -36,144 +36,18 @@ type VirtualServerRouteInterface interface { // virtualServerRoutes implements VirtualServerRouteInterface type virtualServerRoutes struct { - client rest.Interface - ns string + *gentype.ClientWithList[*v1.VirtualServerRoute, *v1.VirtualServerRouteList] } // newVirtualServerRoutes returns a VirtualServerRoutes func newVirtualServerRoutes(c *K8sV1Client, namespace string) *virtualServerRoutes { return &virtualServerRoutes{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithList[*v1.VirtualServerRoute, *v1.VirtualServerRouteList]( + "virtualserverroutes", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1.VirtualServerRoute { return &v1.VirtualServerRoute{} }, + func() *v1.VirtualServerRouteList { return &v1.VirtualServerRouteList{} }), } } - -// Get takes name of the virtualServerRoute, and returns the corresponding virtualServerRoute object, and an error if there is any. -func (c *virtualServerRoutes) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.VirtualServerRoute, err error) { - result = &v1.VirtualServerRoute{} - err = c.client.Get(). - Namespace(c.ns). - Resource("virtualserverroutes"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of VirtualServerRoutes that match those selectors. -func (c *virtualServerRoutes) List(ctx context.Context, opts metav1.ListOptions) (result *v1.VirtualServerRouteList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.VirtualServerRouteList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("virtualserverroutes"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested virtualServerRoutes. -func (c *virtualServerRoutes) 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("virtualserverroutes"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a virtualServerRoute and creates it. Returns the server's representation of the virtualServerRoute, and an error, if there is any. -func (c *virtualServerRoutes) Create(ctx context.Context, virtualServerRoute *v1.VirtualServerRoute, opts metav1.CreateOptions) (result *v1.VirtualServerRoute, err error) { - result = &v1.VirtualServerRoute{} - err = c.client.Post(). - Namespace(c.ns). - Resource("virtualserverroutes"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(virtualServerRoute). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a virtualServerRoute and updates it. Returns the server's representation of the virtualServerRoute, and an error, if there is any. -func (c *virtualServerRoutes) Update(ctx context.Context, virtualServerRoute *v1.VirtualServerRoute, opts metav1.UpdateOptions) (result *v1.VirtualServerRoute, err error) { - result = &v1.VirtualServerRoute{} - err = c.client.Put(). - Namespace(c.ns). - Resource("virtualserverroutes"). - Name(virtualServerRoute.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(virtualServerRoute). - 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 *virtualServerRoutes) UpdateStatus(ctx context.Context, virtualServerRoute *v1.VirtualServerRoute, opts metav1.UpdateOptions) (result *v1.VirtualServerRoute, err error) { - result = &v1.VirtualServerRoute{} - err = c.client.Put(). - Namespace(c.ns). - Resource("virtualserverroutes"). - Name(virtualServerRoute.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(virtualServerRoute). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the virtualServerRoute and deletes it. Returns an error if one occurs. -func (c *virtualServerRoutes) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("virtualserverroutes"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *virtualServerRoutes) 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("virtualserverroutes"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched virtualServerRoute. -func (c *virtualServerRoutes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.VirtualServerRoute, err error) { - result = &v1.VirtualServerRoute{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("virtualserverroutes"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/client/clientset/versioned/typed/configuration/v1alpha1/fake/fake_globalconfiguration.go b/pkg/client/clientset/versioned/typed/configuration/v1alpha1/fake/fake_globalconfiguration.go index e2aba966d1..299a15a62c 100644 --- a/pkg/client/clientset/versioned/typed/configuration/v1alpha1/fake/fake_globalconfiguration.go +++ b/pkg/client/clientset/versioned/typed/configuration/v1alpha1/fake/fake_globalconfiguration.go @@ -25,22 +25,24 @@ var globalconfigurationsKind = v1alpha1.SchemeGroupVersion.WithKind("GlobalConfi // Get takes name of the globalConfiguration, and returns the corresponding globalConfiguration object, and an error if there is any. func (c *FakeGlobalConfigurations) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.GlobalConfiguration, err error) { + emptyResult := &v1alpha1.GlobalConfiguration{} obj, err := c.Fake. - Invokes(testing.NewGetAction(globalconfigurationsResource, c.ns, name), &v1alpha1.GlobalConfiguration{}) + Invokes(testing.NewGetActionWithOptions(globalconfigurationsResource, c.ns, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.GlobalConfiguration), err } // List takes label and field selectors, and returns the list of GlobalConfigurations that match those selectors. func (c *FakeGlobalConfigurations) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.GlobalConfigurationList, err error) { + emptyResult := &v1alpha1.GlobalConfigurationList{} obj, err := c.Fake. - Invokes(testing.NewListAction(globalconfigurationsResource, globalconfigurationsKind, c.ns, opts), &v1alpha1.GlobalConfigurationList{}) + Invokes(testing.NewListActionWithOptions(globalconfigurationsResource, globalconfigurationsKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -59,28 +61,30 @@ func (c *FakeGlobalConfigurations) List(ctx context.Context, opts v1.ListOptions // Watch returns a watch.Interface that watches the requested globalConfigurations. func (c *FakeGlobalConfigurations) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(globalconfigurationsResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(globalconfigurationsResource, c.ns, opts)) } // Create takes the representation of a globalConfiguration and creates it. Returns the server's representation of the globalConfiguration, and an error, if there is any. func (c *FakeGlobalConfigurations) Create(ctx context.Context, globalConfiguration *v1alpha1.GlobalConfiguration, opts v1.CreateOptions) (result *v1alpha1.GlobalConfiguration, err error) { + emptyResult := &v1alpha1.GlobalConfiguration{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(globalconfigurationsResource, c.ns, globalConfiguration), &v1alpha1.GlobalConfiguration{}) + Invokes(testing.NewCreateActionWithOptions(globalconfigurationsResource, c.ns, globalConfiguration, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.GlobalConfiguration), err } // Update takes the representation of a globalConfiguration and updates it. Returns the server's representation of the globalConfiguration, and an error, if there is any. func (c *FakeGlobalConfigurations) Update(ctx context.Context, globalConfiguration *v1alpha1.GlobalConfiguration, opts v1.UpdateOptions) (result *v1alpha1.GlobalConfiguration, err error) { + emptyResult := &v1alpha1.GlobalConfiguration{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(globalconfigurationsResource, c.ns, globalConfiguration), &v1alpha1.GlobalConfiguration{}) + Invokes(testing.NewUpdateActionWithOptions(globalconfigurationsResource, c.ns, globalConfiguration, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.GlobalConfiguration), err } @@ -95,7 +99,7 @@ func (c *FakeGlobalConfigurations) Delete(ctx context.Context, name string, opts // DeleteCollection deletes a collection of objects. func (c *FakeGlobalConfigurations) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(globalconfigurationsResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(globalconfigurationsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.GlobalConfigurationList{}) return err @@ -103,11 +107,12 @@ func (c *FakeGlobalConfigurations) DeleteCollection(ctx context.Context, opts v1 // Patch applies the patch and returns the patched globalConfiguration. func (c *FakeGlobalConfigurations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.GlobalConfiguration, err error) { + emptyResult := &v1alpha1.GlobalConfiguration{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(globalconfigurationsResource, c.ns, name, pt, data, subresources...), &v1alpha1.GlobalConfiguration{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(globalconfigurationsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.GlobalConfiguration), err } diff --git a/pkg/client/clientset/versioned/typed/configuration/v1alpha1/fake/fake_policy.go b/pkg/client/clientset/versioned/typed/configuration/v1alpha1/fake/fake_policy.go index 9f9d0356a5..3c0ca2383a 100644 --- a/pkg/client/clientset/versioned/typed/configuration/v1alpha1/fake/fake_policy.go +++ b/pkg/client/clientset/versioned/typed/configuration/v1alpha1/fake/fake_policy.go @@ -25,22 +25,24 @@ var policiesKind = v1alpha1.SchemeGroupVersion.WithKind("Policy") // Get takes name of the policy, and returns the corresponding policy object, and an error if there is any. func (c *FakePolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.Policy, err error) { + emptyResult := &v1alpha1.Policy{} obj, err := c.Fake. - Invokes(testing.NewGetAction(policiesResource, c.ns, name), &v1alpha1.Policy{}) + Invokes(testing.NewGetActionWithOptions(policiesResource, c.ns, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.Policy), err } // List takes label and field selectors, and returns the list of Policies that match those selectors. func (c *FakePolicies) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.PolicyList, err error) { + emptyResult := &v1alpha1.PolicyList{} obj, err := c.Fake. - Invokes(testing.NewListAction(policiesResource, policiesKind, c.ns, opts), &v1alpha1.PolicyList{}) + Invokes(testing.NewListActionWithOptions(policiesResource, policiesKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -59,28 +61,30 @@ func (c *FakePolicies) List(ctx context.Context, opts v1.ListOptions) (result *v // Watch returns a watch.Interface that watches the requested policies. func (c *FakePolicies) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(policiesResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(policiesResource, c.ns, opts)) } // Create takes the representation of a policy and creates it. Returns the server's representation of the policy, and an error, if there is any. func (c *FakePolicies) Create(ctx context.Context, policy *v1alpha1.Policy, opts v1.CreateOptions) (result *v1alpha1.Policy, err error) { + emptyResult := &v1alpha1.Policy{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(policiesResource, c.ns, policy), &v1alpha1.Policy{}) + Invokes(testing.NewCreateActionWithOptions(policiesResource, c.ns, policy, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.Policy), err } // Update takes the representation of a policy and updates it. Returns the server's representation of the policy, and an error, if there is any. func (c *FakePolicies) Update(ctx context.Context, policy *v1alpha1.Policy, opts v1.UpdateOptions) (result *v1alpha1.Policy, err error) { + emptyResult := &v1alpha1.Policy{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(policiesResource, c.ns, policy), &v1alpha1.Policy{}) + Invokes(testing.NewUpdateActionWithOptions(policiesResource, c.ns, policy, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.Policy), err } @@ -95,7 +99,7 @@ func (c *FakePolicies) Delete(ctx context.Context, name string, opts v1.DeleteOp // DeleteCollection deletes a collection of objects. func (c *FakePolicies) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(policiesResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(policiesResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.PolicyList{}) return err @@ -103,11 +107,12 @@ func (c *FakePolicies) DeleteCollection(ctx context.Context, opts v1.DeleteOptio // Patch applies the patch and returns the patched policy. func (c *FakePolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Policy, err error) { + emptyResult := &v1alpha1.Policy{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(policiesResource, c.ns, name, pt, data, subresources...), &v1alpha1.Policy{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(policiesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.Policy), err } diff --git a/pkg/client/clientset/versioned/typed/configuration/v1alpha1/fake/fake_transportserver.go b/pkg/client/clientset/versioned/typed/configuration/v1alpha1/fake/fake_transportserver.go index 982dbe531f..0e6a1d93d0 100644 --- a/pkg/client/clientset/versioned/typed/configuration/v1alpha1/fake/fake_transportserver.go +++ b/pkg/client/clientset/versioned/typed/configuration/v1alpha1/fake/fake_transportserver.go @@ -25,22 +25,24 @@ var transportserversKind = v1alpha1.SchemeGroupVersion.WithKind("TransportServer // Get takes name of the transportServer, and returns the corresponding transportServer object, and an error if there is any. func (c *FakeTransportServers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.TransportServer, err error) { + emptyResult := &v1alpha1.TransportServer{} obj, err := c.Fake. - Invokes(testing.NewGetAction(transportserversResource, c.ns, name), &v1alpha1.TransportServer{}) + Invokes(testing.NewGetActionWithOptions(transportserversResource, c.ns, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.TransportServer), err } // List takes label and field selectors, and returns the list of TransportServers that match those selectors. func (c *FakeTransportServers) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.TransportServerList, err error) { + emptyResult := &v1alpha1.TransportServerList{} obj, err := c.Fake. - Invokes(testing.NewListAction(transportserversResource, transportserversKind, c.ns, opts), &v1alpha1.TransportServerList{}) + Invokes(testing.NewListActionWithOptions(transportserversResource, transportserversKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -59,40 +61,43 @@ func (c *FakeTransportServers) List(ctx context.Context, opts v1.ListOptions) (r // Watch returns a watch.Interface that watches the requested transportServers. func (c *FakeTransportServers) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(transportserversResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(transportserversResource, c.ns, opts)) } // Create takes the representation of a transportServer and creates it. Returns the server's representation of the transportServer, and an error, if there is any. func (c *FakeTransportServers) Create(ctx context.Context, transportServer *v1alpha1.TransportServer, opts v1.CreateOptions) (result *v1alpha1.TransportServer, err error) { + emptyResult := &v1alpha1.TransportServer{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(transportserversResource, c.ns, transportServer), &v1alpha1.TransportServer{}) + Invokes(testing.NewCreateActionWithOptions(transportserversResource, c.ns, transportServer, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.TransportServer), err } // Update takes the representation of a transportServer and updates it. Returns the server's representation of the transportServer, and an error, if there is any. func (c *FakeTransportServers) Update(ctx context.Context, transportServer *v1alpha1.TransportServer, opts v1.UpdateOptions) (result *v1alpha1.TransportServer, err error) { + emptyResult := &v1alpha1.TransportServer{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(transportserversResource, c.ns, transportServer), &v1alpha1.TransportServer{}) + Invokes(testing.NewUpdateActionWithOptions(transportserversResource, c.ns, transportServer, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.TransportServer), 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 *FakeTransportServers) UpdateStatus(ctx context.Context, transportServer *v1alpha1.TransportServer, opts v1.UpdateOptions) (*v1alpha1.TransportServer, error) { +func (c *FakeTransportServers) UpdateStatus(ctx context.Context, transportServer *v1alpha1.TransportServer, opts v1.UpdateOptions) (result *v1alpha1.TransportServer, err error) { + emptyResult := &v1alpha1.TransportServer{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(transportserversResource, "status", c.ns, transportServer), &v1alpha1.TransportServer{}) + Invokes(testing.NewUpdateSubresourceActionWithOptions(transportserversResource, "status", c.ns, transportServer, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.TransportServer), err } @@ -107,7 +112,7 @@ func (c *FakeTransportServers) Delete(ctx context.Context, name string, opts v1. // DeleteCollection deletes a collection of objects. func (c *FakeTransportServers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(transportserversResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(transportserversResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.TransportServerList{}) return err @@ -115,11 +120,12 @@ func (c *FakeTransportServers) DeleteCollection(ctx context.Context, opts v1.Del // Patch applies the patch and returns the patched transportServer. func (c *FakeTransportServers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.TransportServer, err error) { + emptyResult := &v1alpha1.TransportServer{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(transportserversResource, c.ns, name, pt, data, subresources...), &v1alpha1.TransportServer{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(transportserversResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.TransportServer), err } diff --git a/pkg/client/clientset/versioned/typed/configuration/v1alpha1/globalconfiguration.go b/pkg/client/clientset/versioned/typed/configuration/v1alpha1/globalconfiguration.go index 80e0eb8da6..9dd6eb3495 100644 --- a/pkg/client/clientset/versioned/typed/configuration/v1alpha1/globalconfiguration.go +++ b/pkg/client/clientset/versioned/typed/configuration/v1alpha1/globalconfiguration.go @@ -4,14 +4,13 @@ package v1alpha1 import ( "context" - "time" v1alpha1 "github.com/nginxinc/kubernetes-ingress/pkg/apis/configuration/v1alpha1" scheme "github.com/nginxinc/kubernetes-ingress/pkg/client/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" ) // GlobalConfigurationsGetter has a method to return a GlobalConfigurationInterface. @@ -35,128 +34,18 @@ type GlobalConfigurationInterface interface { // globalConfigurations implements GlobalConfigurationInterface type globalConfigurations struct { - client rest.Interface - ns string + *gentype.ClientWithList[*v1alpha1.GlobalConfiguration, *v1alpha1.GlobalConfigurationList] } // newGlobalConfigurations returns a GlobalConfigurations func newGlobalConfigurations(c *K8sV1alpha1Client, namespace string) *globalConfigurations { return &globalConfigurations{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithList[*v1alpha1.GlobalConfiguration, *v1alpha1.GlobalConfigurationList]( + "globalconfigurations", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1alpha1.GlobalConfiguration { return &v1alpha1.GlobalConfiguration{} }, + func() *v1alpha1.GlobalConfigurationList { return &v1alpha1.GlobalConfigurationList{} }), } } - -// Get takes name of the globalConfiguration, and returns the corresponding globalConfiguration object, and an error if there is any. -func (c *globalConfigurations) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.GlobalConfiguration, err error) { - result = &v1alpha1.GlobalConfiguration{} - err = c.client.Get(). - Namespace(c.ns). - Resource("globalconfigurations"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of GlobalConfigurations that match those selectors. -func (c *globalConfigurations) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.GlobalConfigurationList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.GlobalConfigurationList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("globalconfigurations"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested globalConfigurations. -func (c *globalConfigurations) 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("globalconfigurations"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a globalConfiguration and creates it. Returns the server's representation of the globalConfiguration, and an error, if there is any. -func (c *globalConfigurations) Create(ctx context.Context, globalConfiguration *v1alpha1.GlobalConfiguration, opts v1.CreateOptions) (result *v1alpha1.GlobalConfiguration, err error) { - result = &v1alpha1.GlobalConfiguration{} - err = c.client.Post(). - Namespace(c.ns). - Resource("globalconfigurations"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(globalConfiguration). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a globalConfiguration and updates it. Returns the server's representation of the globalConfiguration, and an error, if there is any. -func (c *globalConfigurations) Update(ctx context.Context, globalConfiguration *v1alpha1.GlobalConfiguration, opts v1.UpdateOptions) (result *v1alpha1.GlobalConfiguration, err error) { - result = &v1alpha1.GlobalConfiguration{} - err = c.client.Put(). - Namespace(c.ns). - Resource("globalconfigurations"). - Name(globalConfiguration.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(globalConfiguration). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the globalConfiguration and deletes it. Returns an error if one occurs. -func (c *globalConfigurations) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("globalconfigurations"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *globalConfigurations) 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("globalconfigurations"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched globalConfiguration. -func (c *globalConfigurations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.GlobalConfiguration, err error) { - result = &v1alpha1.GlobalConfiguration{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("globalconfigurations"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/client/clientset/versioned/typed/configuration/v1alpha1/policy.go b/pkg/client/clientset/versioned/typed/configuration/v1alpha1/policy.go index f90324d076..0563d4e44b 100644 --- a/pkg/client/clientset/versioned/typed/configuration/v1alpha1/policy.go +++ b/pkg/client/clientset/versioned/typed/configuration/v1alpha1/policy.go @@ -4,14 +4,13 @@ package v1alpha1 import ( "context" - "time" v1alpha1 "github.com/nginxinc/kubernetes-ingress/pkg/apis/configuration/v1alpha1" scheme "github.com/nginxinc/kubernetes-ingress/pkg/client/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" ) // PoliciesGetter has a method to return a PolicyInterface. @@ -35,128 +34,18 @@ type PolicyInterface interface { // policies implements PolicyInterface type policies struct { - client rest.Interface - ns string + *gentype.ClientWithList[*v1alpha1.Policy, *v1alpha1.PolicyList] } // newPolicies returns a Policies func newPolicies(c *K8sV1alpha1Client, namespace string) *policies { return &policies{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithList[*v1alpha1.Policy, *v1alpha1.PolicyList]( + "policies", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1alpha1.Policy { return &v1alpha1.Policy{} }, + func() *v1alpha1.PolicyList { return &v1alpha1.PolicyList{} }), } } - -// Get takes name of the policy, and returns the corresponding policy object, and an error if there is any. -func (c *policies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.Policy, err error) { - result = &v1alpha1.Policy{} - err = c.client.Get(). - Namespace(c.ns). - Resource("policies"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Policies that match those selectors. -func (c *policies) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.PolicyList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.PolicyList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("policies"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested policies. -func (c *policies) 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("policies"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a policy and creates it. Returns the server's representation of the policy, and an error, if there is any. -func (c *policies) Create(ctx context.Context, policy *v1alpha1.Policy, opts v1.CreateOptions) (result *v1alpha1.Policy, err error) { - result = &v1alpha1.Policy{} - err = c.client.Post(). - Namespace(c.ns). - Resource("policies"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(policy). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a policy and updates it. Returns the server's representation of the policy, and an error, if there is any. -func (c *policies) Update(ctx context.Context, policy *v1alpha1.Policy, opts v1.UpdateOptions) (result *v1alpha1.Policy, err error) { - result = &v1alpha1.Policy{} - err = c.client.Put(). - Namespace(c.ns). - Resource("policies"). - Name(policy.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(policy). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the policy and deletes it. Returns an error if one occurs. -func (c *policies) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("policies"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *policies) 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("policies"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched policy. -func (c *policies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Policy, err error) { - result = &v1alpha1.Policy{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("policies"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/client/clientset/versioned/typed/configuration/v1alpha1/transportserver.go b/pkg/client/clientset/versioned/typed/configuration/v1alpha1/transportserver.go index c402b9776d..156e8f25d3 100644 --- a/pkg/client/clientset/versioned/typed/configuration/v1alpha1/transportserver.go +++ b/pkg/client/clientset/versioned/typed/configuration/v1alpha1/transportserver.go @@ -4,14 +4,13 @@ package v1alpha1 import ( "context" - "time" v1alpha1 "github.com/nginxinc/kubernetes-ingress/pkg/apis/configuration/v1alpha1" scheme "github.com/nginxinc/kubernetes-ingress/pkg/client/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" ) // TransportServersGetter has a method to return a TransportServerInterface. @@ -24,6 +23,7 @@ type TransportServersGetter interface { type TransportServerInterface interface { Create(ctx context.Context, transportServer *v1alpha1.TransportServer, opts v1.CreateOptions) (*v1alpha1.TransportServer, error) Update(ctx context.Context, transportServer *v1alpha1.TransportServer, opts v1.UpdateOptions) (*v1alpha1.TransportServer, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, transportServer *v1alpha1.TransportServer, opts v1.UpdateOptions) (*v1alpha1.TransportServer, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error @@ -36,144 +36,18 @@ type TransportServerInterface interface { // transportServers implements TransportServerInterface type transportServers struct { - client rest.Interface - ns string + *gentype.ClientWithList[*v1alpha1.TransportServer, *v1alpha1.TransportServerList] } // newTransportServers returns a TransportServers func newTransportServers(c *K8sV1alpha1Client, namespace string) *transportServers { return &transportServers{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithList[*v1alpha1.TransportServer, *v1alpha1.TransportServerList]( + "transportservers", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1alpha1.TransportServer { return &v1alpha1.TransportServer{} }, + func() *v1alpha1.TransportServerList { return &v1alpha1.TransportServerList{} }), } } - -// Get takes name of the transportServer, and returns the corresponding transportServer object, and an error if there is any. -func (c *transportServers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.TransportServer, err error) { - result = &v1alpha1.TransportServer{} - err = c.client.Get(). - Namespace(c.ns). - Resource("transportservers"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of TransportServers that match those selectors. -func (c *transportServers) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.TransportServerList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.TransportServerList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("transportservers"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested transportServers. -func (c *transportServers) 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("transportservers"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a transportServer and creates it. Returns the server's representation of the transportServer, and an error, if there is any. -func (c *transportServers) Create(ctx context.Context, transportServer *v1alpha1.TransportServer, opts v1.CreateOptions) (result *v1alpha1.TransportServer, err error) { - result = &v1alpha1.TransportServer{} - err = c.client.Post(). - Namespace(c.ns). - Resource("transportservers"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(transportServer). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a transportServer and updates it. Returns the server's representation of the transportServer, and an error, if there is any. -func (c *transportServers) Update(ctx context.Context, transportServer *v1alpha1.TransportServer, opts v1.UpdateOptions) (result *v1alpha1.TransportServer, err error) { - result = &v1alpha1.TransportServer{} - err = c.client.Put(). - Namespace(c.ns). - Resource("transportservers"). - Name(transportServer.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(transportServer). - 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 *transportServers) UpdateStatus(ctx context.Context, transportServer *v1alpha1.TransportServer, opts v1.UpdateOptions) (result *v1alpha1.TransportServer, err error) { - result = &v1alpha1.TransportServer{} - err = c.client.Put(). - Namespace(c.ns). - Resource("transportservers"). - Name(transportServer.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(transportServer). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the transportServer and deletes it. Returns an error if one occurs. -func (c *transportServers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("transportservers"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *transportServers) 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("transportservers"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched transportServer. -func (c *transportServers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.TransportServer, err error) { - result = &v1alpha1.TransportServer{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("transportservers"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/client/clientset/versioned/typed/dos/v1beta1/dosprotectedresource.go b/pkg/client/clientset/versioned/typed/dos/v1beta1/dosprotectedresource.go index 15fdb8c655..d802d9ad05 100644 --- a/pkg/client/clientset/versioned/typed/dos/v1beta1/dosprotectedresource.go +++ b/pkg/client/clientset/versioned/typed/dos/v1beta1/dosprotectedresource.go @@ -4,14 +4,13 @@ package v1beta1 import ( "context" - "time" v1beta1 "github.com/nginxinc/kubernetes-ingress/pkg/apis/dos/v1beta1" scheme "github.com/nginxinc/kubernetes-ingress/pkg/client/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" ) // DosProtectedResourcesGetter has a method to return a DosProtectedResourceInterface. @@ -35,128 +34,18 @@ type DosProtectedResourceInterface interface { // dosProtectedResources implements DosProtectedResourceInterface type dosProtectedResources struct { - client rest.Interface - ns string + *gentype.ClientWithList[*v1beta1.DosProtectedResource, *v1beta1.DosProtectedResourceList] } // newDosProtectedResources returns a DosProtectedResources func newDosProtectedResources(c *AppprotectdosV1beta1Client, namespace string) *dosProtectedResources { return &dosProtectedResources{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithList[*v1beta1.DosProtectedResource, *v1beta1.DosProtectedResourceList]( + "dosprotectedresources", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1beta1.DosProtectedResource { return &v1beta1.DosProtectedResource{} }, + func() *v1beta1.DosProtectedResourceList { return &v1beta1.DosProtectedResourceList{} }), } } - -// Get takes name of the dosProtectedResource, and returns the corresponding dosProtectedResource object, and an error if there is any. -func (c *dosProtectedResources) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.DosProtectedResource, err error) { - result = &v1beta1.DosProtectedResource{} - err = c.client.Get(). - Namespace(c.ns). - Resource("dosprotectedresources"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of DosProtectedResources that match those selectors. -func (c *dosProtectedResources) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.DosProtectedResourceList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.DosProtectedResourceList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("dosprotectedresources"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested dosProtectedResources. -func (c *dosProtectedResources) 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("dosprotectedresources"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a dosProtectedResource and creates it. Returns the server's representation of the dosProtectedResource, and an error, if there is any. -func (c *dosProtectedResources) Create(ctx context.Context, dosProtectedResource *v1beta1.DosProtectedResource, opts v1.CreateOptions) (result *v1beta1.DosProtectedResource, err error) { - result = &v1beta1.DosProtectedResource{} - err = c.client.Post(). - Namespace(c.ns). - Resource("dosprotectedresources"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(dosProtectedResource). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a dosProtectedResource and updates it. Returns the server's representation of the dosProtectedResource, and an error, if there is any. -func (c *dosProtectedResources) Update(ctx context.Context, dosProtectedResource *v1beta1.DosProtectedResource, opts v1.UpdateOptions) (result *v1beta1.DosProtectedResource, err error) { - result = &v1beta1.DosProtectedResource{} - err = c.client.Put(). - Namespace(c.ns). - Resource("dosprotectedresources"). - Name(dosProtectedResource.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(dosProtectedResource). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the dosProtectedResource and deletes it. Returns an error if one occurs. -func (c *dosProtectedResources) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("dosprotectedresources"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *dosProtectedResources) 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("dosprotectedresources"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched dosProtectedResource. -func (c *dosProtectedResources) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.DosProtectedResource, err error) { - result = &v1beta1.DosProtectedResource{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("dosprotectedresources"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/client/clientset/versioned/typed/dos/v1beta1/fake/fake_dosprotectedresource.go b/pkg/client/clientset/versioned/typed/dos/v1beta1/fake/fake_dosprotectedresource.go index 6c76137c15..94e6709c0c 100644 --- a/pkg/client/clientset/versioned/typed/dos/v1beta1/fake/fake_dosprotectedresource.go +++ b/pkg/client/clientset/versioned/typed/dos/v1beta1/fake/fake_dosprotectedresource.go @@ -25,22 +25,24 @@ var dosprotectedresourcesKind = v1beta1.SchemeGroupVersion.WithKind("DosProtecte // Get takes name of the dosProtectedResource, and returns the corresponding dosProtectedResource object, and an error if there is any. func (c *FakeDosProtectedResources) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.DosProtectedResource, err error) { + emptyResult := &v1beta1.DosProtectedResource{} obj, err := c.Fake. - Invokes(testing.NewGetAction(dosprotectedresourcesResource, c.ns, name), &v1beta1.DosProtectedResource{}) + Invokes(testing.NewGetActionWithOptions(dosprotectedresourcesResource, c.ns, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.DosProtectedResource), err } // List takes label and field selectors, and returns the list of DosProtectedResources that match those selectors. func (c *FakeDosProtectedResources) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.DosProtectedResourceList, err error) { + emptyResult := &v1beta1.DosProtectedResourceList{} obj, err := c.Fake. - Invokes(testing.NewListAction(dosprotectedresourcesResource, dosprotectedresourcesKind, c.ns, opts), &v1beta1.DosProtectedResourceList{}) + Invokes(testing.NewListActionWithOptions(dosprotectedresourcesResource, dosprotectedresourcesKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -59,28 +61,30 @@ func (c *FakeDosProtectedResources) List(ctx context.Context, opts v1.ListOption // Watch returns a watch.Interface that watches the requested dosProtectedResources. func (c *FakeDosProtectedResources) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(dosprotectedresourcesResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(dosprotectedresourcesResource, c.ns, opts)) } // Create takes the representation of a dosProtectedResource and creates it. Returns the server's representation of the dosProtectedResource, and an error, if there is any. func (c *FakeDosProtectedResources) Create(ctx context.Context, dosProtectedResource *v1beta1.DosProtectedResource, opts v1.CreateOptions) (result *v1beta1.DosProtectedResource, err error) { + emptyResult := &v1beta1.DosProtectedResource{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(dosprotectedresourcesResource, c.ns, dosProtectedResource), &v1beta1.DosProtectedResource{}) + Invokes(testing.NewCreateActionWithOptions(dosprotectedresourcesResource, c.ns, dosProtectedResource, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.DosProtectedResource), err } // Update takes the representation of a dosProtectedResource and updates it. Returns the server's representation of the dosProtectedResource, and an error, if there is any. func (c *FakeDosProtectedResources) Update(ctx context.Context, dosProtectedResource *v1beta1.DosProtectedResource, opts v1.UpdateOptions) (result *v1beta1.DosProtectedResource, err error) { + emptyResult := &v1beta1.DosProtectedResource{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(dosprotectedresourcesResource, c.ns, dosProtectedResource), &v1beta1.DosProtectedResource{}) + Invokes(testing.NewUpdateActionWithOptions(dosprotectedresourcesResource, c.ns, dosProtectedResource, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.DosProtectedResource), err } @@ -95,7 +99,7 @@ func (c *FakeDosProtectedResources) Delete(ctx context.Context, name string, opt // DeleteCollection deletes a collection of objects. func (c *FakeDosProtectedResources) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(dosprotectedresourcesResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(dosprotectedresourcesResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.DosProtectedResourceList{}) return err @@ -103,11 +107,12 @@ func (c *FakeDosProtectedResources) DeleteCollection(ctx context.Context, opts v // Patch applies the patch and returns the patched dosProtectedResource. func (c *FakeDosProtectedResources) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.DosProtectedResource, err error) { + emptyResult := &v1beta1.DosProtectedResource{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(dosprotectedresourcesResource, c.ns, name, pt, data, subresources...), &v1beta1.DosProtectedResource{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(dosprotectedresourcesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.DosProtectedResource), err } diff --git a/pkg/client/clientset/versioned/typed/externaldns/v1/dnsendpoint.go b/pkg/client/clientset/versioned/typed/externaldns/v1/dnsendpoint.go index a90773de76..35dee754f7 100644 --- a/pkg/client/clientset/versioned/typed/externaldns/v1/dnsendpoint.go +++ b/pkg/client/clientset/versioned/typed/externaldns/v1/dnsendpoint.go @@ -4,14 +4,13 @@ package v1 import ( "context" - "time" v1 "github.com/nginxinc/kubernetes-ingress/pkg/apis/externaldns/v1" scheme "github.com/nginxinc/kubernetes-ingress/pkg/client/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" ) // DNSEndpointsGetter has a method to return a DNSEndpointInterface. @@ -24,6 +23,7 @@ type DNSEndpointsGetter interface { type DNSEndpointInterface interface { Create(ctx context.Context, dNSEndpoint *v1.DNSEndpoint, opts metav1.CreateOptions) (*v1.DNSEndpoint, error) Update(ctx context.Context, dNSEndpoint *v1.DNSEndpoint, opts metav1.UpdateOptions) (*v1.DNSEndpoint, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, dNSEndpoint *v1.DNSEndpoint, opts metav1.UpdateOptions) (*v1.DNSEndpoint, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -36,144 +36,18 @@ type DNSEndpointInterface interface { // dNSEndpoints implements DNSEndpointInterface type dNSEndpoints struct { - client rest.Interface - ns string + *gentype.ClientWithList[*v1.DNSEndpoint, *v1.DNSEndpointList] } // newDNSEndpoints returns a DNSEndpoints func newDNSEndpoints(c *ExternaldnsV1Client, namespace string) *dNSEndpoints { return &dNSEndpoints{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithList[*v1.DNSEndpoint, *v1.DNSEndpointList]( + "dnsendpoints", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1.DNSEndpoint { return &v1.DNSEndpoint{} }, + func() *v1.DNSEndpointList { return &v1.DNSEndpointList{} }), } } - -// Get takes name of the dNSEndpoint, and returns the corresponding dNSEndpoint object, and an error if there is any. -func (c *dNSEndpoints) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.DNSEndpoint, err error) { - result = &v1.DNSEndpoint{} - err = c.client.Get(). - Namespace(c.ns). - Resource("dnsendpoints"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of DNSEndpoints that match those selectors. -func (c *dNSEndpoints) List(ctx context.Context, opts metav1.ListOptions) (result *v1.DNSEndpointList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.DNSEndpointList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("dnsendpoints"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested dNSEndpoints. -func (c *dNSEndpoints) 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("dnsendpoints"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a dNSEndpoint and creates it. Returns the server's representation of the dNSEndpoint, and an error, if there is any. -func (c *dNSEndpoints) Create(ctx context.Context, dNSEndpoint *v1.DNSEndpoint, opts metav1.CreateOptions) (result *v1.DNSEndpoint, err error) { - result = &v1.DNSEndpoint{} - err = c.client.Post(). - Namespace(c.ns). - Resource("dnsendpoints"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(dNSEndpoint). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a dNSEndpoint and updates it. Returns the server's representation of the dNSEndpoint, and an error, if there is any. -func (c *dNSEndpoints) Update(ctx context.Context, dNSEndpoint *v1.DNSEndpoint, opts metav1.UpdateOptions) (result *v1.DNSEndpoint, err error) { - result = &v1.DNSEndpoint{} - err = c.client.Put(). - Namespace(c.ns). - Resource("dnsendpoints"). - Name(dNSEndpoint.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(dNSEndpoint). - 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 *dNSEndpoints) UpdateStatus(ctx context.Context, dNSEndpoint *v1.DNSEndpoint, opts metav1.UpdateOptions) (result *v1.DNSEndpoint, err error) { - result = &v1.DNSEndpoint{} - err = c.client.Put(). - Namespace(c.ns). - Resource("dnsendpoints"). - Name(dNSEndpoint.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(dNSEndpoint). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the dNSEndpoint and deletes it. Returns an error if one occurs. -func (c *dNSEndpoints) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("dnsendpoints"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *dNSEndpoints) 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("dnsendpoints"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched dNSEndpoint. -func (c *dNSEndpoints) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.DNSEndpoint, err error) { - result = &v1.DNSEndpoint{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("dnsendpoints"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/client/clientset/versioned/typed/externaldns/v1/fake/fake_dnsendpoint.go b/pkg/client/clientset/versioned/typed/externaldns/v1/fake/fake_dnsendpoint.go index 702442c079..ea34889a0f 100644 --- a/pkg/client/clientset/versioned/typed/externaldns/v1/fake/fake_dnsendpoint.go +++ b/pkg/client/clientset/versioned/typed/externaldns/v1/fake/fake_dnsendpoint.go @@ -25,22 +25,24 @@ var dnsendpointsKind = v1.SchemeGroupVersion.WithKind("DNSEndpoint") // Get takes name of the dNSEndpoint, and returns the corresponding dNSEndpoint object, and an error if there is any. func (c *FakeDNSEndpoints) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.DNSEndpoint, err error) { + emptyResult := &v1.DNSEndpoint{} obj, err := c.Fake. - Invokes(testing.NewGetAction(dnsendpointsResource, c.ns, name), &v1.DNSEndpoint{}) + Invokes(testing.NewGetActionWithOptions(dnsendpointsResource, c.ns, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.DNSEndpoint), err } // List takes label and field selectors, and returns the list of DNSEndpoints that match those selectors. func (c *FakeDNSEndpoints) List(ctx context.Context, opts metav1.ListOptions) (result *v1.DNSEndpointList, err error) { + emptyResult := &v1.DNSEndpointList{} obj, err := c.Fake. - Invokes(testing.NewListAction(dnsendpointsResource, dnsendpointsKind, c.ns, opts), &v1.DNSEndpointList{}) + Invokes(testing.NewListActionWithOptions(dnsendpointsResource, dnsendpointsKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -59,40 +61,43 @@ func (c *FakeDNSEndpoints) List(ctx context.Context, opts metav1.ListOptions) (r // Watch returns a watch.Interface that watches the requested dNSEndpoints. func (c *FakeDNSEndpoints) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(dnsendpointsResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(dnsendpointsResource, c.ns, opts)) } // Create takes the representation of a dNSEndpoint and creates it. Returns the server's representation of the dNSEndpoint, and an error, if there is any. func (c *FakeDNSEndpoints) Create(ctx context.Context, dNSEndpoint *v1.DNSEndpoint, opts metav1.CreateOptions) (result *v1.DNSEndpoint, err error) { + emptyResult := &v1.DNSEndpoint{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(dnsendpointsResource, c.ns, dNSEndpoint), &v1.DNSEndpoint{}) + Invokes(testing.NewCreateActionWithOptions(dnsendpointsResource, c.ns, dNSEndpoint, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.DNSEndpoint), err } // Update takes the representation of a dNSEndpoint and updates it. Returns the server's representation of the dNSEndpoint, and an error, if there is any. func (c *FakeDNSEndpoints) Update(ctx context.Context, dNSEndpoint *v1.DNSEndpoint, opts metav1.UpdateOptions) (result *v1.DNSEndpoint, err error) { + emptyResult := &v1.DNSEndpoint{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(dnsendpointsResource, c.ns, dNSEndpoint), &v1.DNSEndpoint{}) + Invokes(testing.NewUpdateActionWithOptions(dnsendpointsResource, c.ns, dNSEndpoint, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.DNSEndpoint), 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 *FakeDNSEndpoints) UpdateStatus(ctx context.Context, dNSEndpoint *v1.DNSEndpoint, opts metav1.UpdateOptions) (*v1.DNSEndpoint, error) { +func (c *FakeDNSEndpoints) UpdateStatus(ctx context.Context, dNSEndpoint *v1.DNSEndpoint, opts metav1.UpdateOptions) (result *v1.DNSEndpoint, err error) { + emptyResult := &v1.DNSEndpoint{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(dnsendpointsResource, "status", c.ns, dNSEndpoint), &v1.DNSEndpoint{}) + Invokes(testing.NewUpdateSubresourceActionWithOptions(dnsendpointsResource, "status", c.ns, dNSEndpoint, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.DNSEndpoint), err } @@ -107,7 +112,7 @@ func (c *FakeDNSEndpoints) Delete(ctx context.Context, name string, opts metav1. // DeleteCollection deletes a collection of objects. func (c *FakeDNSEndpoints) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionAction(dnsendpointsResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(dnsendpointsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.DNSEndpointList{}) return err @@ -115,11 +120,12 @@ func (c *FakeDNSEndpoints) DeleteCollection(ctx context.Context, opts metav1.Del // Patch applies the patch and returns the patched dNSEndpoint. func (c *FakeDNSEndpoints) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.DNSEndpoint, err error) { + emptyResult := &v1.DNSEndpoint{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(dnsendpointsResource, c.ns, name, pt, data, subresources...), &v1.DNSEndpoint{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(dnsendpointsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.DNSEndpoint), err } diff --git a/pkg/client/informers/externalversions/factory.go b/pkg/client/informers/externalversions/factory.go index 5520b43717..225ab95dbc 100644 --- a/pkg/client/informers/externalversions/factory.go +++ b/pkg/client/informers/externalversions/factory.go @@ -214,6 +214,7 @@ type SharedInformerFactory interface { // Start initializes all requested informers. They are handled in goroutines // which run until the stop channel gets closed. + // Warning: Start does not block. When run in a go-routine, it will race with a later WaitForCacheSync. Start(stopCh <-chan struct{}) // Shutdown marks a factory as shutting down. At that point no new diff --git a/pkg/client/listers/configuration/v1/globalconfiguration.go b/pkg/client/listers/configuration/v1/globalconfiguration.go index 6c7a2f99ad..6506de74a8 100644 --- a/pkg/client/listers/configuration/v1/globalconfiguration.go +++ b/pkg/client/listers/configuration/v1/globalconfiguration.go @@ -4,8 +4,8 @@ package v1 import ( v1 "github.com/nginxinc/kubernetes-ingress/pkg/apis/configuration/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -22,25 +22,17 @@ type GlobalConfigurationLister interface { // globalConfigurationLister implements the GlobalConfigurationLister interface. type globalConfigurationLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.GlobalConfiguration] } // NewGlobalConfigurationLister returns a new GlobalConfigurationLister. func NewGlobalConfigurationLister(indexer cache.Indexer) GlobalConfigurationLister { - return &globalConfigurationLister{indexer: indexer} -} - -// List lists all GlobalConfigurations in the indexer. -func (s *globalConfigurationLister) List(selector labels.Selector) (ret []*v1.GlobalConfiguration, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.GlobalConfiguration)) - }) - return ret, err + return &globalConfigurationLister{listers.New[*v1.GlobalConfiguration](indexer, v1.Resource("globalconfiguration"))} } // GlobalConfigurations returns an object that can list and get GlobalConfigurations. func (s *globalConfigurationLister) GlobalConfigurations(namespace string) GlobalConfigurationNamespaceLister { - return globalConfigurationNamespaceLister{indexer: s.indexer, namespace: namespace} + return globalConfigurationNamespaceLister{listers.NewNamespaced[*v1.GlobalConfiguration](s.ResourceIndexer, namespace)} } // GlobalConfigurationNamespaceLister helps list and get GlobalConfigurations. @@ -58,26 +50,5 @@ type GlobalConfigurationNamespaceLister interface { // globalConfigurationNamespaceLister implements the GlobalConfigurationNamespaceLister // interface. type globalConfigurationNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all GlobalConfigurations in the indexer for a given namespace. -func (s globalConfigurationNamespaceLister) List(selector labels.Selector) (ret []*v1.GlobalConfiguration, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1.GlobalConfiguration)) - }) - return ret, err -} - -// Get retrieves the GlobalConfiguration from the indexer for a given namespace and name. -func (s globalConfigurationNamespaceLister) Get(name string) (*v1.GlobalConfiguration, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("globalconfiguration"), name) - } - return obj.(*v1.GlobalConfiguration), nil + listers.ResourceIndexer[*v1.GlobalConfiguration] } diff --git a/pkg/client/listers/configuration/v1/policy.go b/pkg/client/listers/configuration/v1/policy.go index 9d58b364e4..ff08fb90ce 100644 --- a/pkg/client/listers/configuration/v1/policy.go +++ b/pkg/client/listers/configuration/v1/policy.go @@ -4,8 +4,8 @@ package v1 import ( v1 "github.com/nginxinc/kubernetes-ingress/pkg/apis/configuration/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -22,25 +22,17 @@ type PolicyLister interface { // policyLister implements the PolicyLister interface. type policyLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.Policy] } // NewPolicyLister returns a new PolicyLister. func NewPolicyLister(indexer cache.Indexer) PolicyLister { - return &policyLister{indexer: indexer} -} - -// List lists all Policies in the indexer. -func (s *policyLister) List(selector labels.Selector) (ret []*v1.Policy, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.Policy)) - }) - return ret, err + return &policyLister{listers.New[*v1.Policy](indexer, v1.Resource("policy"))} } // Policies returns an object that can list and get Policies. func (s *policyLister) Policies(namespace string) PolicyNamespaceLister { - return policyNamespaceLister{indexer: s.indexer, namespace: namespace} + return policyNamespaceLister{listers.NewNamespaced[*v1.Policy](s.ResourceIndexer, namespace)} } // PolicyNamespaceLister helps list and get Policies. @@ -58,26 +50,5 @@ type PolicyNamespaceLister interface { // policyNamespaceLister implements the PolicyNamespaceLister // interface. type policyNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all Policies in the indexer for a given namespace. -func (s policyNamespaceLister) List(selector labels.Selector) (ret []*v1.Policy, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1.Policy)) - }) - return ret, err -} - -// Get retrieves the Policy from the indexer for a given namespace and name. -func (s policyNamespaceLister) Get(name string) (*v1.Policy, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("policy"), name) - } - return obj.(*v1.Policy), nil + listers.ResourceIndexer[*v1.Policy] } diff --git a/pkg/client/listers/configuration/v1/transportserver.go b/pkg/client/listers/configuration/v1/transportserver.go index f943f558bc..fff2207c95 100644 --- a/pkg/client/listers/configuration/v1/transportserver.go +++ b/pkg/client/listers/configuration/v1/transportserver.go @@ -4,8 +4,8 @@ package v1 import ( v1 "github.com/nginxinc/kubernetes-ingress/pkg/apis/configuration/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -22,25 +22,17 @@ type TransportServerLister interface { // transportServerLister implements the TransportServerLister interface. type transportServerLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.TransportServer] } // NewTransportServerLister returns a new TransportServerLister. func NewTransportServerLister(indexer cache.Indexer) TransportServerLister { - return &transportServerLister{indexer: indexer} -} - -// List lists all TransportServers in the indexer. -func (s *transportServerLister) List(selector labels.Selector) (ret []*v1.TransportServer, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.TransportServer)) - }) - return ret, err + return &transportServerLister{listers.New[*v1.TransportServer](indexer, v1.Resource("transportserver"))} } // TransportServers returns an object that can list and get TransportServers. func (s *transportServerLister) TransportServers(namespace string) TransportServerNamespaceLister { - return transportServerNamespaceLister{indexer: s.indexer, namespace: namespace} + return transportServerNamespaceLister{listers.NewNamespaced[*v1.TransportServer](s.ResourceIndexer, namespace)} } // TransportServerNamespaceLister helps list and get TransportServers. @@ -58,26 +50,5 @@ type TransportServerNamespaceLister interface { // transportServerNamespaceLister implements the TransportServerNamespaceLister // interface. type transportServerNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all TransportServers in the indexer for a given namespace. -func (s transportServerNamespaceLister) List(selector labels.Selector) (ret []*v1.TransportServer, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1.TransportServer)) - }) - return ret, err -} - -// Get retrieves the TransportServer from the indexer for a given namespace and name. -func (s transportServerNamespaceLister) Get(name string) (*v1.TransportServer, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("transportserver"), name) - } - return obj.(*v1.TransportServer), nil + listers.ResourceIndexer[*v1.TransportServer] } diff --git a/pkg/client/listers/configuration/v1/virtualserver.go b/pkg/client/listers/configuration/v1/virtualserver.go index 024193000f..e50307e91d 100644 --- a/pkg/client/listers/configuration/v1/virtualserver.go +++ b/pkg/client/listers/configuration/v1/virtualserver.go @@ -4,8 +4,8 @@ package v1 import ( v1 "github.com/nginxinc/kubernetes-ingress/pkg/apis/configuration/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -22,25 +22,17 @@ type VirtualServerLister interface { // virtualServerLister implements the VirtualServerLister interface. type virtualServerLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.VirtualServer] } // NewVirtualServerLister returns a new VirtualServerLister. func NewVirtualServerLister(indexer cache.Indexer) VirtualServerLister { - return &virtualServerLister{indexer: indexer} -} - -// List lists all VirtualServers in the indexer. -func (s *virtualServerLister) List(selector labels.Selector) (ret []*v1.VirtualServer, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.VirtualServer)) - }) - return ret, err + return &virtualServerLister{listers.New[*v1.VirtualServer](indexer, v1.Resource("virtualserver"))} } // VirtualServers returns an object that can list and get VirtualServers. func (s *virtualServerLister) VirtualServers(namespace string) VirtualServerNamespaceLister { - return virtualServerNamespaceLister{indexer: s.indexer, namespace: namespace} + return virtualServerNamespaceLister{listers.NewNamespaced[*v1.VirtualServer](s.ResourceIndexer, namespace)} } // VirtualServerNamespaceLister helps list and get VirtualServers. @@ -58,26 +50,5 @@ type VirtualServerNamespaceLister interface { // virtualServerNamespaceLister implements the VirtualServerNamespaceLister // interface. type virtualServerNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all VirtualServers in the indexer for a given namespace. -func (s virtualServerNamespaceLister) List(selector labels.Selector) (ret []*v1.VirtualServer, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1.VirtualServer)) - }) - return ret, err -} - -// Get retrieves the VirtualServer from the indexer for a given namespace and name. -func (s virtualServerNamespaceLister) Get(name string) (*v1.VirtualServer, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("virtualserver"), name) - } - return obj.(*v1.VirtualServer), nil + listers.ResourceIndexer[*v1.VirtualServer] } diff --git a/pkg/client/listers/configuration/v1/virtualserverroute.go b/pkg/client/listers/configuration/v1/virtualserverroute.go index 5060282cdf..edf8663957 100644 --- a/pkg/client/listers/configuration/v1/virtualserverroute.go +++ b/pkg/client/listers/configuration/v1/virtualserverroute.go @@ -4,8 +4,8 @@ package v1 import ( v1 "github.com/nginxinc/kubernetes-ingress/pkg/apis/configuration/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -22,25 +22,17 @@ type VirtualServerRouteLister interface { // virtualServerRouteLister implements the VirtualServerRouteLister interface. type virtualServerRouteLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.VirtualServerRoute] } // NewVirtualServerRouteLister returns a new VirtualServerRouteLister. func NewVirtualServerRouteLister(indexer cache.Indexer) VirtualServerRouteLister { - return &virtualServerRouteLister{indexer: indexer} -} - -// List lists all VirtualServerRoutes in the indexer. -func (s *virtualServerRouteLister) List(selector labels.Selector) (ret []*v1.VirtualServerRoute, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.VirtualServerRoute)) - }) - return ret, err + return &virtualServerRouteLister{listers.New[*v1.VirtualServerRoute](indexer, v1.Resource("virtualserverroute"))} } // VirtualServerRoutes returns an object that can list and get VirtualServerRoutes. func (s *virtualServerRouteLister) VirtualServerRoutes(namespace string) VirtualServerRouteNamespaceLister { - return virtualServerRouteNamespaceLister{indexer: s.indexer, namespace: namespace} + return virtualServerRouteNamespaceLister{listers.NewNamespaced[*v1.VirtualServerRoute](s.ResourceIndexer, namespace)} } // VirtualServerRouteNamespaceLister helps list and get VirtualServerRoutes. @@ -58,26 +50,5 @@ type VirtualServerRouteNamespaceLister interface { // virtualServerRouteNamespaceLister implements the VirtualServerRouteNamespaceLister // interface. type virtualServerRouteNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all VirtualServerRoutes in the indexer for a given namespace. -func (s virtualServerRouteNamespaceLister) List(selector labels.Selector) (ret []*v1.VirtualServerRoute, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1.VirtualServerRoute)) - }) - return ret, err -} - -// Get retrieves the VirtualServerRoute from the indexer for a given namespace and name. -func (s virtualServerRouteNamespaceLister) Get(name string) (*v1.VirtualServerRoute, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("virtualserverroute"), name) - } - return obj.(*v1.VirtualServerRoute), nil + listers.ResourceIndexer[*v1.VirtualServerRoute] } diff --git a/pkg/client/listers/configuration/v1alpha1/globalconfiguration.go b/pkg/client/listers/configuration/v1alpha1/globalconfiguration.go index 5401f6a3b8..4f25150865 100644 --- a/pkg/client/listers/configuration/v1alpha1/globalconfiguration.go +++ b/pkg/client/listers/configuration/v1alpha1/globalconfiguration.go @@ -4,8 +4,8 @@ package v1alpha1 import ( v1alpha1 "github.com/nginxinc/kubernetes-ingress/pkg/apis/configuration/v1alpha1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -22,25 +22,17 @@ type GlobalConfigurationLister interface { // globalConfigurationLister implements the GlobalConfigurationLister interface. type globalConfigurationLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1alpha1.GlobalConfiguration] } // NewGlobalConfigurationLister returns a new GlobalConfigurationLister. func NewGlobalConfigurationLister(indexer cache.Indexer) GlobalConfigurationLister { - return &globalConfigurationLister{indexer: indexer} -} - -// List lists all GlobalConfigurations in the indexer. -func (s *globalConfigurationLister) List(selector labels.Selector) (ret []*v1alpha1.GlobalConfiguration, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.GlobalConfiguration)) - }) - return ret, err + return &globalConfigurationLister{listers.New[*v1alpha1.GlobalConfiguration](indexer, v1alpha1.Resource("globalconfiguration"))} } // GlobalConfigurations returns an object that can list and get GlobalConfigurations. func (s *globalConfigurationLister) GlobalConfigurations(namespace string) GlobalConfigurationNamespaceLister { - return globalConfigurationNamespaceLister{indexer: s.indexer, namespace: namespace} + return globalConfigurationNamespaceLister{listers.NewNamespaced[*v1alpha1.GlobalConfiguration](s.ResourceIndexer, namespace)} } // GlobalConfigurationNamespaceLister helps list and get GlobalConfigurations. @@ -58,26 +50,5 @@ type GlobalConfigurationNamespaceLister interface { // globalConfigurationNamespaceLister implements the GlobalConfigurationNamespaceLister // interface. type globalConfigurationNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all GlobalConfigurations in the indexer for a given namespace. -func (s globalConfigurationNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.GlobalConfiguration, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.GlobalConfiguration)) - }) - return ret, err -} - -// Get retrieves the GlobalConfiguration from the indexer for a given namespace and name. -func (s globalConfigurationNamespaceLister) Get(name string) (*v1alpha1.GlobalConfiguration, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha1.Resource("globalconfiguration"), name) - } - return obj.(*v1alpha1.GlobalConfiguration), nil + listers.ResourceIndexer[*v1alpha1.GlobalConfiguration] } diff --git a/pkg/client/listers/configuration/v1alpha1/policy.go b/pkg/client/listers/configuration/v1alpha1/policy.go index 8034a5d068..a43388c2ac 100644 --- a/pkg/client/listers/configuration/v1alpha1/policy.go +++ b/pkg/client/listers/configuration/v1alpha1/policy.go @@ -4,8 +4,8 @@ package v1alpha1 import ( v1alpha1 "github.com/nginxinc/kubernetes-ingress/pkg/apis/configuration/v1alpha1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -22,25 +22,17 @@ type PolicyLister interface { // policyLister implements the PolicyLister interface. type policyLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1alpha1.Policy] } // NewPolicyLister returns a new PolicyLister. func NewPolicyLister(indexer cache.Indexer) PolicyLister { - return &policyLister{indexer: indexer} -} - -// List lists all Policies in the indexer. -func (s *policyLister) List(selector labels.Selector) (ret []*v1alpha1.Policy, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.Policy)) - }) - return ret, err + return &policyLister{listers.New[*v1alpha1.Policy](indexer, v1alpha1.Resource("policy"))} } // Policies returns an object that can list and get Policies. func (s *policyLister) Policies(namespace string) PolicyNamespaceLister { - return policyNamespaceLister{indexer: s.indexer, namespace: namespace} + return policyNamespaceLister{listers.NewNamespaced[*v1alpha1.Policy](s.ResourceIndexer, namespace)} } // PolicyNamespaceLister helps list and get Policies. @@ -58,26 +50,5 @@ type PolicyNamespaceLister interface { // policyNamespaceLister implements the PolicyNamespaceLister // interface. type policyNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all Policies in the indexer for a given namespace. -func (s policyNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.Policy, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.Policy)) - }) - return ret, err -} - -// Get retrieves the Policy from the indexer for a given namespace and name. -func (s policyNamespaceLister) Get(name string) (*v1alpha1.Policy, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha1.Resource("policy"), name) - } - return obj.(*v1alpha1.Policy), nil + listers.ResourceIndexer[*v1alpha1.Policy] } diff --git a/pkg/client/listers/configuration/v1alpha1/transportserver.go b/pkg/client/listers/configuration/v1alpha1/transportserver.go index 1e207cd1cd..c4f2b07cac 100644 --- a/pkg/client/listers/configuration/v1alpha1/transportserver.go +++ b/pkg/client/listers/configuration/v1alpha1/transportserver.go @@ -4,8 +4,8 @@ package v1alpha1 import ( v1alpha1 "github.com/nginxinc/kubernetes-ingress/pkg/apis/configuration/v1alpha1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -22,25 +22,17 @@ type TransportServerLister interface { // transportServerLister implements the TransportServerLister interface. type transportServerLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1alpha1.TransportServer] } // NewTransportServerLister returns a new TransportServerLister. func NewTransportServerLister(indexer cache.Indexer) TransportServerLister { - return &transportServerLister{indexer: indexer} -} - -// List lists all TransportServers in the indexer. -func (s *transportServerLister) List(selector labels.Selector) (ret []*v1alpha1.TransportServer, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.TransportServer)) - }) - return ret, err + return &transportServerLister{listers.New[*v1alpha1.TransportServer](indexer, v1alpha1.Resource("transportserver"))} } // TransportServers returns an object that can list and get TransportServers. func (s *transportServerLister) TransportServers(namespace string) TransportServerNamespaceLister { - return transportServerNamespaceLister{indexer: s.indexer, namespace: namespace} + return transportServerNamespaceLister{listers.NewNamespaced[*v1alpha1.TransportServer](s.ResourceIndexer, namespace)} } // TransportServerNamespaceLister helps list and get TransportServers. @@ -58,26 +50,5 @@ type TransportServerNamespaceLister interface { // transportServerNamespaceLister implements the TransportServerNamespaceLister // interface. type transportServerNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all TransportServers in the indexer for a given namespace. -func (s transportServerNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.TransportServer, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.TransportServer)) - }) - return ret, err -} - -// Get retrieves the TransportServer from the indexer for a given namespace and name. -func (s transportServerNamespaceLister) Get(name string) (*v1alpha1.TransportServer, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha1.Resource("transportserver"), name) - } - return obj.(*v1alpha1.TransportServer), nil + listers.ResourceIndexer[*v1alpha1.TransportServer] } diff --git a/pkg/client/listers/dos/v1beta1/dosprotectedresource.go b/pkg/client/listers/dos/v1beta1/dosprotectedresource.go index f587f5ba26..5fcdef53d2 100644 --- a/pkg/client/listers/dos/v1beta1/dosprotectedresource.go +++ b/pkg/client/listers/dos/v1beta1/dosprotectedresource.go @@ -4,8 +4,8 @@ package v1beta1 import ( v1beta1 "github.com/nginxinc/kubernetes-ingress/pkg/apis/dos/v1beta1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -22,25 +22,17 @@ type DosProtectedResourceLister interface { // dosProtectedResourceLister implements the DosProtectedResourceLister interface. type dosProtectedResourceLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1beta1.DosProtectedResource] } // NewDosProtectedResourceLister returns a new DosProtectedResourceLister. func NewDosProtectedResourceLister(indexer cache.Indexer) DosProtectedResourceLister { - return &dosProtectedResourceLister{indexer: indexer} -} - -// List lists all DosProtectedResources in the indexer. -func (s *dosProtectedResourceLister) List(selector labels.Selector) (ret []*v1beta1.DosProtectedResource, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.DosProtectedResource)) - }) - return ret, err + return &dosProtectedResourceLister{listers.New[*v1beta1.DosProtectedResource](indexer, v1beta1.Resource("dosprotectedresource"))} } // DosProtectedResources returns an object that can list and get DosProtectedResources. func (s *dosProtectedResourceLister) DosProtectedResources(namespace string) DosProtectedResourceNamespaceLister { - return dosProtectedResourceNamespaceLister{indexer: s.indexer, namespace: namespace} + return dosProtectedResourceNamespaceLister{listers.NewNamespaced[*v1beta1.DosProtectedResource](s.ResourceIndexer, namespace)} } // DosProtectedResourceNamespaceLister helps list and get DosProtectedResources. @@ -58,26 +50,5 @@ type DosProtectedResourceNamespaceLister interface { // dosProtectedResourceNamespaceLister implements the DosProtectedResourceNamespaceLister // interface. type dosProtectedResourceNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all DosProtectedResources in the indexer for a given namespace. -func (s dosProtectedResourceNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.DosProtectedResource, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.DosProtectedResource)) - }) - return ret, err -} - -// Get retrieves the DosProtectedResource from the indexer for a given namespace and name. -func (s dosProtectedResourceNamespaceLister) Get(name string) (*v1beta1.DosProtectedResource, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1beta1.Resource("dosprotectedresource"), name) - } - return obj.(*v1beta1.DosProtectedResource), nil + listers.ResourceIndexer[*v1beta1.DosProtectedResource] } diff --git a/pkg/client/listers/externaldns/v1/dnsendpoint.go b/pkg/client/listers/externaldns/v1/dnsendpoint.go index 2709268b42..1b6899895a 100644 --- a/pkg/client/listers/externaldns/v1/dnsendpoint.go +++ b/pkg/client/listers/externaldns/v1/dnsendpoint.go @@ -4,8 +4,8 @@ package v1 import ( v1 "github.com/nginxinc/kubernetes-ingress/pkg/apis/externaldns/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -22,25 +22,17 @@ type DNSEndpointLister interface { // dNSEndpointLister implements the DNSEndpointLister interface. type dNSEndpointLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.DNSEndpoint] } // NewDNSEndpointLister returns a new DNSEndpointLister. func NewDNSEndpointLister(indexer cache.Indexer) DNSEndpointLister { - return &dNSEndpointLister{indexer: indexer} -} - -// List lists all DNSEndpoints in the indexer. -func (s *dNSEndpointLister) List(selector labels.Selector) (ret []*v1.DNSEndpoint, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.DNSEndpoint)) - }) - return ret, err + return &dNSEndpointLister{listers.New[*v1.DNSEndpoint](indexer, v1.Resource("dnsendpoint"))} } // DNSEndpoints returns an object that can list and get DNSEndpoints. func (s *dNSEndpointLister) DNSEndpoints(namespace string) DNSEndpointNamespaceLister { - return dNSEndpointNamespaceLister{indexer: s.indexer, namespace: namespace} + return dNSEndpointNamespaceLister{listers.NewNamespaced[*v1.DNSEndpoint](s.ResourceIndexer, namespace)} } // DNSEndpointNamespaceLister helps list and get DNSEndpoints. @@ -58,26 +50,5 @@ type DNSEndpointNamespaceLister interface { // dNSEndpointNamespaceLister implements the DNSEndpointNamespaceLister // interface. type dNSEndpointNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all DNSEndpoints in the indexer for a given namespace. -func (s dNSEndpointNamespaceLister) List(selector labels.Selector) (ret []*v1.DNSEndpoint, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1.DNSEndpoint)) - }) - return ret, err -} - -// Get retrieves the DNSEndpoint from the indexer for a given namespace and name. -func (s dNSEndpointNamespaceLister) Get(name string) (*v1.DNSEndpoint, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("dnsendpoint"), name) - } - return obj.(*v1.DNSEndpoint), nil + listers.ResourceIndexer[*v1.DNSEndpoint] }