From a995c1afd0856ec1934780b96576a7d6a458e19a Mon Sep 17 00:00:00 2001 From: Sergey Smolnikov Date: Tue, 3 Sep 2024 08:48:00 +0200 Subject: [PATCH] update-versions (#1185) * Updated refs * Updated refs * Fixed tests --- Makefile | 4 +- charts/radix-operator/Chart.yaml | 4 +- .../templates/radixapplication.yaml | 10 +- .../radix-operator/templates/radixbatch.yaml | 3 +- .../templates/radixdnsalias.yaml | 2 +- go.mod | 91 ++++---- go.sum | 203 +++++++++--------- json-schema/radixapplication.json | 16 +- pipeline-runner/steps/deploy/step_test.go | 7 +- pkg/apis/application/secrets_test.go | 22 +- .../versioned/fake/clientset_generated.go | 6 +- .../typed/radix/v1/fake/fake_radixalert.go | 36 ++-- .../radix/v1/fake/fake_radixapplication.go | 29 +-- .../typed/radix/v1/fake/fake_radixbatch.go | 36 ++-- .../radix/v1/fake/fake_radixdeployment.go | 36 ++-- .../typed/radix/v1/fake/fake_radixdnsalias.go | 36 ++-- .../radix/v1/fake/fake_radixenvironment.go | 36 ++-- .../typed/radix/v1/fake/fake_radixjob.go | 36 ++-- .../radix/v1/fake/fake_radixregistration.go | 36 ++-- .../versioned/typed/radix/v1/radixalert.go | 146 +------------ .../typed/radix/v1/radixapplication.go | 129 +---------- .../versioned/typed/radix/v1/radixbatch.go | 146 +------------ .../typed/radix/v1/radixdeployment.go | 146 +------------ .../versioned/typed/radix/v1/radixdnsalias.go | 135 +----------- .../typed/radix/v1/radixenvironment.go | 135 +----------- .../versioned/typed/radix/v1/radixjob.go | 146 +------------ .../typed/radix/v1/radixregistration.go | 135 +----------- .../informers/externalversions/factory.go | 1 + pkg/client/listers/radix/v1/radixalert.go | 39 +--- .../listers/radix/v1/radixapplication.go | 39 +--- pkg/client/listers/radix/v1/radixbatch.go | 39 +--- .../listers/radix/v1/radixdeployment.go | 39 +--- pkg/client/listers/radix/v1/radixdnsalias.go | 26 +-- .../listers/radix/v1/radixenvironment.go | 26 +-- pkg/client/listers/radix/v1/radixjob.go | 39 +--- .../listers/radix/v1/radixregistration.go | 26 +-- radix-operator/alert/controller.go | 6 +- radix-operator/common/controller.go | 22 +- radix-operator/common/controller_test.go | 84 ++++---- radix-operator/common/utils.go | 30 +-- 40 files changed, 529 insertions(+), 1654 deletions(-) diff --git a/Makefile b/Makefile index 6dfc163c0..f0ef6e498 100644 --- a/Makefile +++ b/Makefile @@ -166,11 +166,11 @@ HAS_CONTROLLER_GEN := $(shell command -v controller-gen;) .PHONY: bootstrap bootstrap: vendor ifndef HAS_GOLANGCI_LINT - curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $$(go env GOPATH)/bin v1.55.2 + curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $$(go env GOPATH)/bin v1.60.3 endif ifndef HAS_MOCKGEN go install github.com/golang/mock/mockgen@v1.6.0 endif ifndef HAS_CONTROLLER_GEN - go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.15.0 + go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.16.2 endif diff --git a/charts/radix-operator/Chart.yaml b/charts/radix-operator/Chart.yaml index a48bd69ac..e6ccd96b3 100644 --- a/charts/radix-operator/Chart.yaml +++ b/charts/radix-operator/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v2 name: radix-operator -version: 1.38.1 -appVersion: 1.58.1 +version: 1.38.2 +appVersion: 1.58.2 kubeVersion: ">=1.24.0" description: Radix Operator keywords: diff --git a/charts/radix-operator/templates/radixapplication.yaml b/charts/radix-operator/templates/radixapplication.yaml index 30ba59728..9706bdf74 100644 --- a/charts/radix-operator/templates/radixapplication.yaml +++ b/charts/radix-operator/templates/radixapplication.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.2 name: radixapplications.radix.equinor.com spec: group: radix.equinor.com @@ -1081,13 +1081,11 @@ spec: type: string requestsStorage: description: |- - TODO: describe More info: https://www.radix.equinor.com/guides/volume-mounts/optional-settings/ Deprecated, use BlobFuse2 or AzureFile instead. type: string skuName: description: |- - TODO: describe More info: https://www.radix.equinor.com/guides/volume-mounts/optional-settings/ Deprecated, use BlobFuse2 or AzureFile instead. type: string @@ -1828,13 +1826,11 @@ spec: type: string requestsStorage: description: |- - TODO: describe More info: https://www.radix.equinor.com/guides/volume-mounts/optional-settings/ Deprecated, use BlobFuse2 or AzureFile instead. type: string skuName: description: |- - TODO: describe More info: https://www.radix.equinor.com/guides/volume-mounts/optional-settings/ Deprecated, use BlobFuse2 or AzureFile instead. type: string @@ -2689,13 +2685,11 @@ spec: type: string requestsStorage: description: |- - TODO: describe More info: https://www.radix.equinor.com/guides/volume-mounts/optional-settings/ Deprecated, use BlobFuse2 or AzureFile instead. type: string skuName: description: |- - TODO: describe More info: https://www.radix.equinor.com/guides/volume-mounts/optional-settings/ Deprecated, use BlobFuse2 or AzureFile instead. type: string @@ -3235,13 +3229,11 @@ spec: type: string requestsStorage: description: |- - TODO: describe More info: https://www.radix.equinor.com/guides/volume-mounts/optional-settings/ Deprecated, use BlobFuse2 or AzureFile instead. type: string skuName: description: |- - TODO: describe More info: https://www.radix.equinor.com/guides/volume-mounts/optional-settings/ Deprecated, use BlobFuse2 or AzureFile instead. type: string diff --git a/charts/radix-operator/templates/radixbatch.yaml b/charts/radix-operator/templates/radixbatch.yaml index 98bf64b86..ab9c3ed94 100644 --- a/charts/radix-operator/templates/radixbatch.yaml +++ b/charts/radix-operator/templates/radixbatch.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.2 name: radixbatches.radix.equinor.com spec: group: radix.equinor.com @@ -69,7 +69,6 @@ spec: description: |- ImageTagName defines the image tag name to use for the job image - required: false type: string jobId: diff --git a/charts/radix-operator/templates/radixdnsalias.yaml b/charts/radix-operator/templates/radixdnsalias.yaml index 0dd567004..a94325748 100644 --- a/charts/radix-operator/templates/radixdnsalias.yaml +++ b/charts/radix-operator/templates/radixdnsalias.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.2 name: radixdnsaliases.radix.equinor.com spec: group: radix.equinor.com diff --git a/go.mod b/go.mod index 8c8e6efa5..0e8e58c57 100644 --- a/go.mod +++ b/go.mod @@ -2,49 +2,49 @@ module github.com/equinor/radix-operator go 1.22.0 -toolchain go1.22.4 +toolchain go1.22.5 require ( - dario.cat/mergo v1.0.0 + dario.cat/mergo v1.0.1 github.com/cert-manager/cert-manager v1.14.2 - github.com/equinor/radix-common v1.9.2 + github.com/equinor/radix-common v1.9.4 github.com/golang/mock v1.6.0 github.com/google/uuid v1.6.0 - github.com/kedacore/keda/v2 v2.13.1 + github.com/kedacore/keda/v2 v2.15.1 github.com/pkg/errors v0.9.1 - github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.70.0 - github.com/prometheus-operator/prometheus-operator/pkg/client v0.70.0 - github.com/prometheus/client_golang v1.19.0 + github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.76.0 + github.com/prometheus-operator/prometheus-operator/pkg/client v0.76.0 + github.com/prometheus/client_golang v1.20.2 github.com/robfig/cron/v3 v3.0.1 - github.com/rs/zerolog v1.32.0 - github.com/spf13/cobra v1.8.0 - github.com/spf13/viper v1.18.2 + github.com/rs/zerolog v1.33.0 + github.com/spf13/cobra v1.8.1 + github.com/spf13/viper v1.19.0 github.com/stretchr/testify v1.9.0 - golang.org/x/crypto v0.22.0 - golang.org/x/sync v0.7.0 + golang.org/x/crypto v0.26.0 + golang.org/x/sync v0.8.0 gopkg.in/yaml.v3 v3.0.1 - k8s.io/api v0.30.1 - k8s.io/apiextensions-apiserver v0.30.1 - k8s.io/apimachinery v0.30.1 - k8s.io/client-go v0.30.1 - k8s.io/code-generator v0.30.1 - sigs.k8s.io/secrets-store-csi-driver v1.4.0 + k8s.io/api v0.31.0 + k8s.io/apiextensions-apiserver v0.31.0 + k8s.io/apimachinery v0.31.0 + k8s.io/client-go v0.31.0 + k8s.io/code-generator v0.31.0 + sigs.k8s.io/secrets-store-csi-driver v1.4.5 sigs.k8s.io/yaml v1.4.0 ) require ( github.com/beorn7/perks v1.0.1 // indirect - github.com/cespare/xxhash/v2 v2.2.0 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect - github.com/emicklei/go-restful/v3 v3.11.2 // indirect - github.com/evanphx/json-patch v5.8.1+incompatible // indirect + github.com/emicklei/go-restful/v3 v3.12.1 // indirect github.com/evanphx/json-patch/v5 v5.9.0 // indirect - github.com/expr-lang/expr v1.15.8 // indirect + github.com/expr-lang/expr v1.16.9 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect - github.com/go-logr/logr v1.4.1 // indirect - github.com/go-openapi/jsonpointer v0.20.2 // indirect - github.com/go-openapi/jsonreference v0.20.4 // indirect - github.com/go-openapi/swag v0.22.7 // indirect + github.com/fxamacker/cbor/v2 v2.7.0 // indirect + github.com/go-logr/logr v1.4.2 // indirect + github.com/go-openapi/jsonpointer v0.21.0 // indirect + github.com/go-openapi/jsonreference v0.21.0 // indirect + github.com/go-openapi/swag v0.23.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.4 // indirect @@ -56,6 +56,7 @@ require ( github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect + github.com/klauspost/compress v1.17.9 // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect @@ -64,11 +65,11 @@ require ( github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect - github.com/pelletier/go-toml/v2 v2.1.0 // indirect + github.com/pelletier/go-toml/v2 v2.2.2 // 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.53.0 // indirect - github.com/prometheus/procfs v0.12.0 // indirect + github.com/prometheus/common v0.55.0 // indirect + github.com/prometheus/procfs v0.15.1 // indirect github.com/sagikazarmark/locafero v0.4.0 // indirect github.com/sagikazarmark/slog-shim v0.1.0 // indirect github.com/sourcegraph/conc v0.3.0 // indirect @@ -77,27 +78,29 @@ require ( github.com/spf13/pflag v1.0.5 // indirect github.com/stretchr/objx v0.5.2 // indirect github.com/subosito/gotenv v1.6.0 // indirect + github.com/x448/float16 v0.8.4 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/exp v0.0.0-20240112132812-db7319d0e0e3 // indirect - golang.org/x/mod v0.15.0 // indirect - golang.org/x/net v0.24.0 // indirect - golang.org/x/oauth2 v0.19.0 // indirect - golang.org/x/sys v0.19.0 // indirect - golang.org/x/term v0.19.0 // indirect - golang.org/x/text v0.14.0 // indirect - golang.org/x/time v0.5.0 // indirect - golang.org/x/tools v0.18.0 // indirect + golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect + golang.org/x/mod v0.20.0 // indirect + golang.org/x/net v0.28.0 // indirect + golang.org/x/oauth2 v0.22.0 // indirect + golang.org/x/sys v0.24.0 // indirect + golang.org/x/term v0.23.0 // indirect + golang.org/x/text v0.17.0 // indirect + golang.org/x/time v0.6.0 // indirect + golang.org/x/tools v0.24.0 // indirect gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect - google.golang.org/protobuf v1.33.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/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70 // indirect - k8s.io/klog/v2 v2.120.1 // indirect - k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 // indirect - k8s.io/utils v0.0.0-20240310230437-4693a0247e57 // indirect - knative.dev/pkg v0.0.0-20240116073220-b488e7be5902 // indirect - sigs.k8s.io/controller-runtime v0.18.2 // indirect + k8s.io/klog/v2 v2.130.1 // indirect + k8s.io/kube-openapi v0.0.0-20240808142205-8e686545bdb8 // indirect + k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 // indirect + knative.dev/pkg v0.0.0-20240805063731-c88d5dad9653 // indirect + sigs.k8s.io/controller-runtime v0.19.0 // indirect sigs.k8s.io/gateway-api v1.0.0 // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect diff --git a/go.sum b/go.sum index b1e77279e..91c36d34c 100644 --- a/go.sum +++ b/go.sum @@ -1,43 +1,46 @@ -dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk= -dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= +dario.cat/mergo v1.0.1 h1:Ra4+bf83h2ztPIQYNP99R6m+Y7KfnARDfID+a+vLl4s= +dario.cat/mergo v1.0.1/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/cert-manager/cert-manager v1.14.2 h1:C/uci6yxiCRO04PWomBbSX+T4JT58FIIpDj5SZ6Ks6I= github.com/cert-manager/cert-manager v1.14.2/go.mod h1:pik7K6jXfgh++lfVJ/i1HzEnDluSUtTVLXSHikj8Lho= -github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= -github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/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/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/emicklei/go-restful/v3 v3.11.2 h1:1onLa9DcsMYO9P+CXaL0dStDqQ2EHHXLiz+BtnqkLAU= -github.com/emicklei/go-restful/v3 v3.11.2/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= -github.com/equinor/radix-common v1.9.2 h1:pOYN/mSAoPe6KO/Nvudfd5DUETbLv4nLTLzFPr62ADw= -github.com/equinor/radix-common v1.9.2/go.mod h1:ekn86U68NT4ccSdt3GT+ukpiclzfuhr96a7zBJKv/jw= -github.com/evanphx/json-patch v5.8.1+incompatible h1:2toJaoe7/rNa1zpeQx0UnVEjqk6z2ecyA20V/zg8vTU= -github.com/evanphx/json-patch v5.8.1+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/emicklei/go-restful/v3 v3.12.1 h1:PJMDIM/ak7btuL8Ex0iYET9hxM3CI2sjZtzpL63nKAU= +github.com/emicklei/go-restful/v3 v3.12.1/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= +github.com/equinor/radix-common v1.9.4 h1:ErSnB2tqlRwaQuQdaA0qzsReDtHDgubcvqRO098ncEw= +github.com/equinor/radix-common v1.9.4/go.mod h1:+g0Wj0D40zz29DjNkYKVmCVeYy4OsFWKI7Qi9rA6kpY= +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/evanphx/json-patch/v5 v5.9.0 h1:kcBlZQbplgElYIlo/n1hJbls2z/1awpXxpRi0/FOJfg= github.com/evanphx/json-patch/v5 v5.9.0/go.mod h1:VNkHZ/282BpEyt/tObQO8s5CMPmYYq14uClGH4abBuQ= -github.com/expr-lang/expr v1.15.8 h1:FL8+d3rSSP4tmK9o+vKfSMqqpGL8n15pEPiHcnBpxoI= -github.com/expr-lang/expr v1.15.8/go.mod h1:uCkhfG+x7fcZ5A5sXHKuQ07jGZRl6J0FCAaf2k4PtVQ= +github.com/expr-lang/expr v1.16.9 h1:WUAzmR0JNI9JCiF0/ewwHB1gmcGw5wW7nWt8gc6PpCI= +github.com/expr-lang/expr v1.16.9/go.mod h1:8/vRC7+7HBzESEqt5kKpYXxrxkr31SaO8r40VO/1IT4= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= 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/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= -github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv5E= +github.com/fxamacker/cbor/v2 v2.7.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ= +github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= +github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/zapr v1.3.0 h1:XGdV8XW8zdwFiwOA2Dryh1gj2KRQyOOoNmBy4EplIcQ= github.com/go-logr/zapr v1.3.0/go.mod h1:YKepepNBd1u/oyhd/yQmtjVXmm9uML4IXUgMOwR8/Gg= -github.com/go-openapi/jsonpointer v0.20.2 h1:mQc3nmndL8ZBzStEo3JYF8wzmeWffDH4VbXz58sAx6Q= -github.com/go-openapi/jsonpointer v0.20.2/go.mod h1:bHen+N0u1KEO3YlmqOjTT9Adn1RfD91Ar825/PuiRVs= -github.com/go-openapi/jsonreference v0.20.4 h1:bKlDxQxQJgwpUSgOENiMPzCTBVuc7vTdXSSgNeAhojU= -github.com/go-openapi/jsonreference v0.20.4/go.mod h1:5pZJyJP2MnYCpoeoMAql78cCHauHj0V9Lhc506VOpw4= -github.com/go-openapi/swag v0.22.7 h1:JWrc1uc/P9cSomxfnsFSVWoE1FW6bNbrVPmpQYpCcR8= -github.com/go-openapi/swag v0.22.7/go.mod h1:Gl91UqO+btAM0plGGxHqJcQZ1ZTy6jbmridBTsDy8A0= +github.com/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ= +github.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY= +github.com/go-openapi/jsonreference v0.21.0 h1:Rs+Y7hSXT83Jacb7kFyjn4ijOuVGSvOdF2+tg1TRrwQ= +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 v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= +github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= +github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= @@ -55,8 +58,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-20231229205709-960ae82b1e42 h1:dHLYa5D8/Ta0aLR2XcPsrkpAgGeFs6thhMcQK0oQ0n8= -github.com/google/pprof v0.0.0-20231229205709-960ae82b1e42/go.mod h1:czg5+yv1E0ZGTi6S6vVK1mke0fV+FaUhNGcd6VRS9Ik= +github.com/google/pprof v0.0.0-20240727154555-813a5fbdbec8 h1:FKHo8hFI3A+7w0aUQuYXQ+6EN5stWmeY/AZqtM8xk9k= +github.com/google/pprof v0.0.0-20240727154555-813a5fbdbec8/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/hashicorp/hcl v1.0.1-vault-5 h1:kI3hhbbyzr4dldA8UdTb7ZlVVlI2DACdCfz31RPDgJM= @@ -69,14 +72,18 @@ github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8Hm github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= -github.com/kedacore/keda/v2 v2.13.1 h1:8y4Mp4iWyiqHoedVT3q2g5xvWDe494TRH3sUCZPpn/o= -github.com/kedacore/keda/v2 v2.13.1/go.mod h1:AZTRgxWpK5/6pq+DqJ15y3Bl/C8sl9C7tUVF4phzGDQ= +github.com/kedacore/keda/v2 v2.15.1 h1:Kb3woYuCeCPICH037vTIcUopXgOYpdP2qa+CmHgV3SE= +github.com/kedacore/keda/v2 v2.15.1/go.mod h1:2umVEoNgklKt0+q+7BEEbrSgxqh+KPjyh6vnKXt3sls= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= +github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= +github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= @@ -97,36 +104,36 @@ github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjY github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= -github.com/onsi/ginkgo/v2 v2.17.1 h1:V++EzdbhI4ZV4ev0UTIj0PzhzOcReJFyJaLjtSF55M8= -github.com/onsi/ginkgo/v2 v2.17.1/go.mod h1:llBI3WDLL9Z6taip6f33H76YcWtJv+7R3HigUjbIBOs= -github.com/onsi/gomega v1.32.0 h1:JRYU78fJ1LPxlckP6Txi/EYqJvjtMrDC04/MM5XRHPk= -github.com/onsi/gomega v1.32.0/go.mod h1:a4x4gW6Pz2yK1MAmvluYme5lvYTn61afQ2ETw/8n4Lg= -github.com/pelletier/go-toml/v2 v2.1.0 h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6/MHO4= -github.com/pelletier/go-toml/v2 v2.1.0/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= +github.com/onsi/ginkgo/v2 v2.20.0 h1:PE84V2mHqoT1sglvHc8ZdQtPcwmvvt29WLEEO3xmdZw= +github.com/onsi/ginkgo/v2 v2.20.0/go.mod h1:lG9ey2Z29hR41WMVthyJBGUBcBhGOtoPF2VFMvBXFCI= +github.com/onsi/gomega v1.34.1 h1:EUMJIKUjM8sKjYbtxQI9A4z2o+rruxnzNvpknOXie6k= +github.com/onsi/gomega v1.34.1/go.mod h1:kU1QgUvBDLXBJq618Xvm2LUX6rSAfRaFRTcdOeDLwwY= +github.com/pelletier/go-toml/v2 v2.2.2 h1:aYUidT7k73Pcl9nb2gScu7NSrKCSHIDE89b3+6Wq+LM= +github.com/pelletier/go-toml/v2 v2.2.2/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= 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-operator/prometheus-operator/pkg/apis/monitoring v0.70.0 h1:CFTvpkpVP4EXXZuaZuxpikAoma8xVha/IZKMDc9lw+Y= -github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.70.0/go.mod h1:npfc20mPOAu7ViOVnATVMbI7PoXvW99EzgJVqkAomIQ= -github.com/prometheus-operator/prometheus-operator/pkg/client v0.70.0 h1:PpdpJDS1MyMSLILG+Y0hgzVQ3tu6qEkRD0gR/UuvSZk= -github.com/prometheus-operator/prometheus-operator/pkg/client v0.70.0/go.mod h1:4I5Rt6iIu95JBYYaDYA+Er+YBfUwIq9Pwh5TEoBmawg= -github.com/prometheus/client_golang v1.19.0 h1:ygXvpU1AoN1MhdzckN+PyD9QJOSD4x7kmXYlnfbA6JU= -github.com/prometheus/client_golang v1.19.0/go.mod h1:ZRM9uEAypZakd+q/x7+gmsvXdURP+DABIEIjnmDdp+k= +github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.76.0 h1:tRwEFYFg+To2TGnibGl8dHBCh8Z/BVNKnXj2O5Za/2M= +github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.76.0/go.mod h1:Rd8YnCqz+2FYsiGmE2DMlaLjQRB4v2jFNnzCt9YY4IM= +github.com/prometheus-operator/prometheus-operator/pkg/client v0.76.0 h1:bJhRd6R4kaYBZpH7cBrzbJpEKJjHx8cbVW1n3dxYnag= +github.com/prometheus-operator/prometheus-operator/pkg/client v0.76.0/go.mod h1:Nu6G9XLApnqXqunMwMYulcHlaxRwoveH4p4WnZsBHD8= +github.com/prometheus/client_golang v1.20.2 h1:5ctymQzZlyOON1666svgwn3s6IKWgfbjsejTMiXIyjg= +github.com/prometheus/client_golang v1.20.2/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= 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.53.0 h1:U2pL9w9nmJwJDa4qqLQ3ZaePJ6ZTwt7cMD3AG3+aLCE= -github.com/prometheus/common v0.53.0/go.mod h1:BrxBKv3FWBIGXw89Mg1AeBq7FSyRzXWI3l3e7W3RN5U= -github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= -github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= +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/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs= github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro= github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= -github.com/rs/zerolog v1.32.0 h1:keLypqrlIjaFsbmJOBdB/qvyF8KEtCWHwobLp5l/mQ0= -github.com/rs/zerolog v1.32.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= +github.com/rs/zerolog v1.33.0 h1:1cU2KZkvPxNyfgEmhHAz/1A9Bz+llsdYzklWFzgp0r8= +github.com/rs/zerolog v1.33.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/sagikazarmark/locafero v0.4.0 h1:HApY1R9zGo4DBgr7dqsTH/JJxLTTsOt7u6keLGt6kNQ= github.com/sagikazarmark/locafero v0.4.0/go.mod h1:Pe1W6UlPYUk/+wc/6KFhbORCfqzgYEpgQ3O5fPuL3H4= @@ -138,12 +145,12 @@ github.com/spf13/afero v1.11.0 h1:WJQKhtpdm3v2IzqG8VMqrr6Rf3UYpEF239Jy9wNepM8= github.com/spf13/afero v1.11.0/go.mod h1:GH9Y3pIexgf1MTIWtNGyogA5MwRIDXGUr+hbWNoBjkY= github.com/spf13/cast v1.6.0 h1:GEiTHELF+vaR5dhz3VqZfFSzZjYbgeKDpBxQVS4GYJ0= github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= -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/spf13/viper v1.18.2 h1:LUXCnvUvSM6FXAsj6nnfc8Q2tp1dIgUfY9Kc8GsSOiQ= -github.com/spf13/viper v1.18.2/go.mod h1:EKmWIqdnk5lOcmR72yw6hS+8OPYcwD0jteitLMVB+yk= +github.com/spf13/viper v1.19.0 h1:RWq5SEjt8o25SROyN3z2OrDB9l7RPd3lwTWU8EcEdcI= +github.com/spf13/viper v1.19.0/go.mod h1:GQUN9bilAbhU/jgc1bKs99f/suXKeUMct8Adx5+Ntkg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= @@ -157,6 +164,8 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= +github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= +github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= @@ -164,35 +173,35 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= +go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30= -golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= -golang.org/x/exp v0.0.0-20240112132812-db7319d0e0e3 h1:hNQpMuAJe5CtcUqCXaWga3FHu+kQvCqcsoVaQgSV60o= -golang.org/x/exp v0.0.0-20240112132812-db7319d0e0e3/go.mod h1:idGWGoKP1toJGkd5/ig9ZLuPcZBC3ewk7SzmH0uou08= +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.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.15.0 h1:SernR4v+D55NyBH2QiEQrlBAnj1ECL6AGrA5+dPaMY8= -golang.org/x/mod v0.15.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-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= -golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= -golang.org/x/oauth2 v0.19.0 h1:9+E/EZBCbTLNrbN35fHv/a/d/mOBatymz1zbtQrXpIg= -golang.org/x/oauth2 v0.19.0/go.mod h1:vYi7skDa1x015PmRRYZ7+s1cWyPgrPiSYRe4rnsexc8= +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.22.0 h1:BzDx2FehcG7jJwgWLELCdmLuxk2i+x9UDpSiss2u0ZA= +golang.org/x/oauth2 v0.22.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/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= @@ -202,35 +211,37 @@ golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= -golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= +golang.org/x/sys v0.24.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.19.0 h1:+ThwsDv+tYfnJFhF4L8jITxu1tdTWRTZpdsWgEgjL6Q= -golang.org/x/term v0.19.0/go.mod h1:2CuTdWZ7KHSQwUzKva0cbMg6q2DMI3Mmxp+gKJbskEk= +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.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= -golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -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/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.6.0 h1:eTDhh4ZXt5Qf0augr54TN6suAUudPcawVZeIAPU7D4U= +golang.org/x/time v0.6.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.18.0 h1:k8NLag8AGHnn+PHbl7g43CtqZAwG60vZkLqgyZgIHgQ= -golang.org/x/tools v0.18.0/go.mod h1:GL7B4CwcLLeo59yx/9UWWuNOW1n3VZ4f5axWfML7Lcg= +golang.org/x/tools v0.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= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gomodules.xyz/jsonpatch/v2 v2.4.0 h1:Ci3iUJyx9UeRx7CeFN8ARgGbkESwJK+KB9lLcWxY/Zw= gomodules.xyz/jsonpatch/v2 v2.4.0/go.mod h1:AH3dM2RI6uoBZxn3LVrfvJ3E0/9dG4cSrbuBJT4moAY= -google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= -google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +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/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= @@ -241,34 +252,34 @@ 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.1 h1:kCm/6mADMdbAxmIh0LBjS54nQBE+U4KmbCfIkF5CpJY= -k8s.io/api v0.30.1/go.mod h1:ddbN2C0+0DIiPntan/bye3SW3PdwLa11/0yqwvuRrJM= -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.1 h1:ZQStsEfo4n65yAdlGTfP/uSHMQSoYzU/oeEbkmF7P2U= -k8s.io/apimachinery v0.30.1/go.mod h1:iexa2somDaxdnj7bha06bhb43Zpa6eWH8N8dbqVjTUc= -k8s.io/client-go v0.30.1 h1:uC/Ir6A3R46wdkgCV3vbLyNOYyCJ8oZnjtJGKfytl/Q= -k8s.io/client-go v0.30.1/go.mod h1:wrAqLNs2trwiCH/wxxmT/x3hKVH9PuV0GGW0oDoHVqc= -k8s.io/code-generator v0.30.1 h1:ZsG++q5Vt0ScmKCeLhynUuWgcwFGg1Hl1AGfatqPJBI= -k8s.io/code-generator v0.30.1/go.mod h1:hFgxRsvOUg79mbpbVKfjJvRhVz1qLoe40yZDJ/hwRH4= +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/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/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/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag= -k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340/go.mod h1:yD4MZYeKMBwQKVht279WycxKyM84kkAx2DPrTXaeb98= -k8s.io/utils v0.0.0-20240310230437-4693a0247e57 h1:gbqbevonBh57eILzModw6mrkbwM0gQBEuevE/AaBsHY= -k8s.io/utils v0.0.0-20240310230437-4693a0247e57/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= -knative.dev/pkg v0.0.0-20240116073220-b488e7be5902 h1:H6+JJN23fhwYWCHY1339sY6uhIyoUwDy1a8dN233fdk= -knative.dev/pkg v0.0.0-20240116073220-b488e7be5902/go.mod h1:NYk8mMYoLkO7CQWnNkti4YGGnvLxN6MIDbUvtgeo0C0= -sigs.k8s.io/controller-runtime v0.18.2 h1:RqVW6Kpeaji67CY5nPEfRz6ZfFMk0lWQlNrLqlNpx+Q= -sigs.k8s.io/controller-runtime v0.18.2/go.mod h1:tuAt1+wbVsXIT8lPtk5RURxqAnq7xkpv2Mhttslg7Hw= +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-20240808142205-8e686545bdb8 h1:1Wof1cGQgA5pqgo8MxKPtf+qN6Sh/0JzznmeGPm1HnE= +k8s.io/kube-openapi v0.0.0-20240808142205-8e686545bdb8/go.mod h1:Os6V6dZwLNii3vxFpxcNaTmH8LJJBkOTg1N0tOA0fvA= +k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 h1:pUdcCO1Lk/tbT5ztQWOBi5HBgbBP1J8+AsQnQCKsi8A= +k8s.io/utils v0.0.0-20240711033017-18e509b52bc8/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +knative.dev/pkg v0.0.0-20240805063731-c88d5dad9653 h1:VHUW124ZpkDn4EnIzMuGWvGuJte3ISIoHMmEw2kx0zU= +knative.dev/pkg v0.0.0-20240805063731-c88d5dad9653/go.mod h1:H+5rS2GEWpAZzrmQoXOEVq/1M77LLMhR7+4jZBMOQ24= +sigs.k8s.io/controller-runtime v0.19.0 h1:nWVM7aq+Il2ABxwiCizrVDSlmDcshi9llbaFbC0ji/Q= +sigs.k8s.io/controller-runtime v0.19.0/go.mod h1:iRmWllt8IlaLjvTTDLhRBXIEtkCK6hwVBJJsYS9Ajf4= sigs.k8s.io/gateway-api v1.0.0 h1:iPTStSv41+d9p0xFydll6d7f7MOBGuqXM6p2/zVYMAs= sigs.k8s.io/gateway-api v1.0.0/go.mod h1:4cUgr0Lnp5FZ0Cdq8FdRwCvpiWws7LVhLHGIudLlf4c= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= -sigs.k8s.io/secrets-store-csi-driver v1.4.0 h1:R9JVcKOs11fEuiOLlH1BWMeyb6WYzvElRVkq1BWJkr4= -sigs.k8s.io/secrets-store-csi-driver v1.4.0/go.mod h1:RjFTqJzIV6/howouY0llU0iMbldSEt3nc2MGFOL6gko= +sigs.k8s.io/secrets-store-csi-driver v1.4.5 h1:ta4aiNbl2EAWKrn3hFnN4Nll8mC6cgBP9+O4XdzorHM= +sigs.k8s.io/secrets-store-csi-driver v1.4.5/go.mod h1:0/wMVOv8qLx7YNVMGU+Sh7S4D6TH6GhyEpouo28OTUU= sigs.k8s.io/structured-merge-diff/v4 v4.4.1 h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+sGiqlzvrtq4= sigs.k8s.io/structured-merge-diff/v4 v4.4.1/go.mod h1:N8hJocpFajUSSeSJ9bOZ77VzejKZaXsTtZo4/u7Io08= sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= diff --git a/json-schema/radixapplication.json b/json-schema/radixapplication.json index a9480f5a3..2084caad3 100644 --- a/json-schema/radixapplication.json +++ b/json-schema/radixapplication.json @@ -1053,11 +1053,11 @@ "type": "string" }, "requestsStorage": { - "description": "TODO: describe\nMore info: https://www.radix.equinor.com/guides/volume-mounts/optional-settings/\nDeprecated, use BlobFuse2 or AzureFile instead.", + "description": "More info: https://www.radix.equinor.com/guides/volume-mounts/optional-settings/\nDeprecated, use BlobFuse2 or AzureFile instead.", "type": "string" }, "skuName": { - "description": "TODO: describe\nMore info: https://www.radix.equinor.com/guides/volume-mounts/optional-settings/\nDeprecated, use BlobFuse2 or AzureFile instead.", + "description": "More info: https://www.radix.equinor.com/guides/volume-mounts/optional-settings/\nDeprecated, use BlobFuse2 or AzureFile instead.", "type": "string" }, "storage": { @@ -1826,11 +1826,11 @@ "type": "string" }, "requestsStorage": { - "description": "TODO: describe\nMore info: https://www.radix.equinor.com/guides/volume-mounts/optional-settings/\nDeprecated, use BlobFuse2 or AzureFile instead.", + "description": "More info: https://www.radix.equinor.com/guides/volume-mounts/optional-settings/\nDeprecated, use BlobFuse2 or AzureFile instead.", "type": "string" }, "skuName": { - "description": "TODO: describe\nMore info: https://www.radix.equinor.com/guides/volume-mounts/optional-settings/\nDeprecated, use BlobFuse2 or AzureFile instead.", + "description": "More info: https://www.radix.equinor.com/guides/volume-mounts/optional-settings/\nDeprecated, use BlobFuse2 or AzureFile instead.", "type": "string" }, "storage": { @@ -2717,11 +2717,11 @@ "type": "string" }, "requestsStorage": { - "description": "TODO: describe\nMore info: https://www.radix.equinor.com/guides/volume-mounts/optional-settings/\nDeprecated, use BlobFuse2 or AzureFile instead.", + "description": "More info: https://www.radix.equinor.com/guides/volume-mounts/optional-settings/\nDeprecated, use BlobFuse2 or AzureFile instead.", "type": "string" }, "skuName": { - "description": "TODO: describe\nMore info: https://www.radix.equinor.com/guides/volume-mounts/optional-settings/\nDeprecated, use BlobFuse2 or AzureFile instead.", + "description": "More info: https://www.radix.equinor.com/guides/volume-mounts/optional-settings/\nDeprecated, use BlobFuse2 or AzureFile instead.", "type": "string" }, "storage": { @@ -3277,11 +3277,11 @@ "type": "string" }, "requestsStorage": { - "description": "TODO: describe\nMore info: https://www.radix.equinor.com/guides/volume-mounts/optional-settings/\nDeprecated, use BlobFuse2 or AzureFile instead.", + "description": "More info: https://www.radix.equinor.com/guides/volume-mounts/optional-settings/\nDeprecated, use BlobFuse2 or AzureFile instead.", "type": "string" }, "skuName": { - "description": "TODO: describe\nMore info: https://www.radix.equinor.com/guides/volume-mounts/optional-settings/\nDeprecated, use BlobFuse2 or AzureFile instead.", + "description": "More info: https://www.radix.equinor.com/guides/volume-mounts/optional-settings/\nDeprecated, use BlobFuse2 or AzureFile instead.", "type": "string" }, "storage": { diff --git a/pipeline-runner/steps/deploy/step_test.go b/pipeline-runner/steps/deploy/step_test.go index 321fbc1c0..380cb2ace 100644 --- a/pipeline-runner/steps/deploy/step_test.go +++ b/pipeline-runner/steps/deploy/step_test.go @@ -216,11 +216,12 @@ func TestDeploy_PromotionSetup_ShouldCreateNamespacesForAllBranchesIfNotExists(t rdNameDev := rds.Items[0].Name t.Run("validate deployment exist in only the namespace of the modified branch", func(t *testing.T) { - rdDev, _ := radixclient.RadixV1().RadixDeployments("any-app-dev").Get(context.Background(), rdNameDev, metav1.GetOptions{}) + rdDev, err := radixclient.RadixV1().RadixDeployments("any-app-dev").Get(context.Background(), rdNameDev, metav1.GetOptions{}) + assert.NoError(t, err) assert.NotNil(t, rdDev) - rdProd, _ := radixclient.RadixV1().RadixDeployments("any-app-prod").Get(context.Background(), rdNameDev, metav1.GetOptions{}) - assert.Nil(t, rdProd) + _, err = radixclient.RadixV1().RadixDeployments("any-app-prod").Get(context.Background(), rdNameDev, metav1.GetOptions{}) + assert.Error(t, err) }) t.Run("validate deployment environment variables", func(t *testing.T) { diff --git a/pkg/apis/application/secrets_test.go b/pkg/apis/application/secrets_test.go index 7d63640bc..053a65349 100644 --- a/pkg/apis/application/secrets_test.go +++ b/pkg/apis/application/secrets_test.go @@ -71,27 +71,23 @@ func TestOnSync_PublicKeyCmDoesNotExist_NewKeyIsGenerated(t *testing.T) { WithName(appName) // check public key cm does not exist - cm, err := client.CoreV1().ConfigMaps(utils.GetAppNamespace(appName)).Get(context.Background(), defaults.GitPublicKeyConfigMapName, metav1.GetOptions{}) + _, err := client.CoreV1().ConfigMaps(utils.GetAppNamespace(appName)).Get(context.Background(), defaults.GitPublicKeyConfigMapName, metav1.GetOptions{}) assert.Error(t, err) - assert.Nil(t, cm) // check secret does not exist - secret, err := client.CoreV1().Secrets(utils.GetAppNamespace(appName)).Get(context.Background(), defaults.GitPrivateKeySecretName, metav1.GetOptions{}) + _, err = client.CoreV1().Secrets(utils.GetAppNamespace(appName)).Get(context.Background(), defaults.GitPrivateKeySecretName, metav1.GetOptions{}) assert.Error(t, err) - assert.Nil(t, secret) _, err = applyRegistrationWithSync(tu, client, kubeUtil, radixClient, rr) assert.NoError(t, err) - assert.NoError(t, err) // check public key cm exists, and has key - cm, err = client.CoreV1().ConfigMaps(utils.GetAppNamespace(appName)).Get(context.Background(), defaults.GitPublicKeyConfigMapName, metav1.GetOptions{}) + cm, err := client.CoreV1().ConfigMaps(utils.GetAppNamespace(appName)).Get(context.Background(), defaults.GitPublicKeyConfigMapName, metav1.GetOptions{}) assert.NoError(t, err) publicKey := cm.Data[defaults.GitPublicKeyConfigMapKey] assert.NotNil(t, publicKey) // check secret exists, and has private key - secret, err = client.CoreV1().Secrets(utils.GetAppNamespace(appName)).Get(context.Background(), defaults.GitPrivateKeySecretName, metav1.GetOptions{}) - assert.NoError(t, err) + secret, err := client.CoreV1().Secrets(utils.GetAppNamespace(appName)).Get(context.Background(), defaults.GitPrivateKeySecretName, metav1.GetOptions{}) assert.NoError(t, err) privateKey := secret.Data[defaults.GitPrivateKeySecretKey] assert.NotNil(t, privateKey) @@ -111,15 +107,14 @@ func TestOnSync_PublicKeyCmDoesNotExist_KeyIsCopiedFromRR(t *testing.T) { WithPrivateKey(somePrivateKey) // check public key cm does not exist - cm, err := client.CoreV1().ConfigMaps(utils.GetAppNamespace(appName)).Get(context.Background(), defaults.GitPublicKeyConfigMapName, metav1.GetOptions{}) + _, err := client.CoreV1().ConfigMaps(utils.GetAppNamespace(appName)).Get(context.Background(), defaults.GitPublicKeyConfigMapName, metav1.GetOptions{}) assert.Error(t, err) - assert.Nil(t, cm) _, err = applyRegistrationWithSync(tu, client, kubeUtil, radixClient, rr) assert.NoError(t, err) // check public key cm exists, and has same public key as RR - cm, err = client.CoreV1().ConfigMaps(utils.GetAppNamespace(appName)).Get(context.Background(), defaults.GitPublicKeyConfigMapName, metav1.GetOptions{}) + cm, err := client.CoreV1().ConfigMaps(utils.GetAppNamespace(appName)).Get(context.Background(), defaults.GitPublicKeyConfigMapName, metav1.GetOptions{}) assert.NoError(t, err) assert.NotNil(t, cm) publicKey := cm.Data[defaults.GitPublicKeyConfigMapKey] @@ -146,15 +141,14 @@ func TestOnSync_PublicKeyInCmIsEmpty_KeyIsCopiedFromRR(t *testing.T) { WithPrivateKey(somePrivateKey) // check public key cm does not exist - cm, err := client.CoreV1().ConfigMaps(utils.GetAppNamespace(appName)).Get(context.Background(), defaults.GitPublicKeyConfigMapName, metav1.GetOptions{}) + _, err := client.CoreV1().ConfigMaps(utils.GetAppNamespace(appName)).Get(context.Background(), defaults.GitPublicKeyConfigMapName, metav1.GetOptions{}) assert.Error(t, err) - assert.Nil(t, cm) _, err = applyRegistrationWithSync(tu, client, kubeUtil, radixClient, rr) assert.NoError(t, err) // delete data in public key cm - cm, err = client.CoreV1().ConfigMaps(utils.GetAppNamespace(appName)).Get(context.Background(), defaults.GitPublicKeyConfigMapName, metav1.GetOptions{}) + cm, err := client.CoreV1().ConfigMaps(utils.GetAppNamespace(appName)).Get(context.Background(), defaults.GitPublicKeyConfigMapName, metav1.GetOptions{}) assert.NoError(t, err) cm.Data = map[string]string{} _, err = client.CoreV1().ConfigMaps(utils.GetAppNamespace(appName)).Update(context.Background(), cm, metav1.UpdateOptions{}) diff --git a/pkg/client/clientset/versioned/fake/clientset_generated.go b/pkg/client/clientset/versioned/fake/clientset_generated.go index 3c9f3f173..9b42683c5 100644 --- a/pkg/client/clientset/versioned/fake/clientset_generated.go +++ b/pkg/client/clientset/versioned/fake/clientset_generated.go @@ -38,8 +38,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/radix/v1/fake/fake_radixalert.go b/pkg/client/clientset/versioned/typed/radix/v1/fake/fake_radixalert.go index 0fc4eb44b..f25bf9eda 100644 --- a/pkg/client/clientset/versioned/typed/radix/v1/fake/fake_radixalert.go +++ b/pkg/client/clientset/versioned/typed/radix/v1/fake/fake_radixalert.go @@ -48,22 +48,24 @@ var radixalertsKind = v1.SchemeGroupVersion.WithKind("RadixAlert") // Get takes name of the radixAlert, and returns the corresponding radixAlert object, and an error if there is any. func (c *FakeRadixAlerts) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.RadixAlert, err error) { + emptyResult := &v1.RadixAlert{} obj, err := c.Fake. - Invokes(testing.NewGetAction(radixalertsResource, c.ns, name), &v1.RadixAlert{}) + Invokes(testing.NewGetActionWithOptions(radixalertsResource, c.ns, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.RadixAlert), err } // List takes label and field selectors, and returns the list of RadixAlerts that match those selectors. func (c *FakeRadixAlerts) List(ctx context.Context, opts metav1.ListOptions) (result *v1.RadixAlertList, err error) { + emptyResult := &v1.RadixAlertList{} obj, err := c.Fake. - Invokes(testing.NewListAction(radixalertsResource, radixalertsKind, c.ns, opts), &v1.RadixAlertList{}) + Invokes(testing.NewListActionWithOptions(radixalertsResource, radixalertsKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -82,40 +84,43 @@ func (c *FakeRadixAlerts) List(ctx context.Context, opts metav1.ListOptions) (re // Watch returns a watch.Interface that watches the requested radixAlerts. func (c *FakeRadixAlerts) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(radixalertsResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(radixalertsResource, c.ns, opts)) } // Create takes the representation of a radixAlert and creates it. Returns the server's representation of the radixAlert, and an error, if there is any. func (c *FakeRadixAlerts) Create(ctx context.Context, radixAlert *v1.RadixAlert, opts metav1.CreateOptions) (result *v1.RadixAlert, err error) { + emptyResult := &v1.RadixAlert{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(radixalertsResource, c.ns, radixAlert), &v1.RadixAlert{}) + Invokes(testing.NewCreateActionWithOptions(radixalertsResource, c.ns, radixAlert, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.RadixAlert), err } // Update takes the representation of a radixAlert and updates it. Returns the server's representation of the radixAlert, and an error, if there is any. func (c *FakeRadixAlerts) Update(ctx context.Context, radixAlert *v1.RadixAlert, opts metav1.UpdateOptions) (result *v1.RadixAlert, err error) { + emptyResult := &v1.RadixAlert{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(radixalertsResource, c.ns, radixAlert), &v1.RadixAlert{}) + Invokes(testing.NewUpdateActionWithOptions(radixalertsResource, c.ns, radixAlert, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.RadixAlert), 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 *FakeRadixAlerts) UpdateStatus(ctx context.Context, radixAlert *v1.RadixAlert, opts metav1.UpdateOptions) (*v1.RadixAlert, error) { +func (c *FakeRadixAlerts) UpdateStatus(ctx context.Context, radixAlert *v1.RadixAlert, opts metav1.UpdateOptions) (result *v1.RadixAlert, err error) { + emptyResult := &v1.RadixAlert{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(radixalertsResource, "status", c.ns, radixAlert), &v1.RadixAlert{}) + Invokes(testing.NewUpdateSubresourceActionWithOptions(radixalertsResource, "status", c.ns, radixAlert, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.RadixAlert), err } @@ -130,7 +135,7 @@ func (c *FakeRadixAlerts) Delete(ctx context.Context, name string, opts metav1.D // DeleteCollection deletes a collection of objects. func (c *FakeRadixAlerts) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionAction(radixalertsResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(radixalertsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.RadixAlertList{}) return err @@ -138,11 +143,12 @@ func (c *FakeRadixAlerts) DeleteCollection(ctx context.Context, opts metav1.Dele // Patch applies the patch and returns the patched radixAlert. func (c *FakeRadixAlerts) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.RadixAlert, err error) { + emptyResult := &v1.RadixAlert{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(radixalertsResource, c.ns, name, pt, data, subresources...), &v1.RadixAlert{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(radixalertsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.RadixAlert), err } diff --git a/pkg/client/clientset/versioned/typed/radix/v1/fake/fake_radixapplication.go b/pkg/client/clientset/versioned/typed/radix/v1/fake/fake_radixapplication.go index 7ddf03f92..38c60b954 100644 --- a/pkg/client/clientset/versioned/typed/radix/v1/fake/fake_radixapplication.go +++ b/pkg/client/clientset/versioned/typed/radix/v1/fake/fake_radixapplication.go @@ -48,22 +48,24 @@ var radixapplicationsKind = v1.SchemeGroupVersion.WithKind("RadixApplication") // Get takes name of the radixApplication, and returns the corresponding radixApplication object, and an error if there is any. func (c *FakeRadixApplications) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.RadixApplication, err error) { + emptyResult := &v1.RadixApplication{} obj, err := c.Fake. - Invokes(testing.NewGetAction(radixapplicationsResource, c.ns, name), &v1.RadixApplication{}) + Invokes(testing.NewGetActionWithOptions(radixapplicationsResource, c.ns, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.RadixApplication), err } // List takes label and field selectors, and returns the list of RadixApplications that match those selectors. func (c *FakeRadixApplications) List(ctx context.Context, opts metav1.ListOptions) (result *v1.RadixApplicationList, err error) { + emptyResult := &v1.RadixApplicationList{} obj, err := c.Fake. - Invokes(testing.NewListAction(radixapplicationsResource, radixapplicationsKind, c.ns, opts), &v1.RadixApplicationList{}) + Invokes(testing.NewListActionWithOptions(radixapplicationsResource, radixapplicationsKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -82,28 +84,30 @@ func (c *FakeRadixApplications) List(ctx context.Context, opts metav1.ListOption // Watch returns a watch.Interface that watches the requested radixApplications. func (c *FakeRadixApplications) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(radixapplicationsResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(radixapplicationsResource, c.ns, opts)) } // Create takes the representation of a radixApplication and creates it. Returns the server's representation of the radixApplication, and an error, if there is any. func (c *FakeRadixApplications) Create(ctx context.Context, radixApplication *v1.RadixApplication, opts metav1.CreateOptions) (result *v1.RadixApplication, err error) { + emptyResult := &v1.RadixApplication{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(radixapplicationsResource, c.ns, radixApplication), &v1.RadixApplication{}) + Invokes(testing.NewCreateActionWithOptions(radixapplicationsResource, c.ns, radixApplication, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.RadixApplication), err } // Update takes the representation of a radixApplication and updates it. Returns the server's representation of the radixApplication, and an error, if there is any. func (c *FakeRadixApplications) Update(ctx context.Context, radixApplication *v1.RadixApplication, opts metav1.UpdateOptions) (result *v1.RadixApplication, err error) { + emptyResult := &v1.RadixApplication{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(radixapplicationsResource, c.ns, radixApplication), &v1.RadixApplication{}) + Invokes(testing.NewUpdateActionWithOptions(radixapplicationsResource, c.ns, radixApplication, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.RadixApplication), err } @@ -118,7 +122,7 @@ func (c *FakeRadixApplications) Delete(ctx context.Context, name string, opts me // DeleteCollection deletes a collection of objects. func (c *FakeRadixApplications) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionAction(radixapplicationsResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(radixapplicationsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.RadixApplicationList{}) return err @@ -126,11 +130,12 @@ func (c *FakeRadixApplications) DeleteCollection(ctx context.Context, opts metav // Patch applies the patch and returns the patched radixApplication. func (c *FakeRadixApplications) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.RadixApplication, err error) { + emptyResult := &v1.RadixApplication{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(radixapplicationsResource, c.ns, name, pt, data, subresources...), &v1.RadixApplication{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(radixapplicationsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.RadixApplication), err } diff --git a/pkg/client/clientset/versioned/typed/radix/v1/fake/fake_radixbatch.go b/pkg/client/clientset/versioned/typed/radix/v1/fake/fake_radixbatch.go index 7d3106baf..bde61f12e 100644 --- a/pkg/client/clientset/versioned/typed/radix/v1/fake/fake_radixbatch.go +++ b/pkg/client/clientset/versioned/typed/radix/v1/fake/fake_radixbatch.go @@ -48,22 +48,24 @@ var radixbatchesKind = v1.SchemeGroupVersion.WithKind("RadixBatch") // Get takes name of the radixBatch, and returns the corresponding radixBatch object, and an error if there is any. func (c *FakeRadixBatches) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.RadixBatch, err error) { + emptyResult := &v1.RadixBatch{} obj, err := c.Fake. - Invokes(testing.NewGetAction(radixbatchesResource, c.ns, name), &v1.RadixBatch{}) + Invokes(testing.NewGetActionWithOptions(radixbatchesResource, c.ns, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.RadixBatch), err } // List takes label and field selectors, and returns the list of RadixBatches that match those selectors. func (c *FakeRadixBatches) List(ctx context.Context, opts metav1.ListOptions) (result *v1.RadixBatchList, err error) { + emptyResult := &v1.RadixBatchList{} obj, err := c.Fake. - Invokes(testing.NewListAction(radixbatchesResource, radixbatchesKind, c.ns, opts), &v1.RadixBatchList{}) + Invokes(testing.NewListActionWithOptions(radixbatchesResource, radixbatchesKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -82,40 +84,43 @@ func (c *FakeRadixBatches) List(ctx context.Context, opts metav1.ListOptions) (r // Watch returns a watch.Interface that watches the requested radixBatches. func (c *FakeRadixBatches) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(radixbatchesResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(radixbatchesResource, c.ns, opts)) } // Create takes the representation of a radixBatch and creates it. Returns the server's representation of the radixBatch, and an error, if there is any. func (c *FakeRadixBatches) Create(ctx context.Context, radixBatch *v1.RadixBatch, opts metav1.CreateOptions) (result *v1.RadixBatch, err error) { + emptyResult := &v1.RadixBatch{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(radixbatchesResource, c.ns, radixBatch), &v1.RadixBatch{}) + Invokes(testing.NewCreateActionWithOptions(radixbatchesResource, c.ns, radixBatch, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.RadixBatch), err } // Update takes the representation of a radixBatch and updates it. Returns the server's representation of the radixBatch, and an error, if there is any. func (c *FakeRadixBatches) Update(ctx context.Context, radixBatch *v1.RadixBatch, opts metav1.UpdateOptions) (result *v1.RadixBatch, err error) { + emptyResult := &v1.RadixBatch{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(radixbatchesResource, c.ns, radixBatch), &v1.RadixBatch{}) + Invokes(testing.NewUpdateActionWithOptions(radixbatchesResource, c.ns, radixBatch, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.RadixBatch), 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 *FakeRadixBatches) UpdateStatus(ctx context.Context, radixBatch *v1.RadixBatch, opts metav1.UpdateOptions) (*v1.RadixBatch, error) { +func (c *FakeRadixBatches) UpdateStatus(ctx context.Context, radixBatch *v1.RadixBatch, opts metav1.UpdateOptions) (result *v1.RadixBatch, err error) { + emptyResult := &v1.RadixBatch{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(radixbatchesResource, "status", c.ns, radixBatch), &v1.RadixBatch{}) + Invokes(testing.NewUpdateSubresourceActionWithOptions(radixbatchesResource, "status", c.ns, radixBatch, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.RadixBatch), err } @@ -130,7 +135,7 @@ func (c *FakeRadixBatches) Delete(ctx context.Context, name string, opts metav1. // DeleteCollection deletes a collection of objects. func (c *FakeRadixBatches) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionAction(radixbatchesResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(radixbatchesResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.RadixBatchList{}) return err @@ -138,11 +143,12 @@ func (c *FakeRadixBatches) DeleteCollection(ctx context.Context, opts metav1.Del // Patch applies the patch and returns the patched radixBatch. func (c *FakeRadixBatches) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.RadixBatch, err error) { + emptyResult := &v1.RadixBatch{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(radixbatchesResource, c.ns, name, pt, data, subresources...), &v1.RadixBatch{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(radixbatchesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.RadixBatch), err } diff --git a/pkg/client/clientset/versioned/typed/radix/v1/fake/fake_radixdeployment.go b/pkg/client/clientset/versioned/typed/radix/v1/fake/fake_radixdeployment.go index d516e2555..2a36b8f60 100644 --- a/pkg/client/clientset/versioned/typed/radix/v1/fake/fake_radixdeployment.go +++ b/pkg/client/clientset/versioned/typed/radix/v1/fake/fake_radixdeployment.go @@ -48,22 +48,24 @@ var radixdeploymentsKind = v1.SchemeGroupVersion.WithKind("RadixDeployment") // Get takes name of the radixDeployment, and returns the corresponding radixDeployment object, and an error if there is any. func (c *FakeRadixDeployments) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.RadixDeployment, err error) { + emptyResult := &v1.RadixDeployment{} obj, err := c.Fake. - Invokes(testing.NewGetAction(radixdeploymentsResource, c.ns, name), &v1.RadixDeployment{}) + Invokes(testing.NewGetActionWithOptions(radixdeploymentsResource, c.ns, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.RadixDeployment), err } // List takes label and field selectors, and returns the list of RadixDeployments that match those selectors. func (c *FakeRadixDeployments) List(ctx context.Context, opts metav1.ListOptions) (result *v1.RadixDeploymentList, err error) { + emptyResult := &v1.RadixDeploymentList{} obj, err := c.Fake. - Invokes(testing.NewListAction(radixdeploymentsResource, radixdeploymentsKind, c.ns, opts), &v1.RadixDeploymentList{}) + Invokes(testing.NewListActionWithOptions(radixdeploymentsResource, radixdeploymentsKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -82,40 +84,43 @@ func (c *FakeRadixDeployments) List(ctx context.Context, opts metav1.ListOptions // Watch returns a watch.Interface that watches the requested radixDeployments. func (c *FakeRadixDeployments) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(radixdeploymentsResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(radixdeploymentsResource, c.ns, opts)) } // Create takes the representation of a radixDeployment and creates it. Returns the server's representation of the radixDeployment, and an error, if there is any. func (c *FakeRadixDeployments) Create(ctx context.Context, radixDeployment *v1.RadixDeployment, opts metav1.CreateOptions) (result *v1.RadixDeployment, err error) { + emptyResult := &v1.RadixDeployment{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(radixdeploymentsResource, c.ns, radixDeployment), &v1.RadixDeployment{}) + Invokes(testing.NewCreateActionWithOptions(radixdeploymentsResource, c.ns, radixDeployment, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.RadixDeployment), err } // Update takes the representation of a radixDeployment and updates it. Returns the server's representation of the radixDeployment, and an error, if there is any. func (c *FakeRadixDeployments) Update(ctx context.Context, radixDeployment *v1.RadixDeployment, opts metav1.UpdateOptions) (result *v1.RadixDeployment, err error) { + emptyResult := &v1.RadixDeployment{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(radixdeploymentsResource, c.ns, radixDeployment), &v1.RadixDeployment{}) + Invokes(testing.NewUpdateActionWithOptions(radixdeploymentsResource, c.ns, radixDeployment, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.RadixDeployment), 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 *FakeRadixDeployments) UpdateStatus(ctx context.Context, radixDeployment *v1.RadixDeployment, opts metav1.UpdateOptions) (*v1.RadixDeployment, error) { +func (c *FakeRadixDeployments) UpdateStatus(ctx context.Context, radixDeployment *v1.RadixDeployment, opts metav1.UpdateOptions) (result *v1.RadixDeployment, err error) { + emptyResult := &v1.RadixDeployment{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(radixdeploymentsResource, "status", c.ns, radixDeployment), &v1.RadixDeployment{}) + Invokes(testing.NewUpdateSubresourceActionWithOptions(radixdeploymentsResource, "status", c.ns, radixDeployment, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.RadixDeployment), err } @@ -130,7 +135,7 @@ func (c *FakeRadixDeployments) Delete(ctx context.Context, name string, opts met // DeleteCollection deletes a collection of objects. func (c *FakeRadixDeployments) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionAction(radixdeploymentsResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(radixdeploymentsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.RadixDeploymentList{}) return err @@ -138,11 +143,12 @@ func (c *FakeRadixDeployments) DeleteCollection(ctx context.Context, opts metav1 // Patch applies the patch and returns the patched radixDeployment. func (c *FakeRadixDeployments) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.RadixDeployment, err error) { + emptyResult := &v1.RadixDeployment{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(radixdeploymentsResource, c.ns, name, pt, data, subresources...), &v1.RadixDeployment{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(radixdeploymentsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.RadixDeployment), err } diff --git a/pkg/client/clientset/versioned/typed/radix/v1/fake/fake_radixdnsalias.go b/pkg/client/clientset/versioned/typed/radix/v1/fake/fake_radixdnsalias.go index c4ffdb2f7..fa8271e84 100644 --- a/pkg/client/clientset/versioned/typed/radix/v1/fake/fake_radixdnsalias.go +++ b/pkg/client/clientset/versioned/typed/radix/v1/fake/fake_radixdnsalias.go @@ -47,20 +47,22 @@ var radixdnsaliasesKind = v1.SchemeGroupVersion.WithKind("RadixDNSAlias") // Get takes name of the radixDNSAlias, and returns the corresponding radixDNSAlias object, and an error if there is any. func (c *FakeRadixDNSAliases) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.RadixDNSAlias, err error) { + emptyResult := &v1.RadixDNSAlias{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(radixdnsaliasesResource, name), &v1.RadixDNSAlias{}) + Invokes(testing.NewRootGetActionWithOptions(radixdnsaliasesResource, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.RadixDNSAlias), err } // List takes label and field selectors, and returns the list of RadixDNSAliases that match those selectors. func (c *FakeRadixDNSAliases) List(ctx context.Context, opts metav1.ListOptions) (result *v1.RadixDNSAliasList, err error) { + emptyResult := &v1.RadixDNSAliasList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(radixdnsaliasesResource, radixdnsaliasesKind, opts), &v1.RadixDNSAliasList{}) + Invokes(testing.NewRootListActionWithOptions(radixdnsaliasesResource, radixdnsaliasesKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -79,36 +81,39 @@ func (c *FakeRadixDNSAliases) List(ctx context.Context, opts metav1.ListOptions) // Watch returns a watch.Interface that watches the requested radixDNSAliases. func (c *FakeRadixDNSAliases) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(radixdnsaliasesResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(radixdnsaliasesResource, opts)) } // Create takes the representation of a radixDNSAlias and creates it. Returns the server's representation of the radixDNSAlias, and an error, if there is any. func (c *FakeRadixDNSAliases) Create(ctx context.Context, radixDNSAlias *v1.RadixDNSAlias, opts metav1.CreateOptions) (result *v1.RadixDNSAlias, err error) { + emptyResult := &v1.RadixDNSAlias{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(radixdnsaliasesResource, radixDNSAlias), &v1.RadixDNSAlias{}) + Invokes(testing.NewRootCreateActionWithOptions(radixdnsaliasesResource, radixDNSAlias, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.RadixDNSAlias), err } // Update takes the representation of a radixDNSAlias and updates it. Returns the server's representation of the radixDNSAlias, and an error, if there is any. func (c *FakeRadixDNSAliases) Update(ctx context.Context, radixDNSAlias *v1.RadixDNSAlias, opts metav1.UpdateOptions) (result *v1.RadixDNSAlias, err error) { + emptyResult := &v1.RadixDNSAlias{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(radixdnsaliasesResource, radixDNSAlias), &v1.RadixDNSAlias{}) + Invokes(testing.NewRootUpdateActionWithOptions(radixdnsaliasesResource, radixDNSAlias, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.RadixDNSAlias), 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 *FakeRadixDNSAliases) UpdateStatus(ctx context.Context, radixDNSAlias *v1.RadixDNSAlias, opts metav1.UpdateOptions) (*v1.RadixDNSAlias, error) { +func (c *FakeRadixDNSAliases) UpdateStatus(ctx context.Context, radixDNSAlias *v1.RadixDNSAlias, opts metav1.UpdateOptions) (result *v1.RadixDNSAlias, err error) { + emptyResult := &v1.RadixDNSAlias{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(radixdnsaliasesResource, "status", radixDNSAlias), &v1.RadixDNSAlias{}) + Invokes(testing.NewRootUpdateSubresourceActionWithOptions(radixdnsaliasesResource, "status", radixDNSAlias, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.RadixDNSAlias), err } @@ -122,7 +127,7 @@ func (c *FakeRadixDNSAliases) Delete(ctx context.Context, name string, opts meta // DeleteCollection deletes a collection of objects. func (c *FakeRadixDNSAliases) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(radixdnsaliasesResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(radixdnsaliasesResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.RadixDNSAliasList{}) return err @@ -130,10 +135,11 @@ func (c *FakeRadixDNSAliases) DeleteCollection(ctx context.Context, opts metav1. // Patch applies the patch and returns the patched radixDNSAlias. func (c *FakeRadixDNSAliases) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.RadixDNSAlias, err error) { + emptyResult := &v1.RadixDNSAlias{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(radixdnsaliasesResource, name, pt, data, subresources...), &v1.RadixDNSAlias{}) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(radixdnsaliasesResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.RadixDNSAlias), err } diff --git a/pkg/client/clientset/versioned/typed/radix/v1/fake/fake_radixenvironment.go b/pkg/client/clientset/versioned/typed/radix/v1/fake/fake_radixenvironment.go index 560ef21f8..5a29034a2 100644 --- a/pkg/client/clientset/versioned/typed/radix/v1/fake/fake_radixenvironment.go +++ b/pkg/client/clientset/versioned/typed/radix/v1/fake/fake_radixenvironment.go @@ -47,20 +47,22 @@ var radixenvironmentsKind = v1.SchemeGroupVersion.WithKind("RadixEnvironment") // Get takes name of the radixEnvironment, and returns the corresponding radixEnvironment object, and an error if there is any. func (c *FakeRadixEnvironments) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.RadixEnvironment, err error) { + emptyResult := &v1.RadixEnvironment{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(radixenvironmentsResource, name), &v1.RadixEnvironment{}) + Invokes(testing.NewRootGetActionWithOptions(radixenvironmentsResource, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.RadixEnvironment), err } // List takes label and field selectors, and returns the list of RadixEnvironments that match those selectors. func (c *FakeRadixEnvironments) List(ctx context.Context, opts metav1.ListOptions) (result *v1.RadixEnvironmentList, err error) { + emptyResult := &v1.RadixEnvironmentList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(radixenvironmentsResource, radixenvironmentsKind, opts), &v1.RadixEnvironmentList{}) + Invokes(testing.NewRootListActionWithOptions(radixenvironmentsResource, radixenvironmentsKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -79,36 +81,39 @@ func (c *FakeRadixEnvironments) List(ctx context.Context, opts metav1.ListOption // Watch returns a watch.Interface that watches the requested radixEnvironments. func (c *FakeRadixEnvironments) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(radixenvironmentsResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(radixenvironmentsResource, opts)) } // Create takes the representation of a radixEnvironment and creates it. Returns the server's representation of the radixEnvironment, and an error, if there is any. func (c *FakeRadixEnvironments) Create(ctx context.Context, radixEnvironment *v1.RadixEnvironment, opts metav1.CreateOptions) (result *v1.RadixEnvironment, err error) { + emptyResult := &v1.RadixEnvironment{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(radixenvironmentsResource, radixEnvironment), &v1.RadixEnvironment{}) + Invokes(testing.NewRootCreateActionWithOptions(radixenvironmentsResource, radixEnvironment, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.RadixEnvironment), err } // Update takes the representation of a radixEnvironment and updates it. Returns the server's representation of the radixEnvironment, and an error, if there is any. func (c *FakeRadixEnvironments) Update(ctx context.Context, radixEnvironment *v1.RadixEnvironment, opts metav1.UpdateOptions) (result *v1.RadixEnvironment, err error) { + emptyResult := &v1.RadixEnvironment{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(radixenvironmentsResource, radixEnvironment), &v1.RadixEnvironment{}) + Invokes(testing.NewRootUpdateActionWithOptions(radixenvironmentsResource, radixEnvironment, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.RadixEnvironment), 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 *FakeRadixEnvironments) UpdateStatus(ctx context.Context, radixEnvironment *v1.RadixEnvironment, opts metav1.UpdateOptions) (*v1.RadixEnvironment, error) { +func (c *FakeRadixEnvironments) UpdateStatus(ctx context.Context, radixEnvironment *v1.RadixEnvironment, opts metav1.UpdateOptions) (result *v1.RadixEnvironment, err error) { + emptyResult := &v1.RadixEnvironment{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(radixenvironmentsResource, "status", radixEnvironment), &v1.RadixEnvironment{}) + Invokes(testing.NewRootUpdateSubresourceActionWithOptions(radixenvironmentsResource, "status", radixEnvironment, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.RadixEnvironment), err } @@ -122,7 +127,7 @@ func (c *FakeRadixEnvironments) Delete(ctx context.Context, name string, opts me // DeleteCollection deletes a collection of objects. func (c *FakeRadixEnvironments) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(radixenvironmentsResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(radixenvironmentsResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.RadixEnvironmentList{}) return err @@ -130,10 +135,11 @@ func (c *FakeRadixEnvironments) DeleteCollection(ctx context.Context, opts metav // Patch applies the patch and returns the patched radixEnvironment. func (c *FakeRadixEnvironments) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.RadixEnvironment, err error) { + emptyResult := &v1.RadixEnvironment{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(radixenvironmentsResource, name, pt, data, subresources...), &v1.RadixEnvironment{}) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(radixenvironmentsResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.RadixEnvironment), err } diff --git a/pkg/client/clientset/versioned/typed/radix/v1/fake/fake_radixjob.go b/pkg/client/clientset/versioned/typed/radix/v1/fake/fake_radixjob.go index 85acd7b13..2610116b6 100644 --- a/pkg/client/clientset/versioned/typed/radix/v1/fake/fake_radixjob.go +++ b/pkg/client/clientset/versioned/typed/radix/v1/fake/fake_radixjob.go @@ -48,22 +48,24 @@ var radixjobsKind = v1.SchemeGroupVersion.WithKind("RadixJob") // Get takes name of the radixJob, and returns the corresponding radixJob object, and an error if there is any. func (c *FakeRadixJobs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.RadixJob, err error) { + emptyResult := &v1.RadixJob{} obj, err := c.Fake. - Invokes(testing.NewGetAction(radixjobsResource, c.ns, name), &v1.RadixJob{}) + Invokes(testing.NewGetActionWithOptions(radixjobsResource, c.ns, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.RadixJob), err } // List takes label and field selectors, and returns the list of RadixJobs that match those selectors. func (c *FakeRadixJobs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.RadixJobList, err error) { + emptyResult := &v1.RadixJobList{} obj, err := c.Fake. - Invokes(testing.NewListAction(radixjobsResource, radixjobsKind, c.ns, opts), &v1.RadixJobList{}) + Invokes(testing.NewListActionWithOptions(radixjobsResource, radixjobsKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -82,40 +84,43 @@ func (c *FakeRadixJobs) List(ctx context.Context, opts metav1.ListOptions) (resu // Watch returns a watch.Interface that watches the requested radixJobs. func (c *FakeRadixJobs) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(radixjobsResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(radixjobsResource, c.ns, opts)) } // Create takes the representation of a radixJob and creates it. Returns the server's representation of the radixJob, and an error, if there is any. func (c *FakeRadixJobs) Create(ctx context.Context, radixJob *v1.RadixJob, opts metav1.CreateOptions) (result *v1.RadixJob, err error) { + emptyResult := &v1.RadixJob{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(radixjobsResource, c.ns, radixJob), &v1.RadixJob{}) + Invokes(testing.NewCreateActionWithOptions(radixjobsResource, c.ns, radixJob, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.RadixJob), err } // Update takes the representation of a radixJob and updates it. Returns the server's representation of the radixJob, and an error, if there is any. func (c *FakeRadixJobs) Update(ctx context.Context, radixJob *v1.RadixJob, opts metav1.UpdateOptions) (result *v1.RadixJob, err error) { + emptyResult := &v1.RadixJob{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(radixjobsResource, c.ns, radixJob), &v1.RadixJob{}) + Invokes(testing.NewUpdateActionWithOptions(radixjobsResource, c.ns, radixJob, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.RadixJob), 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 *FakeRadixJobs) UpdateStatus(ctx context.Context, radixJob *v1.RadixJob, opts metav1.UpdateOptions) (*v1.RadixJob, error) { +func (c *FakeRadixJobs) UpdateStatus(ctx context.Context, radixJob *v1.RadixJob, opts metav1.UpdateOptions) (result *v1.RadixJob, err error) { + emptyResult := &v1.RadixJob{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(radixjobsResource, "status", c.ns, radixJob), &v1.RadixJob{}) + Invokes(testing.NewUpdateSubresourceActionWithOptions(radixjobsResource, "status", c.ns, radixJob, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.RadixJob), err } @@ -130,7 +135,7 @@ func (c *FakeRadixJobs) Delete(ctx context.Context, name string, opts metav1.Del // DeleteCollection deletes a collection of objects. func (c *FakeRadixJobs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionAction(radixjobsResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(radixjobsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.RadixJobList{}) return err @@ -138,11 +143,12 @@ func (c *FakeRadixJobs) DeleteCollection(ctx context.Context, opts metav1.Delete // Patch applies the patch and returns the patched radixJob. func (c *FakeRadixJobs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.RadixJob, err error) { + emptyResult := &v1.RadixJob{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(radixjobsResource, c.ns, name, pt, data, subresources...), &v1.RadixJob{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(radixjobsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.RadixJob), err } diff --git a/pkg/client/clientset/versioned/typed/radix/v1/fake/fake_radixregistration.go b/pkg/client/clientset/versioned/typed/radix/v1/fake/fake_radixregistration.go index 5b7b62fc4..0e91b897f 100644 --- a/pkg/client/clientset/versioned/typed/radix/v1/fake/fake_radixregistration.go +++ b/pkg/client/clientset/versioned/typed/radix/v1/fake/fake_radixregistration.go @@ -47,20 +47,22 @@ var radixregistrationsKind = v1.SchemeGroupVersion.WithKind("RadixRegistration") // Get takes name of the radixRegistration, and returns the corresponding radixRegistration object, and an error if there is any. func (c *FakeRadixRegistrations) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.RadixRegistration, err error) { + emptyResult := &v1.RadixRegistration{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(radixregistrationsResource, name), &v1.RadixRegistration{}) + Invokes(testing.NewRootGetActionWithOptions(radixregistrationsResource, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.RadixRegistration), err } // List takes label and field selectors, and returns the list of RadixRegistrations that match those selectors. func (c *FakeRadixRegistrations) List(ctx context.Context, opts metav1.ListOptions) (result *v1.RadixRegistrationList, err error) { + emptyResult := &v1.RadixRegistrationList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(radixregistrationsResource, radixregistrationsKind, opts), &v1.RadixRegistrationList{}) + Invokes(testing.NewRootListActionWithOptions(radixregistrationsResource, radixregistrationsKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -79,36 +81,39 @@ func (c *FakeRadixRegistrations) List(ctx context.Context, opts metav1.ListOptio // Watch returns a watch.Interface that watches the requested radixRegistrations. func (c *FakeRadixRegistrations) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(radixregistrationsResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(radixregistrationsResource, opts)) } // Create takes the representation of a radixRegistration and creates it. Returns the server's representation of the radixRegistration, and an error, if there is any. func (c *FakeRadixRegistrations) Create(ctx context.Context, radixRegistration *v1.RadixRegistration, opts metav1.CreateOptions) (result *v1.RadixRegistration, err error) { + emptyResult := &v1.RadixRegistration{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(radixregistrationsResource, radixRegistration), &v1.RadixRegistration{}) + Invokes(testing.NewRootCreateActionWithOptions(radixregistrationsResource, radixRegistration, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.RadixRegistration), err } // Update takes the representation of a radixRegistration and updates it. Returns the server's representation of the radixRegistration, and an error, if there is any. func (c *FakeRadixRegistrations) Update(ctx context.Context, radixRegistration *v1.RadixRegistration, opts metav1.UpdateOptions) (result *v1.RadixRegistration, err error) { + emptyResult := &v1.RadixRegistration{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(radixregistrationsResource, radixRegistration), &v1.RadixRegistration{}) + Invokes(testing.NewRootUpdateActionWithOptions(radixregistrationsResource, radixRegistration, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.RadixRegistration), 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 *FakeRadixRegistrations) UpdateStatus(ctx context.Context, radixRegistration *v1.RadixRegistration, opts metav1.UpdateOptions) (*v1.RadixRegistration, error) { +func (c *FakeRadixRegistrations) UpdateStatus(ctx context.Context, radixRegistration *v1.RadixRegistration, opts metav1.UpdateOptions) (result *v1.RadixRegistration, err error) { + emptyResult := &v1.RadixRegistration{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(radixregistrationsResource, "status", radixRegistration), &v1.RadixRegistration{}) + Invokes(testing.NewRootUpdateSubresourceActionWithOptions(radixregistrationsResource, "status", radixRegistration, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.RadixRegistration), err } @@ -122,7 +127,7 @@ func (c *FakeRadixRegistrations) Delete(ctx context.Context, name string, opts m // DeleteCollection deletes a collection of objects. func (c *FakeRadixRegistrations) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(radixregistrationsResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(radixregistrationsResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.RadixRegistrationList{}) return err @@ -130,10 +135,11 @@ func (c *FakeRadixRegistrations) DeleteCollection(ctx context.Context, opts meta // Patch applies the patch and returns the patched radixRegistration. func (c *FakeRadixRegistrations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.RadixRegistration, err error) { + emptyResult := &v1.RadixRegistration{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(radixregistrationsResource, name, pt, data, subresources...), &v1.RadixRegistration{}) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(radixregistrationsResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.RadixRegistration), err } diff --git a/pkg/client/clientset/versioned/typed/radix/v1/radixalert.go b/pkg/client/clientset/versioned/typed/radix/v1/radixalert.go index 85de10d7e..003c44749 100644 --- a/pkg/client/clientset/versioned/typed/radix/v1/radixalert.go +++ b/pkg/client/clientset/versioned/typed/radix/v1/radixalert.go @@ -27,14 +27,13 @@ package v1 import ( "context" - "time" v1 "github.com/equinor/radix-operator/pkg/apis/radix/v1" scheme "github.com/equinor/radix-operator/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" ) // RadixAlertsGetter has a method to return a RadixAlertInterface. @@ -47,6 +46,7 @@ type RadixAlertsGetter interface { type RadixAlertInterface interface { Create(ctx context.Context, radixAlert *v1.RadixAlert, opts metav1.CreateOptions) (*v1.RadixAlert, error) Update(ctx context.Context, radixAlert *v1.RadixAlert, opts metav1.UpdateOptions) (*v1.RadixAlert, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, radixAlert *v1.RadixAlert, opts metav1.UpdateOptions) (*v1.RadixAlert, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -59,144 +59,18 @@ type RadixAlertInterface interface { // radixAlerts implements RadixAlertInterface type radixAlerts struct { - client rest.Interface - ns string + *gentype.ClientWithList[*v1.RadixAlert, *v1.RadixAlertList] } // newRadixAlerts returns a RadixAlerts func newRadixAlerts(c *RadixV1Client, namespace string) *radixAlerts { return &radixAlerts{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithList[*v1.RadixAlert, *v1.RadixAlertList]( + "radixalerts", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1.RadixAlert { return &v1.RadixAlert{} }, + func() *v1.RadixAlertList { return &v1.RadixAlertList{} }), } } - -// Get takes name of the radixAlert, and returns the corresponding radixAlert object, and an error if there is any. -func (c *radixAlerts) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.RadixAlert, err error) { - result = &v1.RadixAlert{} - err = c.client.Get(). - Namespace(c.ns). - Resource("radixalerts"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of RadixAlerts that match those selectors. -func (c *radixAlerts) List(ctx context.Context, opts metav1.ListOptions) (result *v1.RadixAlertList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.RadixAlertList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("radixalerts"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested radixAlerts. -func (c *radixAlerts) 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("radixalerts"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a radixAlert and creates it. Returns the server's representation of the radixAlert, and an error, if there is any. -func (c *radixAlerts) Create(ctx context.Context, radixAlert *v1.RadixAlert, opts metav1.CreateOptions) (result *v1.RadixAlert, err error) { - result = &v1.RadixAlert{} - err = c.client.Post(). - Namespace(c.ns). - Resource("radixalerts"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(radixAlert). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a radixAlert and updates it. Returns the server's representation of the radixAlert, and an error, if there is any. -func (c *radixAlerts) Update(ctx context.Context, radixAlert *v1.RadixAlert, opts metav1.UpdateOptions) (result *v1.RadixAlert, err error) { - result = &v1.RadixAlert{} - err = c.client.Put(). - Namespace(c.ns). - Resource("radixalerts"). - Name(radixAlert.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(radixAlert). - 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 *radixAlerts) UpdateStatus(ctx context.Context, radixAlert *v1.RadixAlert, opts metav1.UpdateOptions) (result *v1.RadixAlert, err error) { - result = &v1.RadixAlert{} - err = c.client.Put(). - Namespace(c.ns). - Resource("radixalerts"). - Name(radixAlert.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(radixAlert). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the radixAlert and deletes it. Returns an error if one occurs. -func (c *radixAlerts) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("radixalerts"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *radixAlerts) 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("radixalerts"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched radixAlert. -func (c *radixAlerts) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.RadixAlert, err error) { - result = &v1.RadixAlert{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("radixalerts"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/client/clientset/versioned/typed/radix/v1/radixapplication.go b/pkg/client/clientset/versioned/typed/radix/v1/radixapplication.go index 20c3e9fd6..bd25f2e77 100644 --- a/pkg/client/clientset/versioned/typed/radix/v1/radixapplication.go +++ b/pkg/client/clientset/versioned/typed/radix/v1/radixapplication.go @@ -27,14 +27,13 @@ package v1 import ( "context" - "time" v1 "github.com/equinor/radix-operator/pkg/apis/radix/v1" scheme "github.com/equinor/radix-operator/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" ) // RadixApplicationsGetter has a method to return a RadixApplicationInterface. @@ -58,128 +57,18 @@ type RadixApplicationInterface interface { // radixApplications implements RadixApplicationInterface type radixApplications struct { - client rest.Interface - ns string + *gentype.ClientWithList[*v1.RadixApplication, *v1.RadixApplicationList] } // newRadixApplications returns a RadixApplications func newRadixApplications(c *RadixV1Client, namespace string) *radixApplications { return &radixApplications{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithList[*v1.RadixApplication, *v1.RadixApplicationList]( + "radixapplications", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1.RadixApplication { return &v1.RadixApplication{} }, + func() *v1.RadixApplicationList { return &v1.RadixApplicationList{} }), } } - -// Get takes name of the radixApplication, and returns the corresponding radixApplication object, and an error if there is any. -func (c *radixApplications) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.RadixApplication, err error) { - result = &v1.RadixApplication{} - err = c.client.Get(). - Namespace(c.ns). - Resource("radixapplications"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of RadixApplications that match those selectors. -func (c *radixApplications) List(ctx context.Context, opts metav1.ListOptions) (result *v1.RadixApplicationList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.RadixApplicationList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("radixapplications"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested radixApplications. -func (c *radixApplications) 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("radixapplications"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a radixApplication and creates it. Returns the server's representation of the radixApplication, and an error, if there is any. -func (c *radixApplications) Create(ctx context.Context, radixApplication *v1.RadixApplication, opts metav1.CreateOptions) (result *v1.RadixApplication, err error) { - result = &v1.RadixApplication{} - err = c.client.Post(). - Namespace(c.ns). - Resource("radixapplications"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(radixApplication). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a radixApplication and updates it. Returns the server's representation of the radixApplication, and an error, if there is any. -func (c *radixApplications) Update(ctx context.Context, radixApplication *v1.RadixApplication, opts metav1.UpdateOptions) (result *v1.RadixApplication, err error) { - result = &v1.RadixApplication{} - err = c.client.Put(). - Namespace(c.ns). - Resource("radixapplications"). - Name(radixApplication.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(radixApplication). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the radixApplication and deletes it. Returns an error if one occurs. -func (c *radixApplications) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("radixapplications"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *radixApplications) 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("radixapplications"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched radixApplication. -func (c *radixApplications) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.RadixApplication, err error) { - result = &v1.RadixApplication{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("radixapplications"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/client/clientset/versioned/typed/radix/v1/radixbatch.go b/pkg/client/clientset/versioned/typed/radix/v1/radixbatch.go index 0313898ad..3bbfdd222 100644 --- a/pkg/client/clientset/versioned/typed/radix/v1/radixbatch.go +++ b/pkg/client/clientset/versioned/typed/radix/v1/radixbatch.go @@ -27,14 +27,13 @@ package v1 import ( "context" - "time" v1 "github.com/equinor/radix-operator/pkg/apis/radix/v1" scheme "github.com/equinor/radix-operator/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" ) // RadixBatchesGetter has a method to return a RadixBatchInterface. @@ -47,6 +46,7 @@ type RadixBatchesGetter interface { type RadixBatchInterface interface { Create(ctx context.Context, radixBatch *v1.RadixBatch, opts metav1.CreateOptions) (*v1.RadixBatch, error) Update(ctx context.Context, radixBatch *v1.RadixBatch, opts metav1.UpdateOptions) (*v1.RadixBatch, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, radixBatch *v1.RadixBatch, opts metav1.UpdateOptions) (*v1.RadixBatch, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -59,144 +59,18 @@ type RadixBatchInterface interface { // radixBatches implements RadixBatchInterface type radixBatches struct { - client rest.Interface - ns string + *gentype.ClientWithList[*v1.RadixBatch, *v1.RadixBatchList] } // newRadixBatches returns a RadixBatches func newRadixBatches(c *RadixV1Client, namespace string) *radixBatches { return &radixBatches{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithList[*v1.RadixBatch, *v1.RadixBatchList]( + "radixbatches", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1.RadixBatch { return &v1.RadixBatch{} }, + func() *v1.RadixBatchList { return &v1.RadixBatchList{} }), } } - -// Get takes name of the radixBatch, and returns the corresponding radixBatch object, and an error if there is any. -func (c *radixBatches) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.RadixBatch, err error) { - result = &v1.RadixBatch{} - err = c.client.Get(). - Namespace(c.ns). - Resource("radixbatches"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of RadixBatches that match those selectors. -func (c *radixBatches) List(ctx context.Context, opts metav1.ListOptions) (result *v1.RadixBatchList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.RadixBatchList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("radixbatches"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested radixBatches. -func (c *radixBatches) 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("radixbatches"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a radixBatch and creates it. Returns the server's representation of the radixBatch, and an error, if there is any. -func (c *radixBatches) Create(ctx context.Context, radixBatch *v1.RadixBatch, opts metav1.CreateOptions) (result *v1.RadixBatch, err error) { - result = &v1.RadixBatch{} - err = c.client.Post(). - Namespace(c.ns). - Resource("radixbatches"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(radixBatch). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a radixBatch and updates it. Returns the server's representation of the radixBatch, and an error, if there is any. -func (c *radixBatches) Update(ctx context.Context, radixBatch *v1.RadixBatch, opts metav1.UpdateOptions) (result *v1.RadixBatch, err error) { - result = &v1.RadixBatch{} - err = c.client.Put(). - Namespace(c.ns). - Resource("radixbatches"). - Name(radixBatch.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(radixBatch). - 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 *radixBatches) UpdateStatus(ctx context.Context, radixBatch *v1.RadixBatch, opts metav1.UpdateOptions) (result *v1.RadixBatch, err error) { - result = &v1.RadixBatch{} - err = c.client.Put(). - Namespace(c.ns). - Resource("radixbatches"). - Name(radixBatch.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(radixBatch). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the radixBatch and deletes it. Returns an error if one occurs. -func (c *radixBatches) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("radixbatches"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *radixBatches) 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("radixbatches"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched radixBatch. -func (c *radixBatches) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.RadixBatch, err error) { - result = &v1.RadixBatch{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("radixbatches"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/client/clientset/versioned/typed/radix/v1/radixdeployment.go b/pkg/client/clientset/versioned/typed/radix/v1/radixdeployment.go index 284e52234..af1e168de 100644 --- a/pkg/client/clientset/versioned/typed/radix/v1/radixdeployment.go +++ b/pkg/client/clientset/versioned/typed/radix/v1/radixdeployment.go @@ -27,14 +27,13 @@ package v1 import ( "context" - "time" v1 "github.com/equinor/radix-operator/pkg/apis/radix/v1" scheme "github.com/equinor/radix-operator/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" ) // RadixDeploymentsGetter has a method to return a RadixDeploymentInterface. @@ -47,6 +46,7 @@ type RadixDeploymentsGetter interface { type RadixDeploymentInterface interface { Create(ctx context.Context, radixDeployment *v1.RadixDeployment, opts metav1.CreateOptions) (*v1.RadixDeployment, error) Update(ctx context.Context, radixDeployment *v1.RadixDeployment, opts metav1.UpdateOptions) (*v1.RadixDeployment, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, radixDeployment *v1.RadixDeployment, opts metav1.UpdateOptions) (*v1.RadixDeployment, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -59,144 +59,18 @@ type RadixDeploymentInterface interface { // radixDeployments implements RadixDeploymentInterface type radixDeployments struct { - client rest.Interface - ns string + *gentype.ClientWithList[*v1.RadixDeployment, *v1.RadixDeploymentList] } // newRadixDeployments returns a RadixDeployments func newRadixDeployments(c *RadixV1Client, namespace string) *radixDeployments { return &radixDeployments{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithList[*v1.RadixDeployment, *v1.RadixDeploymentList]( + "radixdeployments", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1.RadixDeployment { return &v1.RadixDeployment{} }, + func() *v1.RadixDeploymentList { return &v1.RadixDeploymentList{} }), } } - -// Get takes name of the radixDeployment, and returns the corresponding radixDeployment object, and an error if there is any. -func (c *radixDeployments) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.RadixDeployment, err error) { - result = &v1.RadixDeployment{} - err = c.client.Get(). - Namespace(c.ns). - Resource("radixdeployments"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of RadixDeployments that match those selectors. -func (c *radixDeployments) List(ctx context.Context, opts metav1.ListOptions) (result *v1.RadixDeploymentList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.RadixDeploymentList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("radixdeployments"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested radixDeployments. -func (c *radixDeployments) 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("radixdeployments"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a radixDeployment and creates it. Returns the server's representation of the radixDeployment, and an error, if there is any. -func (c *radixDeployments) Create(ctx context.Context, radixDeployment *v1.RadixDeployment, opts metav1.CreateOptions) (result *v1.RadixDeployment, err error) { - result = &v1.RadixDeployment{} - err = c.client.Post(). - Namespace(c.ns). - Resource("radixdeployments"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(radixDeployment). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a radixDeployment and updates it. Returns the server's representation of the radixDeployment, and an error, if there is any. -func (c *radixDeployments) Update(ctx context.Context, radixDeployment *v1.RadixDeployment, opts metav1.UpdateOptions) (result *v1.RadixDeployment, err error) { - result = &v1.RadixDeployment{} - err = c.client.Put(). - Namespace(c.ns). - Resource("radixdeployments"). - Name(radixDeployment.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(radixDeployment). - 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 *radixDeployments) UpdateStatus(ctx context.Context, radixDeployment *v1.RadixDeployment, opts metav1.UpdateOptions) (result *v1.RadixDeployment, err error) { - result = &v1.RadixDeployment{} - err = c.client.Put(). - Namespace(c.ns). - Resource("radixdeployments"). - Name(radixDeployment.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(radixDeployment). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the radixDeployment and deletes it. Returns an error if one occurs. -func (c *radixDeployments) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("radixdeployments"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *radixDeployments) 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("radixdeployments"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched radixDeployment. -func (c *radixDeployments) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.RadixDeployment, err error) { - result = &v1.RadixDeployment{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("radixdeployments"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/client/clientset/versioned/typed/radix/v1/radixdnsalias.go b/pkg/client/clientset/versioned/typed/radix/v1/radixdnsalias.go index d5599cd2b..35db0c1bc 100644 --- a/pkg/client/clientset/versioned/typed/radix/v1/radixdnsalias.go +++ b/pkg/client/clientset/versioned/typed/radix/v1/radixdnsalias.go @@ -27,14 +27,13 @@ package v1 import ( "context" - "time" v1 "github.com/equinor/radix-operator/pkg/apis/radix/v1" scheme "github.com/equinor/radix-operator/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" ) // RadixDNSAliasesGetter has a method to return a RadixDNSAliasInterface. @@ -47,6 +46,7 @@ type RadixDNSAliasesGetter interface { type RadixDNSAliasInterface interface { Create(ctx context.Context, radixDNSAlias *v1.RadixDNSAlias, opts metav1.CreateOptions) (*v1.RadixDNSAlias, error) Update(ctx context.Context, radixDNSAlias *v1.RadixDNSAlias, opts metav1.UpdateOptions) (*v1.RadixDNSAlias, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, radixDNSAlias *v1.RadixDNSAlias, opts metav1.UpdateOptions) (*v1.RadixDNSAlias, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -59,133 +59,18 @@ type RadixDNSAliasInterface interface { // radixDNSAliases implements RadixDNSAliasInterface type radixDNSAliases struct { - client rest.Interface + *gentype.ClientWithList[*v1.RadixDNSAlias, *v1.RadixDNSAliasList] } // newRadixDNSAliases returns a RadixDNSAliases func newRadixDNSAliases(c *RadixV1Client) *radixDNSAliases { return &radixDNSAliases{ - client: c.RESTClient(), + gentype.NewClientWithList[*v1.RadixDNSAlias, *v1.RadixDNSAliasList]( + "radixdnsaliases", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1.RadixDNSAlias { return &v1.RadixDNSAlias{} }, + func() *v1.RadixDNSAliasList { return &v1.RadixDNSAliasList{} }), } } - -// Get takes name of the radixDNSAlias, and returns the corresponding radixDNSAlias object, and an error if there is any. -func (c *radixDNSAliases) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.RadixDNSAlias, err error) { - result = &v1.RadixDNSAlias{} - err = c.client.Get(). - Resource("radixdnsaliases"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of RadixDNSAliases that match those selectors. -func (c *radixDNSAliases) List(ctx context.Context, opts metav1.ListOptions) (result *v1.RadixDNSAliasList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.RadixDNSAliasList{} - err = c.client.Get(). - Resource("radixdnsaliases"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested radixDNSAliases. -func (c *radixDNSAliases) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("radixdnsaliases"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a radixDNSAlias and creates it. Returns the server's representation of the radixDNSAlias, and an error, if there is any. -func (c *radixDNSAliases) Create(ctx context.Context, radixDNSAlias *v1.RadixDNSAlias, opts metav1.CreateOptions) (result *v1.RadixDNSAlias, err error) { - result = &v1.RadixDNSAlias{} - err = c.client.Post(). - Resource("radixdnsaliases"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(radixDNSAlias). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a radixDNSAlias and updates it. Returns the server's representation of the radixDNSAlias, and an error, if there is any. -func (c *radixDNSAliases) Update(ctx context.Context, radixDNSAlias *v1.RadixDNSAlias, opts metav1.UpdateOptions) (result *v1.RadixDNSAlias, err error) { - result = &v1.RadixDNSAlias{} - err = c.client.Put(). - Resource("radixdnsaliases"). - Name(radixDNSAlias.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(radixDNSAlias). - 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 *radixDNSAliases) UpdateStatus(ctx context.Context, radixDNSAlias *v1.RadixDNSAlias, opts metav1.UpdateOptions) (result *v1.RadixDNSAlias, err error) { - result = &v1.RadixDNSAlias{} - err = c.client.Put(). - Resource("radixdnsaliases"). - Name(radixDNSAlias.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(radixDNSAlias). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the radixDNSAlias and deletes it. Returns an error if one occurs. -func (c *radixDNSAliases) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("radixdnsaliases"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *radixDNSAliases) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("radixdnsaliases"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched radixDNSAlias. -func (c *radixDNSAliases) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.RadixDNSAlias, err error) { - result = &v1.RadixDNSAlias{} - err = c.client.Patch(pt). - Resource("radixdnsaliases"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/client/clientset/versioned/typed/radix/v1/radixenvironment.go b/pkg/client/clientset/versioned/typed/radix/v1/radixenvironment.go index 345b63c4c..58504c511 100644 --- a/pkg/client/clientset/versioned/typed/radix/v1/radixenvironment.go +++ b/pkg/client/clientset/versioned/typed/radix/v1/radixenvironment.go @@ -27,14 +27,13 @@ package v1 import ( "context" - "time" v1 "github.com/equinor/radix-operator/pkg/apis/radix/v1" scheme "github.com/equinor/radix-operator/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" ) // RadixEnvironmentsGetter has a method to return a RadixEnvironmentInterface. @@ -47,6 +46,7 @@ type RadixEnvironmentsGetter interface { type RadixEnvironmentInterface interface { Create(ctx context.Context, radixEnvironment *v1.RadixEnvironment, opts metav1.CreateOptions) (*v1.RadixEnvironment, error) Update(ctx context.Context, radixEnvironment *v1.RadixEnvironment, opts metav1.UpdateOptions) (*v1.RadixEnvironment, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, radixEnvironment *v1.RadixEnvironment, opts metav1.UpdateOptions) (*v1.RadixEnvironment, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -59,133 +59,18 @@ type RadixEnvironmentInterface interface { // radixEnvironments implements RadixEnvironmentInterface type radixEnvironments struct { - client rest.Interface + *gentype.ClientWithList[*v1.RadixEnvironment, *v1.RadixEnvironmentList] } // newRadixEnvironments returns a RadixEnvironments func newRadixEnvironments(c *RadixV1Client) *radixEnvironments { return &radixEnvironments{ - client: c.RESTClient(), + gentype.NewClientWithList[*v1.RadixEnvironment, *v1.RadixEnvironmentList]( + "radixenvironments", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1.RadixEnvironment { return &v1.RadixEnvironment{} }, + func() *v1.RadixEnvironmentList { return &v1.RadixEnvironmentList{} }), } } - -// Get takes name of the radixEnvironment, and returns the corresponding radixEnvironment object, and an error if there is any. -func (c *radixEnvironments) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.RadixEnvironment, err error) { - result = &v1.RadixEnvironment{} - err = c.client.Get(). - Resource("radixenvironments"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of RadixEnvironments that match those selectors. -func (c *radixEnvironments) List(ctx context.Context, opts metav1.ListOptions) (result *v1.RadixEnvironmentList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.RadixEnvironmentList{} - err = c.client.Get(). - Resource("radixenvironments"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested radixEnvironments. -func (c *radixEnvironments) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("radixenvironments"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a radixEnvironment and creates it. Returns the server's representation of the radixEnvironment, and an error, if there is any. -func (c *radixEnvironments) Create(ctx context.Context, radixEnvironment *v1.RadixEnvironment, opts metav1.CreateOptions) (result *v1.RadixEnvironment, err error) { - result = &v1.RadixEnvironment{} - err = c.client.Post(). - Resource("radixenvironments"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(radixEnvironment). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a radixEnvironment and updates it. Returns the server's representation of the radixEnvironment, and an error, if there is any. -func (c *radixEnvironments) Update(ctx context.Context, radixEnvironment *v1.RadixEnvironment, opts metav1.UpdateOptions) (result *v1.RadixEnvironment, err error) { - result = &v1.RadixEnvironment{} - err = c.client.Put(). - Resource("radixenvironments"). - Name(radixEnvironment.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(radixEnvironment). - 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 *radixEnvironments) UpdateStatus(ctx context.Context, radixEnvironment *v1.RadixEnvironment, opts metav1.UpdateOptions) (result *v1.RadixEnvironment, err error) { - result = &v1.RadixEnvironment{} - err = c.client.Put(). - Resource("radixenvironments"). - Name(radixEnvironment.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(radixEnvironment). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the radixEnvironment and deletes it. Returns an error if one occurs. -func (c *radixEnvironments) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("radixenvironments"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *radixEnvironments) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("radixenvironments"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched radixEnvironment. -func (c *radixEnvironments) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.RadixEnvironment, err error) { - result = &v1.RadixEnvironment{} - err = c.client.Patch(pt). - Resource("radixenvironments"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/client/clientset/versioned/typed/radix/v1/radixjob.go b/pkg/client/clientset/versioned/typed/radix/v1/radixjob.go index 06a1aeb14..06a52f6b4 100644 --- a/pkg/client/clientset/versioned/typed/radix/v1/radixjob.go +++ b/pkg/client/clientset/versioned/typed/radix/v1/radixjob.go @@ -27,14 +27,13 @@ package v1 import ( "context" - "time" v1 "github.com/equinor/radix-operator/pkg/apis/radix/v1" scheme "github.com/equinor/radix-operator/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" ) // RadixJobsGetter has a method to return a RadixJobInterface. @@ -47,6 +46,7 @@ type RadixJobsGetter interface { type RadixJobInterface interface { Create(ctx context.Context, radixJob *v1.RadixJob, opts metav1.CreateOptions) (*v1.RadixJob, error) Update(ctx context.Context, radixJob *v1.RadixJob, opts metav1.UpdateOptions) (*v1.RadixJob, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, radixJob *v1.RadixJob, opts metav1.UpdateOptions) (*v1.RadixJob, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -59,144 +59,18 @@ type RadixJobInterface interface { // radixJobs implements RadixJobInterface type radixJobs struct { - client rest.Interface - ns string + *gentype.ClientWithList[*v1.RadixJob, *v1.RadixJobList] } // newRadixJobs returns a RadixJobs func newRadixJobs(c *RadixV1Client, namespace string) *radixJobs { return &radixJobs{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithList[*v1.RadixJob, *v1.RadixJobList]( + "radixjobs", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1.RadixJob { return &v1.RadixJob{} }, + func() *v1.RadixJobList { return &v1.RadixJobList{} }), } } - -// Get takes name of the radixJob, and returns the corresponding radixJob object, and an error if there is any. -func (c *radixJobs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.RadixJob, err error) { - result = &v1.RadixJob{} - err = c.client.Get(). - Namespace(c.ns). - Resource("radixjobs"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of RadixJobs that match those selectors. -func (c *radixJobs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.RadixJobList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.RadixJobList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("radixjobs"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested radixJobs. -func (c *radixJobs) 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("radixjobs"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a radixJob and creates it. Returns the server's representation of the radixJob, and an error, if there is any. -func (c *radixJobs) Create(ctx context.Context, radixJob *v1.RadixJob, opts metav1.CreateOptions) (result *v1.RadixJob, err error) { - result = &v1.RadixJob{} - err = c.client.Post(). - Namespace(c.ns). - Resource("radixjobs"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(radixJob). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a radixJob and updates it. Returns the server's representation of the radixJob, and an error, if there is any. -func (c *radixJobs) Update(ctx context.Context, radixJob *v1.RadixJob, opts metav1.UpdateOptions) (result *v1.RadixJob, err error) { - result = &v1.RadixJob{} - err = c.client.Put(). - Namespace(c.ns). - Resource("radixjobs"). - Name(radixJob.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(radixJob). - 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 *radixJobs) UpdateStatus(ctx context.Context, radixJob *v1.RadixJob, opts metav1.UpdateOptions) (result *v1.RadixJob, err error) { - result = &v1.RadixJob{} - err = c.client.Put(). - Namespace(c.ns). - Resource("radixjobs"). - Name(radixJob.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(radixJob). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the radixJob and deletes it. Returns an error if one occurs. -func (c *radixJobs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("radixjobs"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *radixJobs) 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("radixjobs"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched radixJob. -func (c *radixJobs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.RadixJob, err error) { - result = &v1.RadixJob{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("radixjobs"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/client/clientset/versioned/typed/radix/v1/radixregistration.go b/pkg/client/clientset/versioned/typed/radix/v1/radixregistration.go index f3c8afeea..c941558ad 100644 --- a/pkg/client/clientset/versioned/typed/radix/v1/radixregistration.go +++ b/pkg/client/clientset/versioned/typed/radix/v1/radixregistration.go @@ -27,14 +27,13 @@ package v1 import ( "context" - "time" v1 "github.com/equinor/radix-operator/pkg/apis/radix/v1" scheme "github.com/equinor/radix-operator/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" ) // RadixRegistrationsGetter has a method to return a RadixRegistrationInterface. @@ -47,6 +46,7 @@ type RadixRegistrationsGetter interface { type RadixRegistrationInterface interface { Create(ctx context.Context, radixRegistration *v1.RadixRegistration, opts metav1.CreateOptions) (*v1.RadixRegistration, error) Update(ctx context.Context, radixRegistration *v1.RadixRegistration, opts metav1.UpdateOptions) (*v1.RadixRegistration, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, radixRegistration *v1.RadixRegistration, opts metav1.UpdateOptions) (*v1.RadixRegistration, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -59,133 +59,18 @@ type RadixRegistrationInterface interface { // radixRegistrations implements RadixRegistrationInterface type radixRegistrations struct { - client rest.Interface + *gentype.ClientWithList[*v1.RadixRegistration, *v1.RadixRegistrationList] } // newRadixRegistrations returns a RadixRegistrations func newRadixRegistrations(c *RadixV1Client) *radixRegistrations { return &radixRegistrations{ - client: c.RESTClient(), + gentype.NewClientWithList[*v1.RadixRegistration, *v1.RadixRegistrationList]( + "radixregistrations", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1.RadixRegistration { return &v1.RadixRegistration{} }, + func() *v1.RadixRegistrationList { return &v1.RadixRegistrationList{} }), } } - -// Get takes name of the radixRegistration, and returns the corresponding radixRegistration object, and an error if there is any. -func (c *radixRegistrations) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.RadixRegistration, err error) { - result = &v1.RadixRegistration{} - err = c.client.Get(). - Resource("radixregistrations"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of RadixRegistrations that match those selectors. -func (c *radixRegistrations) List(ctx context.Context, opts metav1.ListOptions) (result *v1.RadixRegistrationList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.RadixRegistrationList{} - err = c.client.Get(). - Resource("radixregistrations"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested radixRegistrations. -func (c *radixRegistrations) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("radixregistrations"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a radixRegistration and creates it. Returns the server's representation of the radixRegistration, and an error, if there is any. -func (c *radixRegistrations) Create(ctx context.Context, radixRegistration *v1.RadixRegistration, opts metav1.CreateOptions) (result *v1.RadixRegistration, err error) { - result = &v1.RadixRegistration{} - err = c.client.Post(). - Resource("radixregistrations"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(radixRegistration). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a radixRegistration and updates it. Returns the server's representation of the radixRegistration, and an error, if there is any. -func (c *radixRegistrations) Update(ctx context.Context, radixRegistration *v1.RadixRegistration, opts metav1.UpdateOptions) (result *v1.RadixRegistration, err error) { - result = &v1.RadixRegistration{} - err = c.client.Put(). - Resource("radixregistrations"). - Name(radixRegistration.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(radixRegistration). - 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 *radixRegistrations) UpdateStatus(ctx context.Context, radixRegistration *v1.RadixRegistration, opts metav1.UpdateOptions) (result *v1.RadixRegistration, err error) { - result = &v1.RadixRegistration{} - err = c.client.Put(). - Resource("radixregistrations"). - Name(radixRegistration.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(radixRegistration). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the radixRegistration and deletes it. Returns an error if one occurs. -func (c *radixRegistrations) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("radixregistrations"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *radixRegistrations) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("radixregistrations"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched radixRegistration. -func (c *radixRegistrations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.RadixRegistration, err error) { - result = &v1.RadixRegistration{} - err = c.client.Patch(pt). - Resource("radixregistrations"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/client/informers/externalversions/factory.go b/pkg/client/informers/externalversions/factory.go index 31e6d9caa..dbb461632 100644 --- a/pkg/client/informers/externalversions/factory.go +++ b/pkg/client/informers/externalversions/factory.go @@ -235,6 +235,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/radix/v1/radixalert.go b/pkg/client/listers/radix/v1/radixalert.go index 2dd9755e4..8c11ddf63 100644 --- a/pkg/client/listers/radix/v1/radixalert.go +++ b/pkg/client/listers/radix/v1/radixalert.go @@ -27,8 +27,8 @@ package v1 import ( v1 "github.com/equinor/radix-operator/pkg/apis/radix/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -45,25 +45,17 @@ type RadixAlertLister interface { // radixAlertLister implements the RadixAlertLister interface. type radixAlertLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.RadixAlert] } // NewRadixAlertLister returns a new RadixAlertLister. func NewRadixAlertLister(indexer cache.Indexer) RadixAlertLister { - return &radixAlertLister{indexer: indexer} -} - -// List lists all RadixAlerts in the indexer. -func (s *radixAlertLister) List(selector labels.Selector) (ret []*v1.RadixAlert, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.RadixAlert)) - }) - return ret, err + return &radixAlertLister{listers.New[*v1.RadixAlert](indexer, v1.Resource("radixalert"))} } // RadixAlerts returns an object that can list and get RadixAlerts. func (s *radixAlertLister) RadixAlerts(namespace string) RadixAlertNamespaceLister { - return radixAlertNamespaceLister{indexer: s.indexer, namespace: namespace} + return radixAlertNamespaceLister{listers.NewNamespaced[*v1.RadixAlert](s.ResourceIndexer, namespace)} } // RadixAlertNamespaceLister helps list and get RadixAlerts. @@ -81,26 +73,5 @@ type RadixAlertNamespaceLister interface { // radixAlertNamespaceLister implements the RadixAlertNamespaceLister // interface. type radixAlertNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all RadixAlerts in the indexer for a given namespace. -func (s radixAlertNamespaceLister) List(selector labels.Selector) (ret []*v1.RadixAlert, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1.RadixAlert)) - }) - return ret, err -} - -// Get retrieves the RadixAlert from the indexer for a given namespace and name. -func (s radixAlertNamespaceLister) Get(name string) (*v1.RadixAlert, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("radixalert"), name) - } - return obj.(*v1.RadixAlert), nil + listers.ResourceIndexer[*v1.RadixAlert] } diff --git a/pkg/client/listers/radix/v1/radixapplication.go b/pkg/client/listers/radix/v1/radixapplication.go index 5863ef61e..bee061d86 100644 --- a/pkg/client/listers/radix/v1/radixapplication.go +++ b/pkg/client/listers/radix/v1/radixapplication.go @@ -27,8 +27,8 @@ package v1 import ( v1 "github.com/equinor/radix-operator/pkg/apis/radix/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -45,25 +45,17 @@ type RadixApplicationLister interface { // radixApplicationLister implements the RadixApplicationLister interface. type radixApplicationLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.RadixApplication] } // NewRadixApplicationLister returns a new RadixApplicationLister. func NewRadixApplicationLister(indexer cache.Indexer) RadixApplicationLister { - return &radixApplicationLister{indexer: indexer} -} - -// List lists all RadixApplications in the indexer. -func (s *radixApplicationLister) List(selector labels.Selector) (ret []*v1.RadixApplication, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.RadixApplication)) - }) - return ret, err + return &radixApplicationLister{listers.New[*v1.RadixApplication](indexer, v1.Resource("radixapplication"))} } // RadixApplications returns an object that can list and get RadixApplications. func (s *radixApplicationLister) RadixApplications(namespace string) RadixApplicationNamespaceLister { - return radixApplicationNamespaceLister{indexer: s.indexer, namespace: namespace} + return radixApplicationNamespaceLister{listers.NewNamespaced[*v1.RadixApplication](s.ResourceIndexer, namespace)} } // RadixApplicationNamespaceLister helps list and get RadixApplications. @@ -81,26 +73,5 @@ type RadixApplicationNamespaceLister interface { // radixApplicationNamespaceLister implements the RadixApplicationNamespaceLister // interface. type radixApplicationNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all RadixApplications in the indexer for a given namespace. -func (s radixApplicationNamespaceLister) List(selector labels.Selector) (ret []*v1.RadixApplication, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1.RadixApplication)) - }) - return ret, err -} - -// Get retrieves the RadixApplication from the indexer for a given namespace and name. -func (s radixApplicationNamespaceLister) Get(name string) (*v1.RadixApplication, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("radixapplication"), name) - } - return obj.(*v1.RadixApplication), nil + listers.ResourceIndexer[*v1.RadixApplication] } diff --git a/pkg/client/listers/radix/v1/radixbatch.go b/pkg/client/listers/radix/v1/radixbatch.go index ea4b7fcf0..8c146279a 100644 --- a/pkg/client/listers/radix/v1/radixbatch.go +++ b/pkg/client/listers/radix/v1/radixbatch.go @@ -27,8 +27,8 @@ package v1 import ( v1 "github.com/equinor/radix-operator/pkg/apis/radix/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -45,25 +45,17 @@ type RadixBatchLister interface { // radixBatchLister implements the RadixBatchLister interface. type radixBatchLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.RadixBatch] } // NewRadixBatchLister returns a new RadixBatchLister. func NewRadixBatchLister(indexer cache.Indexer) RadixBatchLister { - return &radixBatchLister{indexer: indexer} -} - -// List lists all RadixBatches in the indexer. -func (s *radixBatchLister) List(selector labels.Selector) (ret []*v1.RadixBatch, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.RadixBatch)) - }) - return ret, err + return &radixBatchLister{listers.New[*v1.RadixBatch](indexer, v1.Resource("radixbatch"))} } // RadixBatches returns an object that can list and get RadixBatches. func (s *radixBatchLister) RadixBatches(namespace string) RadixBatchNamespaceLister { - return radixBatchNamespaceLister{indexer: s.indexer, namespace: namespace} + return radixBatchNamespaceLister{listers.NewNamespaced[*v1.RadixBatch](s.ResourceIndexer, namespace)} } // RadixBatchNamespaceLister helps list and get RadixBatches. @@ -81,26 +73,5 @@ type RadixBatchNamespaceLister interface { // radixBatchNamespaceLister implements the RadixBatchNamespaceLister // interface. type radixBatchNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all RadixBatches in the indexer for a given namespace. -func (s radixBatchNamespaceLister) List(selector labels.Selector) (ret []*v1.RadixBatch, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1.RadixBatch)) - }) - return ret, err -} - -// Get retrieves the RadixBatch from the indexer for a given namespace and name. -func (s radixBatchNamespaceLister) Get(name string) (*v1.RadixBatch, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("radixbatch"), name) - } - return obj.(*v1.RadixBatch), nil + listers.ResourceIndexer[*v1.RadixBatch] } diff --git a/pkg/client/listers/radix/v1/radixdeployment.go b/pkg/client/listers/radix/v1/radixdeployment.go index 89a33c424..299cebbd6 100644 --- a/pkg/client/listers/radix/v1/radixdeployment.go +++ b/pkg/client/listers/radix/v1/radixdeployment.go @@ -27,8 +27,8 @@ package v1 import ( v1 "github.com/equinor/radix-operator/pkg/apis/radix/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -45,25 +45,17 @@ type RadixDeploymentLister interface { // radixDeploymentLister implements the RadixDeploymentLister interface. type radixDeploymentLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.RadixDeployment] } // NewRadixDeploymentLister returns a new RadixDeploymentLister. func NewRadixDeploymentLister(indexer cache.Indexer) RadixDeploymentLister { - return &radixDeploymentLister{indexer: indexer} -} - -// List lists all RadixDeployments in the indexer. -func (s *radixDeploymentLister) List(selector labels.Selector) (ret []*v1.RadixDeployment, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.RadixDeployment)) - }) - return ret, err + return &radixDeploymentLister{listers.New[*v1.RadixDeployment](indexer, v1.Resource("radixdeployment"))} } // RadixDeployments returns an object that can list and get RadixDeployments. func (s *radixDeploymentLister) RadixDeployments(namespace string) RadixDeploymentNamespaceLister { - return radixDeploymentNamespaceLister{indexer: s.indexer, namespace: namespace} + return radixDeploymentNamespaceLister{listers.NewNamespaced[*v1.RadixDeployment](s.ResourceIndexer, namespace)} } // RadixDeploymentNamespaceLister helps list and get RadixDeployments. @@ -81,26 +73,5 @@ type RadixDeploymentNamespaceLister interface { // radixDeploymentNamespaceLister implements the RadixDeploymentNamespaceLister // interface. type radixDeploymentNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all RadixDeployments in the indexer for a given namespace. -func (s radixDeploymentNamespaceLister) List(selector labels.Selector) (ret []*v1.RadixDeployment, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1.RadixDeployment)) - }) - return ret, err -} - -// Get retrieves the RadixDeployment from the indexer for a given namespace and name. -func (s radixDeploymentNamespaceLister) Get(name string) (*v1.RadixDeployment, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("radixdeployment"), name) - } - return obj.(*v1.RadixDeployment), nil + listers.ResourceIndexer[*v1.RadixDeployment] } diff --git a/pkg/client/listers/radix/v1/radixdnsalias.go b/pkg/client/listers/radix/v1/radixdnsalias.go index 3f486e10c..169da0979 100644 --- a/pkg/client/listers/radix/v1/radixdnsalias.go +++ b/pkg/client/listers/radix/v1/radixdnsalias.go @@ -27,8 +27,8 @@ package v1 import ( v1 "github.com/equinor/radix-operator/pkg/apis/radix/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -46,30 +46,10 @@ type RadixDNSAliasLister interface { // radixDNSAliasLister implements the RadixDNSAliasLister interface. type radixDNSAliasLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.RadixDNSAlias] } // NewRadixDNSAliasLister returns a new RadixDNSAliasLister. func NewRadixDNSAliasLister(indexer cache.Indexer) RadixDNSAliasLister { - return &radixDNSAliasLister{indexer: indexer} -} - -// List lists all RadixDNSAliases in the indexer. -func (s *radixDNSAliasLister) List(selector labels.Selector) (ret []*v1.RadixDNSAlias, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.RadixDNSAlias)) - }) - return ret, err -} - -// Get retrieves the RadixDNSAlias from the index for a given name. -func (s *radixDNSAliasLister) Get(name string) (*v1.RadixDNSAlias, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("radixdnsalias"), name) - } - return obj.(*v1.RadixDNSAlias), nil + return &radixDNSAliasLister{listers.New[*v1.RadixDNSAlias](indexer, v1.Resource("radixdnsalias"))} } diff --git a/pkg/client/listers/radix/v1/radixenvironment.go b/pkg/client/listers/radix/v1/radixenvironment.go index 3b0ff765f..ad90cb225 100644 --- a/pkg/client/listers/radix/v1/radixenvironment.go +++ b/pkg/client/listers/radix/v1/radixenvironment.go @@ -27,8 +27,8 @@ package v1 import ( v1 "github.com/equinor/radix-operator/pkg/apis/radix/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -46,30 +46,10 @@ type RadixEnvironmentLister interface { // radixEnvironmentLister implements the RadixEnvironmentLister interface. type radixEnvironmentLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.RadixEnvironment] } // NewRadixEnvironmentLister returns a new RadixEnvironmentLister. func NewRadixEnvironmentLister(indexer cache.Indexer) RadixEnvironmentLister { - return &radixEnvironmentLister{indexer: indexer} -} - -// List lists all RadixEnvironments in the indexer. -func (s *radixEnvironmentLister) List(selector labels.Selector) (ret []*v1.RadixEnvironment, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.RadixEnvironment)) - }) - return ret, err -} - -// Get retrieves the RadixEnvironment from the index for a given name. -func (s *radixEnvironmentLister) Get(name string) (*v1.RadixEnvironment, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("radixenvironment"), name) - } - return obj.(*v1.RadixEnvironment), nil + return &radixEnvironmentLister{listers.New[*v1.RadixEnvironment](indexer, v1.Resource("radixenvironment"))} } diff --git a/pkg/client/listers/radix/v1/radixjob.go b/pkg/client/listers/radix/v1/radixjob.go index 6d7f10e75..6a28b6259 100644 --- a/pkg/client/listers/radix/v1/radixjob.go +++ b/pkg/client/listers/radix/v1/radixjob.go @@ -27,8 +27,8 @@ package v1 import ( v1 "github.com/equinor/radix-operator/pkg/apis/radix/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -45,25 +45,17 @@ type RadixJobLister interface { // radixJobLister implements the RadixJobLister interface. type radixJobLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.RadixJob] } // NewRadixJobLister returns a new RadixJobLister. func NewRadixJobLister(indexer cache.Indexer) RadixJobLister { - return &radixJobLister{indexer: indexer} -} - -// List lists all RadixJobs in the indexer. -func (s *radixJobLister) List(selector labels.Selector) (ret []*v1.RadixJob, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.RadixJob)) - }) - return ret, err + return &radixJobLister{listers.New[*v1.RadixJob](indexer, v1.Resource("radixjob"))} } // RadixJobs returns an object that can list and get RadixJobs. func (s *radixJobLister) RadixJobs(namespace string) RadixJobNamespaceLister { - return radixJobNamespaceLister{indexer: s.indexer, namespace: namespace} + return radixJobNamespaceLister{listers.NewNamespaced[*v1.RadixJob](s.ResourceIndexer, namespace)} } // RadixJobNamespaceLister helps list and get RadixJobs. @@ -81,26 +73,5 @@ type RadixJobNamespaceLister interface { // radixJobNamespaceLister implements the RadixJobNamespaceLister // interface. type radixJobNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all RadixJobs in the indexer for a given namespace. -func (s radixJobNamespaceLister) List(selector labels.Selector) (ret []*v1.RadixJob, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1.RadixJob)) - }) - return ret, err -} - -// Get retrieves the RadixJob from the indexer for a given namespace and name. -func (s radixJobNamespaceLister) Get(name string) (*v1.RadixJob, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("radixjob"), name) - } - return obj.(*v1.RadixJob), nil + listers.ResourceIndexer[*v1.RadixJob] } diff --git a/pkg/client/listers/radix/v1/radixregistration.go b/pkg/client/listers/radix/v1/radixregistration.go index 52ae90db7..e70022a5c 100644 --- a/pkg/client/listers/radix/v1/radixregistration.go +++ b/pkg/client/listers/radix/v1/radixregistration.go @@ -27,8 +27,8 @@ package v1 import ( v1 "github.com/equinor/radix-operator/pkg/apis/radix/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -46,30 +46,10 @@ type RadixRegistrationLister interface { // radixRegistrationLister implements the RadixRegistrationLister interface. type radixRegistrationLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.RadixRegistration] } // NewRadixRegistrationLister returns a new RadixRegistrationLister. func NewRadixRegistrationLister(indexer cache.Indexer) RadixRegistrationLister { - return &radixRegistrationLister{indexer: indexer} -} - -// List lists all RadixRegistrations in the indexer. -func (s *radixRegistrationLister) List(selector labels.Selector) (ret []*v1.RadixRegistration, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.RadixRegistration)) - }) - return ret, err -} - -// Get retrieves the RadixRegistration from the index for a given name. -func (s *radixRegistrationLister) Get(name string) (*v1.RadixRegistration, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("radixregistration"), name) - } - return obj.(*v1.RadixRegistration), nil + return &radixRegistrationLister{listers.New[*v1.RadixRegistration](indexer, v1.Resource("radixregistration"))} } diff --git a/radix-operator/alert/controller.go b/radix-operator/alert/controller.go index a1c9768f4..4262ee40a 100644 --- a/radix-operator/alert/controller.go +++ b/radix-operator/alert/controller.go @@ -96,7 +96,7 @@ func NewController(ctx context.Context, return } - // If neither admin or reader AD groups change, this + // If neither admin nor reader AD groups change, this // does not affect the alert if radixutils.ArrayEqualElements(newRr.Spec.AdGroups, oldRr.Spec.AdGroups) && radixutils.ArrayEqualElements(newRr.Spec.ReaderAdGroups, oldRr.Spec.ReaderAdGroups) { @@ -104,11 +104,11 @@ func NewController(ctx context.Context, } // Enqueue all RadixAlerts with radix-app label matching name of RR - radixalerts, err := radixClient.RadixV1().RadixAlerts(corev1.NamespaceAll).List(ctx, v1.ListOptions{ + radixAlertList, err := radixClient.RadixV1().RadixAlerts(corev1.NamespaceAll).List(ctx, v1.ListOptions{ LabelSelector: fmt.Sprintf("%s=%s", kube.RadixAppLabel, newRr.Name), }) if err == nil { - for _, radixalert := range radixalerts.Items { + for _, radixalert := range radixAlertList.Items { if _, err := controller.Enqueue(&radixalert); err != nil { logger.Error().Err(err).Msg("Failed to enqueue object received from RadixRegistration informer UpdateFunc") } diff --git a/radix-operator/common/controller.go b/radix-operator/common/controller.go index 72da20909..80b608080 100644 --- a/radix-operator/common/controller.go +++ b/radix-operator/common/controller.go @@ -26,7 +26,7 @@ type Controller struct { HandlerOf string KubeClient kubernetes.Interface RadixClient radixclient.Interface - WorkQueue workqueue.RateLimitingInterface + WorkQueue workqueue.TypedRateLimitingInterface[string] KubeInformerFactory kubeinformers.SharedInformerFactory RadixInformerFactory informers.SharedInformerFactory Handler Handler @@ -40,7 +40,7 @@ func (c *Controller) Run(ctx context.Context, threadiness int) error { defer utilruntime.HandleCrash() if c.LockKeyAndIdentifier == nil { - return errors.New("LockKeyandIdentifier must be set") + return errors.New("LockKeyAndIdentifier must be set") } // Start the informer factories to begin populating the informer caches @@ -103,7 +103,7 @@ func (c *Controller) processNext(ctx context.Context, errorGroup *errgroup.Group c.WorkQueue.Done(workItem) }() - if workItem == nil || fmt.Sprint(workItem) == "" { + if workItem == "" { return nil } @@ -128,17 +128,17 @@ func (c *Controller) processNext(ctx context.Context, errorGroup *errgroup.Group }() log.Ctx(ctx).Debug().Msgf("Acquired lock for %s, processing %s", lockKey, identifier) - c.processWorkItem(workCtx, workItem, identifier) + c.processWorkItem(workCtx, workItem) return nil }) return true } -func (c *Controller) processWorkItem(ctx context.Context, workItem interface{}, workItemString string) { - err := func(workItem interface{}) error { - if err := c.syncHandler(ctx, workItemString); err != nil { - c.WorkQueue.AddRateLimited(workItemString) +func (c *Controller) processWorkItem(ctx context.Context, workItem string) { + err := func(workItem string) error { + if err := c.syncHandler(ctx, workItem); err != nil { + c.WorkQueue.AddRateLimited(workItem) metrics.OperatorError(c.HandlerOf, "work_queue", "requeuing") metrics.CustomResourceRemovedFromQueue(c.HandlerOf) metrics.CustomResourceUpdatedAndRequeued(c.HandlerOf) @@ -147,12 +147,12 @@ func (c *Controller) processWorkItem(ctx context.Context, workItem interface{}, c.WorkQueue.Forget(workItem) metrics.CustomResourceRemovedFromQueue(c.HandlerOf) - log.Ctx(ctx).Info().Msgf("Successfully synced %s", workItemString) + log.Ctx(ctx).Info().Msgf("Successfully synced %s", workItem) return nil }(workItem) if err != nil { - log.Ctx(ctx).Error().Err(err).Msgf("Failed to sync %s, requeuing", workItemString) + log.Ctx(ctx).Error().Err(err).Msgf("Failed to sync %s, requeuing", workItem) metrics.OperatorError(c.HandlerOf, "process_next_work_item", "unhandled") } } @@ -192,7 +192,7 @@ func (c *Controller) Enqueue(obj interface{}) (requeued bool, err error) { return requeued, err } - requeued = (c.WorkQueue.NumRequeues(key) > 0) + requeued = c.WorkQueue.NumRequeues(key) > 0 c.WorkQueue.AddRateLimited(key) return requeued, nil } diff --git a/radix-operator/common/controller_test.go b/radix-operator/common/controller_test.go index 79742ed8f..ab6d4a2cd 100644 --- a/radix-operator/common/controller_test.go +++ b/radix-operator/common/controller_test.go @@ -24,30 +24,30 @@ func (m *mockResourceLocker) TryGetLock(key string) bool { return m.Called(key). func (m *mockResourceLocker) ReleaseLock(key string) { m.Called(key) } type mockRateLimitingQueue struct { - getCh chan interface{} + getCh chan string shutdownCh chan bool mock.Mock } -func (m *mockRateLimitingQueue) AddRateLimited(item interface{}) { m.Called(item) } -func (m *mockRateLimitingQueue) Forget(item interface{}) { m.Called(item) } -func (m *mockRateLimitingQueue) NumRequeues(item interface{}) int { +func (m *mockRateLimitingQueue) AddRateLimited(item string) { m.Called(item) } +func (m *mockRateLimitingQueue) Forget(item string) { m.Called(item) } +func (m *mockRateLimitingQueue) NumRequeues(item string) int { return m.Called(item).Int(0) } -func (m *mockRateLimitingQueue) AddAfter(item interface{}, duration time.Duration) { +func (m *mockRateLimitingQueue) AddAfter(item string, duration time.Duration) { m.Called(item, duration) } -func (m *mockRateLimitingQueue) Add(item interface{}) { m.Called(item) } +func (m *mockRateLimitingQueue) Add(item string) { m.Called(item) } func (m *mockRateLimitingQueue) Len() int { return m.Called().Int(0) } -func (m *mockRateLimitingQueue) Get() (item interface{}, shutdown bool) { +func (m *mockRateLimitingQueue) Get() (item string, shutdown bool) { return <-m.getCh, <-m.shutdownCh } -func (m *mockRateLimitingQueue) Done(item interface{}) { m.Called(item) } -func (m *mockRateLimitingQueue) ShutDown() { m.Called() } -func (m *mockRateLimitingQueue) ShutDownWithDrain() { m.Called() } -func (m *mockRateLimitingQueue) ShuttingDown() bool { return m.Called().Bool(0) } +func (m *mockRateLimitingQueue) Done(item string) { m.Called(item) } +func (m *mockRateLimitingQueue) ShutDown() { m.Called() } +func (m *mockRateLimitingQueue) ShutDownWithDrain() { m.Called() } +func (m *mockRateLimitingQueue) ShuttingDown() bool { return m.Called().Bool(0) } type commonControllerTestSuite struct { ControllerTestSuite @@ -61,14 +61,15 @@ func (s *commonControllerTestSuite) Test_SyncSuccess() { stopCh := make(chan struct{}) defer close(stopCh) - queue := &mockRateLimitingQueue{getCh: make(chan interface{}, 1), shutdownCh: make(chan bool, 1)} + queue := &mockRateLimitingQueue{getCh: make(chan string, 1), shutdownCh: make(chan bool, 1)} locker := &mockResourceLocker{} sut := &Controller{ Handler: s.Handler, RadixClient: s.RadixClient, - LockKeyAndIdentifier: func(obj interface{}) (lockKey string, identifier string, err error) { - parts := strings.Split(obj.(string), "/") - return parts[0], obj.(string), nil + LockKeyAndIdentifier: func(obj string) (lockKey string, identifier string, err error) { + identifier = obj + parts := strings.Split(identifier, "/") + return parts[0], identifier, nil }, WorkQueue: queue, locker: locker, @@ -107,14 +108,15 @@ func (s *commonControllerTestSuite) Test_RequeueWhenSyncError() { stopCh := make(chan struct{}) defer close(stopCh) - queue := &mockRateLimitingQueue{getCh: make(chan interface{}, 1), shutdownCh: make(chan bool, 1)} + queue := &mockRateLimitingQueue{getCh: make(chan string, 1), shutdownCh: make(chan bool, 1)} locker := &mockResourceLocker{} sut := &Controller{ Handler: s.Handler, RadixClient: s.RadixClient, - LockKeyAndIdentifier: func(obj interface{}) (lockKey string, identifier string, err error) { - parts := strings.Split(obj.(string), "/") - return parts[0], obj.(string), nil + LockKeyAndIdentifier: func(obj string) (lockKey string, identifier string, err error) { + identifier = obj + parts := strings.Split(identifier, "/") + return parts[0], identifier, nil }, WorkQueue: queue, locker: locker, @@ -153,12 +155,12 @@ func (s *commonControllerTestSuite) Test_ForgetWhenLockKeyAndIdentifierError() { stopCh := make(chan struct{}) defer close(stopCh) - queue := &mockRateLimitingQueue{getCh: make(chan interface{}, 1), shutdownCh: make(chan bool, 1)} + queue := &mockRateLimitingQueue{getCh: make(chan string, 1), shutdownCh: make(chan bool, 1)} locker := &mockResourceLocker{} sut := &Controller{ Handler: s.Handler, RadixClient: s.RadixClient, - LockKeyAndIdentifier: func(obj interface{}) (lockKey string, identifier string, err error) { + LockKeyAndIdentifier: func(obj string) (lockKey string, identifier string, err error) { return "", "", errors.New("any error") }, WorkQueue: queue, @@ -195,12 +197,12 @@ func (s *commonControllerTestSuite) Test_SkipItemWhenNil() { stopCh := make(chan struct{}) defer close(stopCh) - queue := &mockRateLimitingQueue{getCh: make(chan interface{}, 1), shutdownCh: make(chan bool, 1)} + queue := &mockRateLimitingQueue{getCh: make(chan string, 1), shutdownCh: make(chan bool, 1)} locker := &mockResourceLocker{} sut := &Controller{ Handler: s.Handler, RadixClient: s.RadixClient, - LockKeyAndIdentifier: func(obj interface{}) (lockKey string, identifier string, err error) { + LockKeyAndIdentifier: func(obj string) (lockKey string, identifier string, err error) { return "any", "any", nil }, WorkQueue: queue, @@ -218,8 +220,8 @@ func (s *commonControllerTestSuite) Test_SkipItemWhenNil() { doneCh := make(chan struct{}) queue.On("ShuttingDown").Return(false).Times(1) - queue.On("Done", nil).Times(1).Run(func(args mock.Arguments) { close(doneCh) }) - queue.getCh <- nil + queue.On("Done", "").Times(1).Run(func(args mock.Arguments) { close(doneCh) }) + queue.getCh <- "" queue.shutdownCh <- false select { @@ -235,12 +237,12 @@ func (s *commonControllerTestSuite) Test_SkipItemWhenEmpty() { stopCh := make(chan struct{}) defer close(stopCh) - queue := &mockRateLimitingQueue{getCh: make(chan interface{}, 1), shutdownCh: make(chan bool, 1)} + queue := &mockRateLimitingQueue{getCh: make(chan string, 1), shutdownCh: make(chan bool, 1)} locker := &mockResourceLocker{} sut := &Controller{ Handler: s.Handler, RadixClient: s.RadixClient, - LockKeyAndIdentifier: func(obj interface{}) (lockKey string, identifier string, err error) { + LockKeyAndIdentifier: func(obj string) (lockKey string, identifier string, err error) { return "any", "any", nil }, WorkQueue: queue, @@ -275,12 +277,12 @@ func (s *commonControllerTestSuite) Test_SkipItemWhenEmpty() { func (s *commonControllerTestSuite) Test_QuitRunWhenShutdownTrue() { stopCh := make(chan struct{}) - queue := &mockRateLimitingQueue{getCh: make(chan interface{}, 1), shutdownCh: make(chan bool, 1)} + queue := &mockRateLimitingQueue{getCh: make(chan string, 1), shutdownCh: make(chan bool, 1)} locker := &mockResourceLocker{} sut := &Controller{ Handler: s.Handler, RadixClient: s.RadixClient, - LockKeyAndIdentifier: func(obj interface{}) (lockKey string, identifier string, err error) { + LockKeyAndIdentifier: func(obj string) (lockKey string, identifier string, err error) { return "any", "any", nil }, WorkQueue: queue, @@ -298,7 +300,7 @@ func (s *commonControllerTestSuite) Test_QuitRunWhenShutdownTrue() { close(doneCh) }() - queue.getCh <- nil + queue.getCh <- "" queue.shutdownCh <- true select { @@ -314,12 +316,12 @@ func (s *commonControllerTestSuite) Test_QuitRunWhenShutdownTrue() { func (s *commonControllerTestSuite) Test_QuitRunWhenShuttingDownTrue() { stopCh := make(chan struct{}) - queue := &mockRateLimitingQueue{getCh: make(chan interface{}, 1), shutdownCh: make(chan bool, 1)} + queue := &mockRateLimitingQueue{getCh: make(chan string, 1), shutdownCh: make(chan bool, 1)} locker := &mockResourceLocker{} sut := &Controller{ Handler: s.Handler, RadixClient: s.RadixClient, - LockKeyAndIdentifier: func(obj interface{}) (lockKey string, identifier string, err error) { + LockKeyAndIdentifier: func(obj string) (lockKey string, identifier string, err error) { return "any", "any", nil }, WorkQueue: queue, @@ -355,14 +357,15 @@ func (s *commonControllerTestSuite) Test_RequeueWhenLocked() { stopCh := make(chan struct{}) defer close(stopCh) - queue := &mockRateLimitingQueue{getCh: make(chan interface{}, 1), shutdownCh: make(chan bool, 1)} + queue := &mockRateLimitingQueue{getCh: make(chan string, 1), shutdownCh: make(chan bool, 1)} locker := &mockResourceLocker{} sut := &Controller{ Handler: s.Handler, RadixClient: s.RadixClient, - LockKeyAndIdentifier: func(obj interface{}) (lockKey string, identifier string, err error) { - parts := strings.Split(obj.(string), "/") - return parts[0], obj.(string), nil + LockKeyAndIdentifier: func(obj string) (lockKey string, identifier string, err error) { + identifier = obj + parts := strings.Split(identifier, "/") + return parts[0], identifier, nil }, WorkQueue: queue, locker: locker, @@ -399,14 +402,15 @@ func (s *commonControllerTestSuite) Test_ProcessParallell() { ctx, stop := context.WithCancel(context.Background()) defer stop() - queue := &mockRateLimitingQueue{getCh: make(chan interface{}, 1), shutdownCh: make(chan bool, 1)} + queue := &mockRateLimitingQueue{getCh: make(chan string, 1), shutdownCh: make(chan bool, 1)} locker := &mockResourceLocker{} sut := &Controller{ Handler: s.Handler, RadixClient: s.RadixClient, - LockKeyAndIdentifier: func(obj interface{}) (lockKey string, identifier string, err error) { - parts := strings.Split(obj.(string), "/") - return parts[0], obj.(string), nil + LockKeyAndIdentifier: func(obj string) (lockKey string, identifier string, err error) { + identifier = obj + parts := strings.Split(identifier, "/") + return parts[0], identifier, nil }, WorkQueue: queue, locker: locker, diff --git a/radix-operator/common/utils.go b/radix-operator/common/utils.go index 4149a4671..02b7c6087 100644 --- a/radix-operator/common/utils.go +++ b/radix-operator/common/utils.go @@ -2,7 +2,6 @@ package common import ( "context" - "fmt" "sync" radixclient "github.com/equinor/radix-operator/pkg/client/clientset/versioned" @@ -36,35 +35,20 @@ func (r *defaultResourceLocker) ReleaseLock(key string) { } // LockKeyAndIdentifierFunc is a function which is either NamespacePartitionKey or NamePartitionKey -type LockKeyAndIdentifierFunc func(obj interface{}) (lockKey string, identifier string, err error) - -func getStringFromObj(obj interface{}) (string, error) { - var key string - var ok bool - if key, ok = obj.(string); !ok { - return "", fmt.Errorf("expected string in workqueue but got %#v", obj) - } - return key, nil -} +type LockKeyAndIdentifierFunc func(obj string) (lockKey string, identifier string, err error) // NamespacePartitionKey returns a string which serves as a "locking key" for parallel processing of RadixApplications, // RadixAlerts, RadixDeployments and RadixJobs -func NamespacePartitionKey(obj interface{}) (lockKey string, identifier string, err error) { - identifier, err = getStringFromObj(obj) - if err != nil { - return - } +func NamespacePartitionKey(obj string) (lockKey string, identifier string, err error) { + identifier = obj lockKey, _, err = cache.SplitMetaNamespaceKey(identifier) return } // NamePartitionKey returns a string which serves as a "locking key" for parallel processing of RadixEnvironments and // RadixRegistrations -func NamePartitionKey(obj interface{}) (lockKey string, identifier string, err error) { - identifier, err = getStringFromObj(obj) - if err != nil { - return - } +func NamePartitionKey(obj string) (lockKey string, identifier string, err error) { + identifier = obj _, lockKey, err = cache.SplitMetaNamespaceKey(identifier) return } @@ -85,8 +69,8 @@ func NewEventRecorder(controllerAgentName string, events typedcorev1.EventInterf return eventBroadcaster.NewRecorder(scheme.Scheme, corev1.EventSource{Component: controllerAgentName}) } -func NewRateLimitedWorkQueue(ctx context.Context, name string) workqueue.RateLimitingInterface { - queue := workqueue.NewRateLimitingQueueWithConfig(workqueue.DefaultControllerRateLimiter(), workqueue.RateLimitingQueueConfig{Name: name}) +func NewRateLimitedWorkQueue(ctx context.Context, name string) workqueue.TypedRateLimitingInterface[string] { + queue := workqueue.NewTypedRateLimitingQueueWithConfig(workqueue.DefaultTypedControllerRateLimiter[string](), workqueue.TypedRateLimitingQueueConfig[string]{Name: name}) go func() { <-ctx.Done() queue.ShutDown()