From 457f48da47663c79dbc476d6a20ba0bad28ca9f7 Mon Sep 17 00:00:00 2001 From: sujeet01 Date: Fri, 13 Dec 2024 17:27:47 +0530 Subject: [PATCH] Upgrade k8s dependencies to `v0.31.0` and controller-runtime to `v0.19.0`, adapting code for breaking changes --- Makefile | 9 +- broker/machinebroker/networks/networks.go | 9 +- go.mod | 74 +++---- go.sum | 187 +++++++++--------- .../plugin/resourcequota/controller.go | 7 +- internal/apiserver/apiserver.go | 7 - internal/app/apiserver/apiserver.go | 11 +- .../controllers/compute/machine_scheduler.go | 21 +- .../compute/machineclass_controller.go | 3 +- internal/controllers/compute/suite_test.go | 3 + internal/controllers/core/core_suite_test.go | 3 + .../controllers/ipam/prefix_controller.go | 9 +- internal/controllers/ipam/suite_test.go | 6 +- .../networking/loadbalancer_controller.go | 13 +- internal/controllers/networking/suite_test.go | 3 + .../storage/bucketclass_controller.go | 3 +- internal/controllers/storage/suite_test.go | 6 +- .../controllers/storage/volume_scheduler.go | 21 +- .../storage/volumeclass_controller.go | 3 +- poollet/bucketpoollet/bem/bem_test.go | 3 + .../controllers/controllers_suite_test.go | 3 + .../controllers/controllers_suite_test.go | 3 + poollet/machinepoollet/handler/handler.go | 10 +- poollet/machinepoollet/mem/mem_test.go | 3 + .../controllers/controllers_suite_test.go | 3 + poollet/volumepoollet/vem/vem_test.go | 3 + utils/certificate/rotator.go | 6 +- utils/client/config/controller.go | 4 +- utils/debug/handler.go | 71 +++++-- utils/rest/configrotator.go | 4 +- 30 files changed, 289 insertions(+), 222 deletions(-) diff --git a/Makefile b/Makefile index f0d8829cb..732cece14 100644 --- a/Makefile +++ b/Makefile @@ -12,7 +12,7 @@ BUCKETBROKER_IMG ?= bucketbroker:latest IRICTL_BUCKET_IMG ?= irictl-bucket:latest # ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary. -ENVTEST_K8S_VERSION = 1.30.3 +ENVTEST_K8S_VERSION = 1.31 # Docker image name for the mkdocs based local development setup IMAGE=ironcore/documentation @@ -145,7 +145,7 @@ clean-docs: ## Remove all local mkdocs Docker images (cleanup). docker container prune --force --filter "label=project=ironcore_documentation" .PHONY: test -test: manifests generate fmt vet test-only ## Run tests. +test: generate manifests fmt vet test-only ## Run tests. .PHONY: test-only test-only: envtest ## Run *only* the tests - no generation, linting etc. @@ -360,13 +360,14 @@ GOLANGCI_LINT ?= $(LOCALBIN)/golangci-lint ## Tool Versions KUSTOMIZE_VERSION ?= v5.1.1 VGOPATH_VERSION ?= v0.1.3 -CONTROLLER_TOOLS_VERSION ?= v0.15.0 +CONTROLLER_TOOLS_VERSION ?= v0.16.0 GEN_CRD_API_REFERENCE_DOCS_VERSION ?= v0.3.0 ADDLICENSE_VERSION ?= v1.1.1 PROTOC_GEN_GOGO_VERSION ?= v1.3.2 GOIMPORTS_VERSION ?= v0.26.0 GOLANGCI_LINT_VERSION ?= v1.62.2 OPENAPI_EXTRACTOR_VERSION ?= v0.1.9 +SETUP_ENVTEST_VERSION ?= release-0.19 KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" .PHONY: kustomize @@ -404,7 +405,7 @@ $(VGOPATH): $(LOCALBIN) .PHONY: envtest envtest: $(ENVTEST) ## Download envtest-setup locally if necessary. $(ENVTEST): $(LOCALBIN) - test -s $(LOCALBIN)/setup-envtest || GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest + test -s $(LOCALBIN)/setup-envtest || GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@$(SETUP_ENVTEST_VERSION) .PHONY: openapi-extractor openapi-extractor: $(OPENAPI_EXTRACTOR) ## Download openapi-extractor locally if necessary. diff --git a/broker/machinebroker/networks/networks.go b/broker/machinebroker/networks/networks.go index 790e0d988..1b88c984b 100644 --- a/broker/machinebroker/networks/networks.go +++ b/broker/machinebroker/networks/networks.go @@ -27,7 +27,7 @@ type Manager struct { cluster cluster.Cluster - queue workqueue.RateLimitingInterface + queue workqueue.TypedRateLimitingInterface[string] waitersByProviderIDMu sync.Mutex waitersByProviderID map[string]*waiter @@ -36,7 +36,7 @@ type Manager struct { func NewManager(cluster cluster.Cluster) *Manager { return &Manager{ cluster: cluster, - queue: workqueue.NewRateLimitingQueue(workqueue.DefaultControllerRateLimiter()), + queue: workqueue.NewTypedRateLimitingQueue(workqueue.DefaultTypedControllerRateLimiter[string]()), waitersByProviderID: make(map[string]*waiter), } } @@ -144,13 +144,12 @@ func (e *Manager) doWork(ctx context.Context, providerID string) (*networkingv1a } func (e *Manager) processNextWorkItem(ctx context.Context) bool { - uncastProviderID, quit := e.queue.Get() + providerID, quit := e.queue.Get() if quit { return false } - defer e.queue.Done(uncastProviderID) + defer e.queue.Done(providerID) - providerID := uncastProviderID.(string) network, err := e.doWork(ctx, providerID) e.emit(providerID, network, err) e.queue.Forget(providerID) diff --git a/go.mod b/go.mod index b6b68f007..c01f4349b 100644 --- a/go.mod +++ b/go.mod @@ -19,18 +19,18 @@ require ( golang.org/x/sync v0.10.0 golang.org/x/sys v0.28.0 google.golang.org/grpc v1.69.0 - k8s.io/api v0.30.7 - k8s.io/apimachinery v0.30.7 - k8s.io/apiserver v0.30.7 - k8s.io/client-go v0.30.7 - k8s.io/code-generator v0.30.7 - k8s.io/component-base v0.30.7 + k8s.io/api v0.31.0 + k8s.io/apimachinery v0.31.0 + k8s.io/apiserver v0.31.0 + k8s.io/client-go v0.31.0 + k8s.io/code-generator v0.31.0 + k8s.io/component-base v0.31.0 k8s.io/klog/v2 v2.130.1 - k8s.io/kube-aggregator v0.30.7 - k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 - k8s.io/kubectl v0.30.7 + k8s.io/kube-aggregator v0.31.0 + k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f + k8s.io/kubectl v0.31.0 k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 - sigs.k8s.io/controller-runtime v0.18.5 + sigs.k8s.io/controller-runtime v0.19.0 sigs.k8s.io/structured-merge-diff/v4 v4.4.3 sigs.k8s.io/yaml v1.4.0 ) @@ -38,10 +38,10 @@ require ( require ( github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect github.com/NYTimes/gziphandler v1.1.1 // indirect - github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230305170008-8188dc5388df // indirect + github.com/antlr4-go/antlr/v4 v4.13.0 // indirect github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a // indirect github.com/beorn7/perks v1.0.1 // indirect - github.com/cenkalti/backoff/v4 v4.2.1 // indirect + github.com/cenkalti/backoff/v4 v4.3.0 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/coreos/go-semver v0.3.1 // indirect github.com/coreos/go-systemd/v22 v22.5.0 // indirect @@ -49,8 +49,9 @@ require ( github.com/emicklei/go-restful/v3 v3.11.0 // indirect github.com/evanphx/json-patch v5.6.0+incompatible // indirect github.com/evanphx/json-patch/v5 v5.9.0 // indirect - github.com/felixge/httpsnoop v1.0.3 // indirect + github.com/felixge/httpsnoop v1.0.4 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/fxamacker/cbor/v2 v2.7.0 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-logr/zapr v1.3.0 // indirect github.com/go-openapi/jsonpointer v0.21.0 // indirect @@ -59,46 +60,46 @@ require ( github.com/go-task/slim-sprig/v3 v3.0.0 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.4 // indirect - github.com/google/cel-go v0.17.8 // indirect - github.com/google/gnostic-models v0.6.8 // indirect + github.com/google/cel-go v0.20.1 // indirect + github.com/google/gnostic-models v0.6.9 // indirect github.com/google/gofuzz v1.2.0 // indirect github.com/google/pprof v0.0.0-20241029153458-d1b30febd7db // indirect github.com/google/uuid v1.6.0 // indirect github.com/gorilla/websocket v1.5.0 // indirect github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 // indirect github.com/imdario/mergo v0.3.13 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect github.com/mailru/easyjson v0.7.7 // indirect - github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect github.com/mitchellh/go-wordwrap v1.0.1 // indirect - github.com/moby/spdystream v0.2.0 // indirect - github.com/moby/term v0.0.0-20221205130635-1aeaba878587 // indirect + github.com/moby/spdystream v0.4.0 // indirect + github.com/moby/term v0.5.0 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect github.com/pkg/errors v0.9.1 // indirect - github.com/prometheus/client_golang v1.18.0 // indirect - github.com/prometheus/client_model v0.5.0 // indirect - github.com/prometheus/common v0.45.0 // indirect - github.com/prometheus/procfs v0.12.0 // indirect + github.com/prometheus/client_golang v1.19.1 // indirect + github.com/prometheus/client_model v0.6.1 // indirect + github.com/prometheus/common v0.55.0 // indirect + github.com/prometheus/procfs v0.15.1 // indirect github.com/stoewer/go-strcase v1.2.0 // indirect - go.etcd.io/etcd/api/v3 v3.5.10 // indirect - go.etcd.io/etcd/client/pkg/v3 v3.5.10 // indirect - go.etcd.io/etcd/client/v3 v3.5.10 // indirect - go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.0 // indirect - go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.44.0 // indirect + github.com/x448/float16 v0.8.4 // indirect + go.etcd.io/etcd/api/v3 v3.5.14 // indirect + go.etcd.io/etcd/client/pkg/v3 v3.5.14 // indirect + go.etcd.io/etcd/client/v3 v3.5.14 // indirect + go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.53.0 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0 // indirect go.opentelemetry.io/otel v1.31.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.21.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.21.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.28.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.27.0 // indirect go.opentelemetry.io/otel/metric v1.31.0 // indirect go.opentelemetry.io/otel/sdk v1.31.0 // indirect go.opentelemetry.io/otel/trace v1.31.0 // indirect - go.opentelemetry.io/proto/otlp v1.0.0 // indirect + go.opentelemetry.io/proto/otlp v1.3.1 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.26.0 // indirect golang.org/x/crypto v0.31.0 // indirect @@ -114,14 +115,15 @@ require ( google.golang.org/genproto/googleapis/api v0.0.0-20241015192408-796eee8c2d53 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20241015192408-796eee8c2d53 // indirect google.golang.org/protobuf v1.35.1 // indirect + gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - k8s.io/apiextensions-apiserver v0.30.4 // indirect - k8s.io/cli-runtime v0.30.7 // indirect - k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70 // indirect - k8s.io/kms v0.30.7 // indirect - sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.29.0 // indirect + k8s.io/apiextensions-apiserver v0.31.0 // indirect + k8s.io/cli-runtime v0.31.0 // indirect + k8s.io/gengo/v2 v2.0.0-20240826214909-a7b603a56eb7 // indirect + k8s.io/kms v0.31.0 // indirect + sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.30.3 // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect ) diff --git a/go.sum b/go.sum index 0dab80d98..e019eb082 100644 --- a/go.sum +++ b/go.sum @@ -1,13 +1,9 @@ -cloud.google.com/go v0.112.0 h1:tpFCD7hpHFlQ8yPwT3x+QeXqc2T6+n6T+hmABHfDUSM= -cloud.google.com/go/compute v1.24.0 h1:phWcR2eWzRJaL/kOiJwfFsPs4BaKq1j6vnpZrc1YlVg= -cloud.google.com/go/compute/metadata v0.5.2 h1:UxK4uu/Tn+I3p2dYWTfiX4wva7aYlKixAHn3fyqngqo= -cloud.google.com/go/compute/metadata v0.5.2/go.mod h1:C66sj2AluDcIqakBq/M8lw8/ybHgOZqin2obFxa/E5k= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/NYTimes/gziphandler v1.1.1 h1:ZUDjpQae29j0ryrS0u/B8HZfJBtBQHjqw2rQ2cqUQ3I= github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c= -github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230305170008-8188dc5388df h1:7RFfzj4SSt6nnvCPbCqijJi1nWCd+TqAT3bYCStRC18= -github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230305170008-8188dc5388df/go.mod h1:pSwJ0fSY5KhvocuWSx4fz3BA8OrA1bQn+K1Eli3BRwM= +github.com/antlr4-go/antlr/v4 v4.13.0 h1:lxCg3LAv+EUK6t1i0y1V6/SLeUi0eKEKdhQAlS8TVTI= +github.com/antlr4-go/antlr/v4 v4.13.0/go.mod h1:pfChB/xh/Unjila75QW7+VU4TSnWnnk9UTnmpPaOR2g= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a h1:idn718Q4B6AGu/h5Sxe66HYVdqdGu2l9Iebqhi/AEoA= @@ -18,12 +14,10 @@ github.com/bits-and-blooms/bitset v1.20.0 h1:2F+rfL86jE2d/bmw7OhqUg2Sj/1rURkBn3M github.com/bits-and-blooms/bitset v1.20.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM= github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ= -github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM= -github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= +github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8= +github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cncf/xds/go v0.0.0-20240905190251-b4127c9b8d78 h1:QVw89YDxXxEe+l8gU8ETbOasdwEV+avkR75ZzsVV9WI= -github.com/cncf/xds/go v0.0.0-20240905190251-b4127c9b8d78/go.mod h1:W+zGtBO5Y1IgJhy4+A9GOqVhqLpfZi+vwmdNXUehLA8= github.com/coreos/go-semver v0.3.1 h1:yi21YpKnrx1gt5R+la8n5WgS0kCrsPp33dmEyHReZr4= github.com/coreos/go-semver v0.3.1/go.mod h1:irMmmIw/7yzSRPWryHsK7EYSg09caPQL03VsM8rvUec= github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs= @@ -40,16 +34,16 @@ github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkp github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxERmMY4rD+g= github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= -github.com/envoyproxy/protoc-gen-validate v1.1.0 h1:tntQDh69XqOCOZsDz0lVJQez/2L6Uu2PdjCQwWCJ3bM= -github.com/envoyproxy/protoc-gen-validate v1.1.0/go.mod h1:sXRDRVmzEbkM7CVcM06s9shE/m23dg3wzjl0UWqJ2q4= github.com/evanphx/json-patch v5.6.0+incompatible h1:jBYDEEiFBPxA0v50tFdvOzQQTCvpL6mnFh5mB2/l16U= github.com/evanphx/json-patch v5.6.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch/v5 v5.9.0 h1:kcBlZQbplgElYIlo/n1hJbls2z/1awpXxpRi0/FOJfg= github.com/evanphx/json-patch/v5 v5.9.0/go.mod h1:VNkHZ/282BpEyt/tObQO8s5CMPmYYq14uClGH4abBuQ= -github.com/felixge/httpsnoop v1.0.3 h1:s/nj+GCswXYzN5v2DpNMuMQYe+0DDwt5WVCU6CWBdXk= -github.com/felixge/httpsnoop v1.0.3/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= +github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= +github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv5E= +github.com/fxamacker/cbor/v2 v2.7.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ= github.com/go-chi/chi/v5 v5.2.0 h1:Aj1EtB0qR2Rdo2dG4O94RIU35w2lvQSj6BRA4+qwFL0= github.com/go-chi/chi/v5 v5.2.0/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= @@ -74,18 +68,16 @@ github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= -github.com/golang/glog v1.2.2 h1:1+mZ9upx1Dh6FmUTFR1naJ77miKiXgALjWOZ3NVFPmY= -github.com/golang/glog v1.2.2/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/google/btree v1.0.1 h1:gK4Kx5IaGY9CD5sPJ36FHiBJ6ZXl0kilRiiCj+jdYp4= github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA= -github.com/google/cel-go v0.17.8 h1:j9m730pMZt1Fc4oKhCLUHfjj6527LuhYcYw0Rl8gqto= -github.com/google/cel-go v0.17.8/go.mod h1:HXZKzB0LXqer5lHHgfWAnlYwJaQBDKMjxjulNQzhwhY= -github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I= -github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U= +github.com/google/cel-go v0.20.1 h1:nDx9r8S3L4pE61eDdt8igGj8rf5kjYR3ILxWIpWNi84= +github.com/google/cel-go v0.20.1/go.mod h1:kWcIzTsPX0zmQ+H3TirHstLLf9ep5QTsZBN9u4dOYLg= +github.com/google/gnostic-models v0.6.9 h1:MU/8wDLif2qCXZmzncUQ/BOfxWfthHi63KqpoNbWqVw= +github.com/google/gnostic-models v0.6.9/go.mod h1:CiWsm0s6BSQd1hRn8/QmxqB6BesYcbSZxsz9b0KuDBw= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= @@ -96,7 +88,6 @@ github.com/google/pprof v0.0.0-20241029153458-d1b30febd7db h1:097atOisP2aRj7vFgY github.com/google/pprof v0.0.0-20241029153458-d1b30febd7db/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 h1:+9834+KizmvFV7pXQGSXQTsaWhq2GjuNUt0aUU0YBYw= @@ -105,8 +96,8 @@ github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92Bcuy github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0 h1:YBftPWNWd4WwGqtY2yeZL2ef8rHAxPBD8KFhJpmcqms= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0/go.mod h1:YN5jB8ie0yfIUg6VvR9Kz84aCaG7AsGZnLjhHbUqwPg= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 h1:bkypFPDjIYGfCYD5mRBvpqxfYX1YCS1PXdKYWi8FsN0= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0/go.mod h1:P+Lt/0by1T8bfcF3z737NnSbmxQAppXMRziHUxPOC8k= github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk= github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= @@ -132,14 +123,12 @@ github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de h1:9TO3cAIGXtEhn github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de/go.mod h1:zAbeS9B/r2mtpb6U+EI2rYA5OAXxsYw6wTamcNW+zcE= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= -github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 h1:jWpvCLoY8Z/e3VKvlsiIGKtc+UG6U5vzxaoagmhXfyg= -github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0/go.mod h1:QUyp042oQthUoa9bqDv0ER0wrtXnBruoNd7aNjkbP+k= github.com/mitchellh/go-wordwrap v1.0.1 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQflz0v0= github.com/mitchellh/go-wordwrap v1.0.1/go.mod h1:R62XHJLzvMFRBbcrT7m7WgmE1eOyTSsCt+hzestvNj0= -github.com/moby/spdystream v0.2.0 h1:cjW1zVyyoiM0T7b6UoySUFqzXMoqRckQtXwGPiBhOM8= -github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c= -github.com/moby/term v0.0.0-20221205130635-1aeaba878587 h1:HfkjXDfhgVaN5rmueG8cL8KKeFNecRCXFhaJ2qZ5SKA= -github.com/moby/term v0.0.0-20221205130635-1aeaba878587/go.mod h1:8FzsFHVUBGZdbDsJw/ot+X+d5HLUbvklYLJ9uGfcI3Y= +github.com/moby/spdystream v0.4.0 h1:Vy79D6mHeJJjiPdFEL2yku1kl0chZpJfZcPpb16BRl8= +github.com/moby/spdystream v0.4.0/go.mod h1:xBAYlnt/ay+11ShkdFKNAG7LsyK/tmNBVvVOwrfMgdI= +github.com/moby/term v0.5.0 h1:xt8Q1nalod/v7BqbG21f8mQPqH+xAaC9C3N3wfWbVP0= +github.com/moby/term v0.5.0/go.mod h1:8FzsFHVUBGZdbDsJw/ot+X+d5HLUbvklYLJ9uGfcI3Y= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -158,19 +147,19 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk= -github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA= -github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw= -github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI= -github.com/prometheus/common v0.45.0 h1:2BGz0eBc2hdMDLnO/8n0jeB3oPrt2D08CekT0lneoxM= -github.com/prometheus/common v0.45.0/go.mod h1:YJmSTw9BoKxJplESWWxlbyttQR4uaEcGyv9MZjVOJsY= -github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= -github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= -github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= -github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= +github.com/prometheus/client_golang v1.19.1 h1:wZWJDwK+NameRJuPGDhlnFgx8e8HN3XHQeLaYJFJBOE= +github.com/prometheus/client_golang v1.19.1/go.mod h1:mP78NwGzrVks5S2H6ab8+ZZGJLZUq1hoULYBAYBw1Ho= +github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= +github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= +github.com/prometheus/common v0.55.0 h1:KEi6DK7lXW/m7Ig5i47x0vRzuBsHuvJdi5ee6Y3G1dc= +github.com/prometheus/common v0.55.0/go.mod h1:2SECS4xJG1kd8XF9IcM1gMX6510RAEL65zxzNImwdc8= +github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= +github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= +github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= +github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= -github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= +github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= +github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/soheilhy/cmux v0.1.5 h1:jjzc5WVemNEDTLwv9tlmemhC73tI08BNOIGwBOo10Js= github.com/soheilhy/cmux v0.1.5/go.mod h1:T7TcVDs9LWfQgPlPsdngu6I6QIoyIFZDDC6sNE1GqG0= github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= @@ -193,36 +182,38 @@ 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/tmc/grpc-websocket-proxy v0.0.0-20220101234140-673ab2c3ae75 h1:6fotK7otjonDflCTK0BCfls4SPy3NcCVb5dqqmbRknE= github.com/tmc/grpc-websocket-proxy v0.0.0-20220101234140-673ab2c3ae75/go.mod h1:KO6IkyS8Y3j8OdNO85qEYBsRPuteD+YciPomcXdrMnk= +github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= +github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 h1:eY9dn8+vbi4tKz5Qo6v2eYzo7kUS51QINcR5jNpbZS8= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -go.etcd.io/bbolt v1.3.8 h1:xs88BrvEv273UsB79e0hcVrlUWmS0a8upikMFhSyAtA= -go.etcd.io/bbolt v1.3.8/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw= -go.etcd.io/etcd/api/v3 v3.5.10 h1:szRajuUUbLyppkhs9K6BRtjY37l66XQQmw7oZRANE4k= -go.etcd.io/etcd/api/v3 v3.5.10/go.mod h1:TidfmT4Uycad3NM/o25fG3J07odo4GBB9hoxaodFCtI= -go.etcd.io/etcd/client/pkg/v3 v3.5.10 h1:kfYIdQftBnbAq8pUWFXfpuuxFSKzlmM5cSn76JByiT0= -go.etcd.io/etcd/client/pkg/v3 v3.5.10/go.mod h1:DYivfIviIuQ8+/lCq4vcxuseg2P2XbHygkKwFo9fc8U= -go.etcd.io/etcd/client/v2 v2.305.10 h1:MrmRktzv/XF8CvtQt+P6wLUlURaNpSDJHFZhe//2QE4= -go.etcd.io/etcd/client/v2 v2.305.10/go.mod h1:m3CKZi69HzilhVqtPDcjhSGp+kA1OmbNn0qamH80xjA= -go.etcd.io/etcd/client/v3 v3.5.10 h1:W9TXNZ+oB3MCd/8UjxHTWK5J9Nquw9fQBLJd5ne5/Ao= -go.etcd.io/etcd/client/v3 v3.5.10/go.mod h1:RVeBnDz2PUEZqTpgqwAtUd8nAPf5kjyFyND7P1VkOKc= -go.etcd.io/etcd/pkg/v3 v3.5.10 h1:WPR8K0e9kWl1gAhB5A7gEa5ZBTNkT9NdNWrR8Qpo1CM= -go.etcd.io/etcd/pkg/v3 v3.5.10/go.mod h1:TKTuCKKcF1zxmfKWDkfz5qqYaE3JncKKZPFf8c1nFUs= -go.etcd.io/etcd/raft/v3 v3.5.10 h1:cgNAYe7xrsrn/5kXMSaH8kM/Ky8mAdMqGOxyYwpP0LA= -go.etcd.io/etcd/raft/v3 v3.5.10/go.mod h1:odD6kr8XQXTy9oQnyMPBOr0TVe+gT0neQhElQ6jbGRc= -go.etcd.io/etcd/server/v3 v3.5.10 h1:4NOGyOwD5sUZ22PiWYKmfxqoeh72z6EhYjNosKGLmZg= -go.etcd.io/etcd/server/v3 v3.5.10/go.mod h1:gBplPHfs6YI0L+RpGkTQO7buDbHv5HJGG/Bst0/zIPo= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.0 h1:PzIubN4/sjByhDRHLviCjJuweBXWFZWhghjg7cS28+M= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.0/go.mod h1:Ct6zzQEuGK3WpJs2n4dn+wfJYzd/+hNnxMRTWjGn30M= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.44.0 h1:KfYpVmrjI7JuToy5k8XV3nkapjWx48k4E4JOtVstzQI= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.44.0/go.mod h1:SeQhzAEccGVZVEy7aH87Nh0km+utSpo1pTv6eMMop48= +go.etcd.io/bbolt v1.3.9 h1:8x7aARPEXiXbHmtUwAIv7eV2fQFHrLLavdiJ3uzJXoI= +go.etcd.io/bbolt v1.3.9/go.mod h1:zaO32+Ti0PK1ivdPtgMESzuzL2VPoIG1PCQNvOdo/dE= +go.etcd.io/etcd/api/v3 v3.5.14 h1:vHObSCxyB9zlF60w7qzAdTcGaglbJOpSj1Xj9+WGxq0= +go.etcd.io/etcd/api/v3 v3.5.14/go.mod h1:BmtWcRlQvwa1h3G2jvKYwIQy4PkHlDej5t7uLMUdJUU= +go.etcd.io/etcd/client/pkg/v3 v3.5.14 h1:SaNH6Y+rVEdxfpA2Jr5wkEvN6Zykme5+YnbCkxvuWxQ= +go.etcd.io/etcd/client/pkg/v3 v3.5.14/go.mod h1:8uMgAokyG1czCtIdsq+AGyYQMvpIKnSvPjFMunkgeZI= +go.etcd.io/etcd/client/v2 v2.305.13 h1:RWfV1SX5jTU0lbCvpVQe3iPQeAHETWdOTb6pxhd77C8= +go.etcd.io/etcd/client/v2 v2.305.13/go.mod h1:iQnL7fepbiomdXMb3om1rHq96htNNGv2sJkEcZGDRRg= +go.etcd.io/etcd/client/v3 v3.5.14 h1:CWfRs4FDaDoSz81giL7zPpZH2Z35tbOrAJkkjMqOupg= +go.etcd.io/etcd/client/v3 v3.5.14/go.mod h1:k3XfdV/VIHy/97rqWjoUzrj9tk7GgJGH9J8L4dNXmAk= +go.etcd.io/etcd/pkg/v3 v3.5.13 h1:st9bDWNsKkBNpP4PR1MvM/9NqUPfvYZx/YXegsYEH8M= +go.etcd.io/etcd/pkg/v3 v3.5.13/go.mod h1:N+4PLrp7agI/Viy+dUYpX7iRtSPvKq+w8Y14d1vX+m0= +go.etcd.io/etcd/raft/v3 v3.5.13 h1:7r/NKAOups1YnKcfro2RvGGo2PTuizF/xh26Z2CTAzA= +go.etcd.io/etcd/raft/v3 v3.5.13/go.mod h1:uUFibGLn2Ksm2URMxN1fICGhk8Wu96EfDQyuLhAcAmw= +go.etcd.io/etcd/server/v3 v3.5.13 h1:V6KG+yMfMSqWt+lGnhFpP5z5dRUj1BDRJ5k1fQ9DFok= +go.etcd.io/etcd/server/v3 v3.5.13/go.mod h1:K/8nbsGupHqmr5MkgaZpLlH1QdX1pcNQLAkODy44XcQ= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.53.0 h1:9G6E0TXzGFVfTnawRzrPl83iHOAV7L8NJiR8RSGYV1g= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.53.0/go.mod h1:azvtTADFQJA8mX80jIH/akaE7h+dbm/sVuaHqN13w74= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0 h1:4K4tsIXefpVJtvA/8srF4V4y0akAoPHkIslgAkjixJA= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0/go.mod h1:jjdQuTGVsXV4vSs+CJ2qYDeDPf9yIJV23qlIzBm73Vg= go.opentelemetry.io/otel v1.31.0 h1:NsJcKPIW0D0H3NgzPDHmo0WW6SptzPdqg/L1zsIm2hY= go.opentelemetry.io/otel v1.31.0/go.mod h1:O0C14Yl9FgkjqcCZAsE053C13OaddMYr/hz6clDkEJE= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.21.0 h1:cl5P5/GIfFh4t6xyruOgJP5QiA1pw4fYYdv6nc6CBWw= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.21.0/go.mod h1:zgBdWWAu7oEEMC06MMKc5NLbA/1YDXV1sMpSqEeLQLg= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.21.0 h1:tIqheXEFWAZ7O8A7m+J0aPTmpJN3YQ7qetUAdkkkKpk= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.21.0/go.mod h1:nUeKExfxAQVbiVFn32YXpXZZHZ61Cc3s3Rn1pDBGAb0= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.28.0 h1:3Q/xZUyC1BBkualc9ROb4G8qkH90LXEIICcs5zv1OYY= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.28.0/go.mod h1:s75jGIWA9OfCMzF0xr+ZgfrB5FEbbV7UuYo32ahUiFI= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.27.0 h1:qFffATk0X+HD+f1Z8lswGiOQYKHRlzfmdJm0wEaVrFA= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.27.0/go.mod h1:MOiCmryaYtc+V0Ei+Tx9o5S1ZjA7kzLucuVuyzBZloQ= go.opentelemetry.io/otel/metric v1.31.0 h1:FSErL0ATQAmYHUIzSezZibnyVlft1ybhy4ozRPcF2fE= go.opentelemetry.io/otel/metric v1.31.0/go.mod h1:C3dEloVbLuYoX41KpmAhOqNriGbA+qqH6PQ5E5mUfnY= go.opentelemetry.io/otel/sdk v1.31.0 h1:xLY3abVHYZ5HSfOg3l2E5LUj2Cwva5Y7yGxnSW9H5Gk= @@ -231,8 +222,8 @@ go.opentelemetry.io/otel/sdk/metric v1.31.0 h1:i9hxxLJF/9kkvfHppyLL55aW7iIJz4Jjx go.opentelemetry.io/otel/sdk/metric v1.31.0/go.mod h1:CRInTMVvNhUKgSAMbKyTMxqOBC0zgyxzW55lZzX43Y8= go.opentelemetry.io/otel/trace v1.31.0 h1:ffjsj1aRouKewfr85U2aGagJ46+MvodynlQ1HYdmJys= go.opentelemetry.io/otel/trace v1.31.0/go.mod h1:TXZkRk7SM2ZQLtR6eoAWQFIHPvzQ06FJAsO1tJg480A= -go.opentelemetry.io/proto/otlp v1.0.0 h1:T0TX0tmXU8a3CbNXzEKGeU5mIVOdf0oykP+u2lIVU/I= -go.opentelemetry.io/proto/otlp v1.0.0/go.mod h1:Sy6pihPLfYHkr3NkUbEhGHFhINUSI/v80hjKIs5JXpM= +go.opentelemetry.io/proto/otlp v1.3.1 h1:TrMUixzpM0yuc/znrFTP9MMRh8trP93mkCiDVeXrui0= +go.opentelemetry.io/proto/otlp v1.3.1/go.mod h1:0X1WI4de4ZsLrrJNLAQbFeLCm3T7yBkR0XqQ7niQU+8= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/mock v0.5.0 h1:KAMbZvZPyBPWgD14IrIQ38QCyjwpvVVV6K/bHl1IwQU= @@ -306,6 +297,8 @@ google.golang.org/protobuf v1.35.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojt gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/evanphx/json-patch.v4 v4.12.0 h1:n6jtcsulIzXPJaxegRbvFNNrZDjbij7ny3gmSPG+6V4= +gopkg.in/evanphx/json-patch.v4 v4.12.0/go.mod h1:p8EYWUEYMpynmqDbY58zCKCFZw8pRWMG4EsWvDvM72M= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc= @@ -317,40 +310,40 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -k8s.io/api v0.30.7 h1:wB2eHI+IptVYsz5WsAQpI6+Dqi3+11wEWBqIh4fh980= -k8s.io/api v0.30.7/go.mod h1:bR0EwbmhYmJvUoeza7ZzBUmYCrVXccQ9JOdfv0BxhH0= -k8s.io/apiextensions-apiserver v0.30.4 h1:FwOMIk/rzZvM/Gx0IOz0+biZ+dlnlCeyfXW17uzV1qE= -k8s.io/apiextensions-apiserver v0.30.4/go.mod h1:m8cAkJ9PVU8Olb4cPW4hrUDBZGvoSJ0kY0G0CfdGQac= -k8s.io/apimachinery v0.30.7 h1:CoQFxvzPFKwU1eJGN/8LgM3ZJBC3hKgvwGqRrL43uIY= -k8s.io/apimachinery v0.30.7/go.mod h1:iexa2somDaxdnj7bha06bhb43Zpa6eWH8N8dbqVjTUc= -k8s.io/apiserver v0.30.7 h1:4tKcwejf+OmBniwtXAXvwGce6K+G0Q4s5bWugap4d0Y= -k8s.io/apiserver v0.30.7/go.mod h1:oj6q6jJtJWxHuavNRxFp6nhUxi8UX07HZIFKu1eWYjs= -k8s.io/cli-runtime v0.30.7 h1:XQsBcf0dKk745fklRwD5pc0IdcrPJPgUr+W349VJAV4= -k8s.io/cli-runtime v0.30.7/go.mod h1:B67pZMYMp+7h2Xyy4Yeu4T9OwYvx1UmbRUqxgpCm3vA= -k8s.io/client-go v0.30.7 h1:DQRfuGWxDzxPEyyiTE/fxzAsZcj2p9sbc5671njR52w= -k8s.io/client-go v0.30.7/go.mod h1:oED9+njB91ExCc4BNPAotniB7WH1ig7CmiBx5pVA1yw= -k8s.io/code-generator v0.30.7 h1:Vw8991AoEjwW3qjkJhsTJosrlCN+6+VA3KR7wU28Sc0= -k8s.io/code-generator v0.30.7/go.mod h1:kMe4cE9rGqC9SoXwHqV7VaD4F8G7UL0BQF6NbRqxOdo= -k8s.io/component-base v0.30.7 h1:wtbQWLzj5xAGjz+/U/nYNnAc8+wpTUvCqN0uZuCuFF8= -k8s.io/component-base v0.30.7/go.mod h1:UjPOkWiDcvUiQRTpbr3kghl+pFMtFSgqYbWKHKRcXJc= -k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70 h1:NGrVE502P0s0/1hudf8zjgwki1X/TByhmAoILTarmzo= -k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70/go.mod h1:VH3AT8AaQOqiGjMF9p0/IM1Dj+82ZwjfxUP1IxaHE+8= +k8s.io/api v0.31.0 h1:b9LiSjR2ym/SzTOlfMHm1tr7/21aD7fSkqgD/CVJBCo= +k8s.io/api v0.31.0/go.mod h1:0YiFF+JfFxMM6+1hQei8FY8M7s1Mth+z/q7eF1aJkTE= +k8s.io/apiextensions-apiserver v0.31.0 h1:fZgCVhGwsclj3qCw1buVXCV6khjRzKC5eCFt24kyLSk= +k8s.io/apiextensions-apiserver v0.31.0/go.mod h1:b9aMDEYaEe5sdK+1T0KU78ApR/5ZVp4i56VacZYEHxk= +k8s.io/apimachinery v0.31.0 h1:m9jOiSr3FoSSL5WO9bjm1n6B9KROYYgNZOb4tyZ1lBc= +k8s.io/apimachinery v0.31.0/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo= +k8s.io/apiserver v0.31.0 h1:p+2dgJjy+bk+B1Csz+mc2wl5gHwvNkC9QJV+w55LVrY= +k8s.io/apiserver v0.31.0/go.mod h1:KI9ox5Yu902iBnnyMmy7ajonhKnkeZYJhTZ/YI+WEMk= +k8s.io/cli-runtime v0.31.0 h1:V2Q1gj1u3/WfhD475HBQrIYsoryg/LrhhK4RwpN+DhA= +k8s.io/cli-runtime v0.31.0/go.mod h1:vg3H94wsubuvWfSmStDbekvbla5vFGC+zLWqcf+bGDw= +k8s.io/client-go v0.31.0 h1:QqEJzNjbN2Yv1H79SsS+SWnXkBgVu4Pj3CJQgbx0gI8= +k8s.io/client-go v0.31.0/go.mod h1:Y9wvC76g4fLjmU0BA+rV+h2cncoadjvjjkkIGoTLcGU= +k8s.io/code-generator v0.31.0 h1:w607nrMi1KeDKB3/F/J4lIoOgAwc+gV9ZKew4XRfMp8= +k8s.io/code-generator v0.31.0/go.mod h1:84y4w3es8rOJOUUP1rLsIiGlO1JuEaPFXQPA9e/K6U0= +k8s.io/component-base v0.31.0 h1:/KIzGM5EvPNQcYgwq5NwoQBaOlVFrghoVGr8lG6vNRs= +k8s.io/component-base v0.31.0/go.mod h1:TYVuzI1QmN4L5ItVdMSXKvH7/DtvIuas5/mm8YT3rTo= +k8s.io/gengo/v2 v2.0.0-20240826214909-a7b603a56eb7 h1:cErOOTkQ3JW19o4lo91fFurouhP8NcoBvb7CkvhZZpk= +k8s.io/gengo/v2 v2.0.0-20240826214909-a7b603a56eb7/go.mod h1:EJykeLsmFC60UQbYJezXkEsG2FLrt0GPNkU5iK5GWxU= k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= -k8s.io/kms v0.30.7 h1:uxqXTHzgpPkr8RSb6zB0NrYOeXfdt5yHyQdFkRNGdz4= -k8s.io/kms v0.30.7/go.mod h1:GrMurD0qk3G4yNgGcsCEmepqf9KyyIrTXYR2lyUOJC4= -k8s.io/kube-aggregator v0.30.7 h1:27uHEqAX9OqteptducIoAPjesrcYWir2QIb1v/btabc= -k8s.io/kube-aggregator v0.30.7/go.mod h1:jWSRAe7kfNaYJ4pzn+9XeobUxZl+nC8huj2ZEAohgAg= -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/kubectl v0.30.7 h1:K9T8RufI5mKZmX5yITFzAT5I0fx9uheSVtR9OdbmIk4= -k8s.io/kubectl v0.30.7/go.mod h1:VdeIJnZTTkudzbMxkM25Us1MmeLeqhl+Eekt66eg7Ik= +k8s.io/kms v0.31.0 h1:KchILPfB1ZE+ka7223mpU5zeFNkmb45jl7RHnlImUaI= +k8s.io/kms v0.31.0/go.mod h1:OZKwl1fan3n3N5FFxnW5C4V3ygrah/3YXeJWS3O6+94= +k8s.io/kube-aggregator v0.31.0 h1:3DqSpmqHF8rey7fY+qYXLJms0tYPhxrgWvjpnKVnS0Y= +k8s.io/kube-aggregator v0.31.0/go.mod h1:Fa+OVSpMQC7zbTTz7/QG7FXe9jZ8usuJQej5sMdCrkM= +k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f h1:GA7//TjRY9yWGy1poLzYYJJ4JRdzg3+O6e8I+e+8T5Y= +k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f/go.mod h1:R/HEjbvWI0qdfb8viZUeVZm0X6IZnxAydC7YU42CMw4= +k8s.io/kubectl v0.31.0 h1:kANwAAPVY02r4U4jARP/C+Q1sssCcN/1p9Nk+7BQKVg= +k8s.io/kubectl v0.31.0/go.mod h1:pB47hhFypGsaHAPjlwrNbvhXgmuAr01ZBvAIIUaI8d4= k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 h1:pUdcCO1Lk/tbT5ztQWOBi5HBgbBP1J8+AsQnQCKsi8A= k8s.io/utils v0.0.0-20240711033017-18e509b52bc8/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= -sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.29.0 h1:/U5vjBbQn3RChhv7P11uhYvCSm5G2GaIi5AIGBS6r4c= -sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.29.0/go.mod h1:z7+wmGM2dfIiLRfrC6jb5kV2Mq/sK1ZP303cxzkV5Y4= -sigs.k8s.io/controller-runtime v0.18.5 h1:nTHio/W+Q4aBlQMgbnC5hZb4IjIidyrizMai9P6n4Rk= -sigs.k8s.io/controller-runtime v0.18.5/go.mod h1:TVoGrfdpbA9VRFaRnKgk9P5/atA0pMwq+f+msb9M8Sg= +sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.30.3 h1:2770sDpzrjjsAtVhSeUFseziht227YAWYHLGNM8QPwY= +sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.30.3/go.mod h1:Ve9uj1L+deCXFrPOk1LpFXqTg7LCFzFso6PA48q/XZw= +sigs.k8s.io/controller-runtime v0.19.0 h1:nWVM7aq+Il2ABxwiCizrVDSlmDcshi9llbaFbC0ji/Q= +sigs.k8s.io/controller-runtime v0.19.0/go.mod h1:iRmWllt8IlaLjvTTDLhRBXIEtkCK6hwVBJJsYS9Ajf4= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= sigs.k8s.io/structured-merge-diff/v4 v4.4.3 h1:sCP7Vv3xx/CWIuTPVN38lUPx0uw0lcLfzaiDa8Ja01A= diff --git a/internal/admission/plugin/resourcequota/controller.go b/internal/admission/plugin/resourcequota/controller.go index c8954873c..4321fbfc6 100644 --- a/internal/admission/plugin/resourcequota/controller.go +++ b/internal/admission/plugin/resourcequota/controller.go @@ -32,7 +32,7 @@ type EvaluatorController struct { quotaAccessor QuotaAccessor registry quota.Registry - queue workqueue.Interface + queue workqueue.TypedInterface[string] inProgress sets.Set[string] work map[string][]*admissionWaiter dirtyWork map[string][]*admissionWaiter @@ -42,7 +42,7 @@ func NewEvaluatorController(quotaAccessor QuotaAccessor, registry quota.Registry return &EvaluatorController{ quotaAccessor: quotaAccessor, registry: registry, - queue: workqueue.NewNamed("quota_admission_evaluator"), + queue: workqueue.NewTypedWithConfig[string](workqueue.TypedQueueConfig[string]{Name: "quota_admission_evaluator"}), inProgress: sets.New[string](), work: make(map[string][]*admissionWaiter), dirtyWork: make(map[string][]*admissionWaiter), @@ -214,11 +214,10 @@ func (e *EvaluatorController) completeWork(ns string) { } func (e *EvaluatorController) getWork() (string, []*admissionWaiter, bool) { - uncastNS, shutdown := e.queue.Get() + ns, shutdown := e.queue.Get() if shutdown { return "", nil, true } - ns := uncastNS.(string) e.workLock.Lock() defer e.workLock.Unlock() diff --git a/internal/apiserver/apiserver.go b/internal/apiserver/apiserver.go index 6e0710613..1880c08f0 100644 --- a/internal/apiserver/apiserver.go +++ b/internal/apiserver/apiserver.go @@ -12,7 +12,6 @@ import ( ipamrest "github.com/ironcore-dev/ironcore/internal/registry/ipam/rest" networkingrest "github.com/ironcore-dev/ironcore/internal/registry/networking/rest" storagerest "github.com/ironcore-dev/ironcore/internal/registry/storage/rest" - "k8s.io/apimachinery/pkg/version" "k8s.io/apiserver/pkg/registry/generic" genericapiserver "k8s.io/apiserver/pkg/server" serverstorage "k8s.io/apiserver/pkg/server/storage" @@ -56,12 +55,6 @@ func (cfg *Config) Complete() CompletedConfig { cfg.GenericConfig.Complete(), &cfg.ExtraConfig, } - - c.GenericConfig.Version = &version.Info{ - Major: "1", - Minor: "0", - } - return CompletedConfig{&c} } diff --git a/internal/app/apiserver/apiserver.go b/internal/app/apiserver/apiserver.go index 652ded327..231ba69d3 100644 --- a/internal/app/apiserver/apiserver.go +++ b/internal/app/apiserver/apiserver.go @@ -41,6 +41,7 @@ import ( genericoptions "k8s.io/apiserver/pkg/server/options" serverstorage "k8s.io/apiserver/pkg/server/storage" utilfeature "k8s.io/apiserver/pkg/util/feature" + utilversion "k8s.io/apiserver/pkg/util/version" netutils "k8s.io/utils/net" ) @@ -203,6 +204,8 @@ func (o *IronCoreAPIServerOptions) Config() (*apiserver.Config, error) { serverConfig := genericapiserver.NewRecommendedConfig(api.Codecs) + serverConfig.EffectiveVersion = utilversion.NewEffectiveVersion("1.0") + serverConfig.OpenAPIConfig = genericapiserver.DefaultOpenAPIConfig(ironcoreopenapi.GetOpenAPIDefinitions, openapi.NewDefinitionNamer(api.Scheme)) serverConfig.OpenAPIConfig.Info.Title = "ironcore-api" serverConfig.OpenAPIConfig.Info.Version = "0.1" @@ -244,11 +247,11 @@ func (o *IronCoreAPIServerOptions) Run(ctx context.Context) error { return err } - server.GenericAPIServer.AddPostStartHookOrDie("start-ironcore-api-server-informers", func(context genericapiserver.PostStartHookContext) error { - config.GenericConfig.SharedInformerFactory.Start(context.StopCh) - o.SharedInformerFactory.Start(context.StopCh) + server.GenericAPIServer.AddPostStartHookOrDie("start-ironcore-api-server-informers", func(hookContext genericapiserver.PostStartHookContext) error { + config.GenericConfig.SharedInformerFactory.Start(hookContext.Context.Done()) + o.SharedInformerFactory.Start(hookContext.Context.Done()) return nil }) - return server.GenericAPIServer.PrepareRun().Run(ctx.Done()) + return server.GenericAPIServer.PrepareRun().RunWithContext(ctx) } diff --git a/internal/controllers/compute/machine_scheduler.go b/internal/controllers/compute/machine_scheduler.go index 4ab7c3e16..5a59c275b 100644 --- a/internal/controllers/compute/machine_scheduler.go +++ b/internal/controllers/compute/machine_scheduler.go @@ -26,6 +26,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/handler" "sigs.k8s.io/controller-runtime/pkg/manager" "sigs.k8s.io/controller-runtime/pkg/predicate" + "sigs.k8s.io/controller-runtime/pkg/reconcile" ) const ( @@ -75,18 +76,18 @@ func (s *MachineScheduler) skipSchedule(log logr.Logger, machine *computev1alpha return isAssumed } -func (s *MachineScheduler) matchesLabels(ctx context.Context, pool *scheduler.ContainerInfo, machine *computev1alpha1.Machine) bool { +func (s *MachineScheduler) matchesLabels(_ context.Context, pool *scheduler.ContainerInfo, machine *computev1alpha1.Machine) bool { nodeLabels := labels.Set(pool.Node().Labels) machinePoolSelector := labels.SelectorFromSet(machine.Spec.MachinePoolSelector) return machinePoolSelector.Matches(nodeLabels) } -func (s *MachineScheduler) tolerateTaints(ctx context.Context, pool *scheduler.ContainerInfo, machine *computev1alpha1.Machine) bool { +func (s *MachineScheduler) tolerateTaints(_ context.Context, pool *scheduler.ContainerInfo, machine *computev1alpha1.Machine) bool { return v1alpha1.TolerateTaints(machine.Spec.Tolerations, pool.Node().Spec.Taints) } -func (s *MachineScheduler) fitsPool(ctx context.Context, pool *scheduler.ContainerInfo, machine *computev1alpha1.Machine) bool { +func (s *MachineScheduler) fitsPool(_ context.Context, pool *scheduler.ContainerInfo, machine *computev1alpha1.Machine) bool { machineClassName := machine.Spec.MachineClassRef.Name allocatable, ok := pool.Node().Status.Allocatable[corev1alpha1.ClassCountFor(corev1alpha1.ClassTypeMachineClass, machineClassName)] @@ -192,7 +193,7 @@ func (s *MachineScheduler) bind(ctx context.Context, log logr.Logger, assumed *c return nil } -func (s *MachineScheduler) enqueueUnscheduledMachines(ctx context.Context, queue workqueue.RateLimitingInterface) { +func (s *MachineScheduler) enqueueUnscheduledMachines(ctx context.Context, queue workqueue.TypedRateLimitingInterface[reconcile.Request]) { log := ctrl.LoggerFrom(ctx) machineList := &computev1alpha1.MachineList{} if err := s.List(ctx, machineList, client.MatchingFields{computeclient.MachineSpecMachinePoolRefNameField: ""}); err != nil { @@ -227,7 +228,7 @@ func (s *MachineScheduler) isMachineNotAssigned() predicate.Predicate { func (s *MachineScheduler) handleMachine() handler.EventHandler { return handler.Funcs{ - CreateFunc: func(ctx context.Context, evt event.CreateEvent, queue workqueue.RateLimitingInterface) { + CreateFunc: func(ctx context.Context, evt event.CreateEvent, queue workqueue.TypedRateLimitingInterface[reconcile.Request]) { machine := evt.Object.(*computev1alpha1.Machine) log := ctrl.LoggerFrom(ctx) @@ -235,7 +236,7 @@ func (s *MachineScheduler) handleMachine() handler.EventHandler { log.Error(err, "Error adding machine to cache") } }, - UpdateFunc: func(ctx context.Context, evt event.UpdateEvent, queue workqueue.RateLimitingInterface) { + UpdateFunc: func(ctx context.Context, evt event.UpdateEvent, queue workqueue.TypedRateLimitingInterface[reconcile.Request]) { log := ctrl.LoggerFrom(ctx) oldInstance := evt.ObjectOld.(*computev1alpha1.Machine) @@ -244,7 +245,7 @@ func (s *MachineScheduler) handleMachine() handler.EventHandler { log.Error(err, "Error updating machine in cache") } }, - DeleteFunc: func(ctx context.Context, evt event.DeleteEvent, queue workqueue.RateLimitingInterface) { + DeleteFunc: func(ctx context.Context, evt event.DeleteEvent, queue workqueue.TypedRateLimitingInterface[reconcile.Request]) { log := ctrl.LoggerFrom(ctx) instance := evt.Object.(*computev1alpha1.Machine) @@ -257,18 +258,18 @@ func (s *MachineScheduler) handleMachine() handler.EventHandler { func (s *MachineScheduler) handleMachinePool() handler.EventHandler { return handler.Funcs{ - CreateFunc: func(ctx context.Context, evt event.CreateEvent, queue workqueue.RateLimitingInterface) { + CreateFunc: func(ctx context.Context, evt event.CreateEvent, queue workqueue.TypedRateLimitingInterface[reconcile.Request]) { pool := evt.Object.(*computev1alpha1.MachinePool) s.Cache.AddContainer(pool) s.enqueueUnscheduledMachines(ctx, queue) }, - UpdateFunc: func(ctx context.Context, evt event.UpdateEvent, queue workqueue.RateLimitingInterface) { + UpdateFunc: func(ctx context.Context, evt event.UpdateEvent, queue workqueue.TypedRateLimitingInterface[reconcile.Request]) { oldPool := evt.ObjectOld.(*computev1alpha1.MachinePool) newPool := evt.ObjectNew.(*computev1alpha1.MachinePool) s.Cache.UpdateContainer(oldPool, newPool) s.enqueueUnscheduledMachines(ctx, queue) }, - DeleteFunc: func(ctx context.Context, evt event.DeleteEvent, queue workqueue.RateLimitingInterface) { + DeleteFunc: func(ctx context.Context, evt event.DeleteEvent, queue workqueue.TypedRateLimitingInterface[reconcile.Request]) { log := ctrl.LoggerFrom(ctx) pool := evt.Object.(*computev1alpha1.MachinePool) diff --git a/internal/controllers/compute/machineclass_controller.go b/internal/controllers/compute/machineclass_controller.go index ab80ec0d6..00e444821 100644 --- a/internal/controllers/compute/machineclass_controller.go +++ b/internal/controllers/compute/machineclass_controller.go @@ -20,6 +20,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" "sigs.k8s.io/controller-runtime/pkg/event" "sigs.k8s.io/controller-runtime/pkg/handler" + "sigs.k8s.io/controller-runtime/pkg/reconcile" ) // MachineClassReconciler reconciles a MachineClassRef object @@ -124,7 +125,7 @@ func (r *MachineClassReconciler) SetupWithManager(mgr ctrl.Manager) error { Watches( &computev1alpha1.Machine{}, handler.Funcs{ - DeleteFunc: func(ctx context.Context, event event.DeleteEvent, queue workqueue.RateLimitingInterface) { + DeleteFunc: func(ctx context.Context, event event.DeleteEvent, queue workqueue.TypedRateLimitingInterface[reconcile.Request]) { machine := event.Object.(*computev1alpha1.Machine) queue.Add(ctrl.Request{NamespacedName: types.NamespacedName{Name: machine.Spec.MachineClassRef.Name}}) }, diff --git a/internal/controllers/compute/suite_test.go b/internal/controllers/compute/suite_test.go index 4430ee8aa..154e7b5d7 100644 --- a/internal/controllers/compute/suite_test.go +++ b/internal/controllers/compute/suite_test.go @@ -27,8 +27,10 @@ import ( "k8s.io/client-go/kubernetes/scheme" "k8s.io/client-go/rest" "k8s.io/client-go/tools/record" + "k8s.io/utils/ptr" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" + ctrlconfig "sigs.k8s.io/controller-runtime/pkg/config" "sigs.k8s.io/controller-runtime/pkg/envtest" "sigs.k8s.io/controller-runtime/pkg/envtest/komega" logf "sigs.k8s.io/controller-runtime/pkg/log" @@ -118,6 +120,7 @@ var _ = BeforeSuite(func() { Metrics: metricserver.Options{ BindAddress: "0", }, + Controller: ctrlconfig.Controller{SkipNameValidation: ptr.To(true)}, }) Expect(err).ToNot(HaveOccurred()) diff --git a/internal/controllers/core/core_suite_test.go b/internal/controllers/core/core_suite_test.go index 933b907fe..22f6778c3 100644 --- a/internal/controllers/core/core_suite_test.go +++ b/internal/controllers/core/core_suite_test.go @@ -26,8 +26,10 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes/scheme" + "k8s.io/utils/ptr" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" + ctrlconfig "sigs.k8s.io/controller-runtime/pkg/config" "sigs.k8s.io/controller-runtime/pkg/envtest" "sigs.k8s.io/controller-runtime/pkg/envtest/komega" logf "sigs.k8s.io/controller-runtime/pkg/log" @@ -104,6 +106,7 @@ var _ = BeforeSuite(func() { Metrics: metricserver.Options{ BindAddress: "0", }, + Controller: ctrlconfig.Controller{SkipNameValidation: ptr.To(true)}, }) Expect(err).ToNot(HaveOccurred()) diff --git a/internal/controllers/ipam/prefix_controller.go b/internal/controllers/ipam/prefix_controller.go index 06b2522b4..4e1c897c5 100644 --- a/internal/controllers/ipam/prefix_controller.go +++ b/internal/controllers/ipam/prefix_controller.go @@ -27,6 +27,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" "sigs.k8s.io/controller-runtime/pkg/handler" + "sigs.k8s.io/controller-runtime/pkg/reconcile" ) const ( @@ -79,13 +80,13 @@ type PrefixReconciler struct { Scheme *runtime.Scheme PrefixAllocationTimeout time.Duration - allocationLimiter workqueue.RateLimiter + allocationLimiter workqueue.TypedRateLimiter[reconcile.Request] waitTimeByKey sync.Map } func (r *PrefixReconciler) allocationBackoffFor(key client.ObjectKey) time.Duration { now := time.Now() - waitTimeIface, _ := r.waitTimeByKey.LoadOrStore(key, now.Add(r.allocationLimiter.When(key))) + waitTimeIface, _ := r.waitTimeByKey.LoadOrStore(key, now.Add(r.allocationLimiter.When(reconcile.Request{NamespacedName: key}))) waitTime := waitTimeIface.(time.Time) if now.After(waitTime) { return 0 @@ -95,7 +96,7 @@ func (r *PrefixReconciler) allocationBackoffFor(key client.ObjectKey) time.Durat func (r *PrefixReconciler) forgetAllocationBackoffFor(key client.ObjectKey) { r.waitTimeByKey.Delete(key) - r.allocationLimiter.Forget(key) + r.allocationLimiter.Forget(reconcile.Request{NamespacedName: key}) } //+kubebuilder:rbac:groups=ipam.ironcore.dev,resources=prefixes,verbs=get;list;watch;create;update;patch;delete @@ -594,7 +595,7 @@ func (r *PrefixReconciler) reconcile(ctx context.Context, log logr.Logger, prefi // SetupWithManager sets up the controller with the Manager. func (r *PrefixReconciler) SetupWithManager(mgr ctrl.Manager) error { - r.allocationLimiter = workqueue.NewItemExponentialFailureRateLimiter(5*time.Millisecond, 1000*time.Second) + r.allocationLimiter = workqueue.NewTypedItemExponentialFailureRateLimiter[reconcile.Request](5*time.Millisecond, 1000*time.Second) return ctrl.NewControllerManagedBy(mgr). For(&ipamv1alpha1.Prefix{}). diff --git a/internal/controllers/ipam/suite_test.go b/internal/controllers/ipam/suite_test.go index 4c6c39847..a97b68c84 100644 --- a/internal/controllers/ipam/suite_test.go +++ b/internal/controllers/ipam/suite_test.go @@ -9,6 +9,7 @@ import ( "time" "github.com/ironcore-dev/controller-utils/buildutils" + ipamv1alpha1 "github.com/ironcore-dev/ironcore/api/ipam/v1alpha1" ipamclient "github.com/ironcore-dev/ironcore/internal/client/ipam" utilsenvtest "github.com/ironcore-dev/ironcore/utils/envtest" "github.com/ironcore-dev/ironcore/utils/envtest/apiserver" @@ -18,14 +19,14 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes/scheme" "k8s.io/client-go/tools/record" + "k8s.io/utils/ptr" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" + ctrlconfig "sigs.k8s.io/controller-runtime/pkg/config" "sigs.k8s.io/controller-runtime/pkg/envtest" logf "sigs.k8s.io/controller-runtime/pkg/log" "sigs.k8s.io/controller-runtime/pkg/log/zap" metricserver "sigs.k8s.io/controller-runtime/pkg/metrics/server" - - ipamv1alpha1 "github.com/ironcore-dev/ironcore/api/ipam/v1alpha1" //+kubebuilder:scaffold:imports ) @@ -95,6 +96,7 @@ var _ = BeforeSuite(func() { Metrics: metricserver.Options{ BindAddress: "0", }, + Controller: ctrlconfig.Controller{SkipNameValidation: ptr.To(true)}, }) Expect(err).ToNot(HaveOccurred()) diff --git a/internal/controllers/networking/loadbalancer_controller.go b/internal/controllers/networking/loadbalancer_controller.go index b9244513d..96d8bf5fc 100644 --- a/internal/controllers/networking/loadbalancer_controller.go +++ b/internal/controllers/networking/loadbalancer_controller.go @@ -23,6 +23,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/event" "sigs.k8s.io/controller-runtime/pkg/handler" "sigs.k8s.io/controller-runtime/pkg/predicate" + "sigs.k8s.io/controller-runtime/pkg/reconcile" ) var ( @@ -178,7 +179,7 @@ func (r *LoadBalancerReconciler) applyRouting( } func (r *LoadBalancerReconciler) enqueueByNetworkInterface() handler.EventHandler { - getEnqueueFunc := func(ctx context.Context, nic *networkingv1alpha1.NetworkInterface) func(nics []*networkingv1alpha1.NetworkInterface, queue workqueue.RateLimitingInterface) { + getEnqueueFunc := func(ctx context.Context, nic *networkingv1alpha1.NetworkInterface) func(nics []*networkingv1alpha1.NetworkInterface, queue workqueue.TypedRateLimitingInterface[reconcile.Request]) { log := ctrl.LoggerFrom(ctx) loadBalancerList := &networkingv1alpha1.LoadBalancerList{} if err := r.List(ctx, loadBalancerList, @@ -189,7 +190,7 @@ func (r *LoadBalancerReconciler) enqueueByNetworkInterface() handler.EventHandle return nil } - return func(nics []*networkingv1alpha1.NetworkInterface, queue workqueue.RateLimitingInterface) { + return func(nics []*networkingv1alpha1.NetworkInterface, queue workqueue.TypedRateLimitingInterface[reconcile.Request]) { for _, loadBalancer := range loadBalancerList.Items { loadBalancerKey := client.ObjectKeyFromObject(&loadBalancer) log := log.WithValues("LoadBalancerKey", loadBalancerKey) @@ -215,14 +216,14 @@ func (r *LoadBalancerReconciler) enqueueByNetworkInterface() handler.EventHandle } return handler.Funcs{ - CreateFunc: func(ctx context.Context, evt event.CreateEvent, queue workqueue.RateLimitingInterface) { + CreateFunc: func(ctx context.Context, evt event.CreateEvent, queue workqueue.TypedRateLimitingInterface[reconcile.Request]) { nic := evt.Object.(*networkingv1alpha1.NetworkInterface) enqueueFunc := getEnqueueFunc(ctx, nic) if enqueueFunc != nil { enqueueFunc([]*networkingv1alpha1.NetworkInterface{nic}, queue) } }, - UpdateFunc: func(ctx context.Context, evt event.UpdateEvent, queue workqueue.RateLimitingInterface) { + UpdateFunc: func(ctx context.Context, evt event.UpdateEvent, queue workqueue.TypedRateLimitingInterface[reconcile.Request]) { newNic := evt.ObjectNew.(*networkingv1alpha1.NetworkInterface) oldNic := evt.ObjectOld.(*networkingv1alpha1.NetworkInterface) enqueueFunc := getEnqueueFunc(ctx, newNic) @@ -230,14 +231,14 @@ func (r *LoadBalancerReconciler) enqueueByNetworkInterface() handler.EventHandle enqueueFunc([]*networkingv1alpha1.NetworkInterface{newNic, oldNic}, queue) } }, - DeleteFunc: func(ctx context.Context, evt event.DeleteEvent, queue workqueue.RateLimitingInterface) { + DeleteFunc: func(ctx context.Context, evt event.DeleteEvent, queue workqueue.TypedRateLimitingInterface[reconcile.Request]) { nic := evt.Object.(*networkingv1alpha1.NetworkInterface) enqueueFunc := getEnqueueFunc(ctx, nic) if enqueueFunc != nil { enqueueFunc([]*networkingv1alpha1.NetworkInterface{nic}, queue) } }, - GenericFunc: func(ctx context.Context, evt event.GenericEvent, queue workqueue.RateLimitingInterface) { + GenericFunc: func(ctx context.Context, evt event.GenericEvent, queue workqueue.TypedRateLimitingInterface[reconcile.Request]) { nic := evt.Object.(*networkingv1alpha1.NetworkInterface) enqueueFunc := getEnqueueFunc(ctx, nic) if enqueueFunc != nil { diff --git a/internal/controllers/networking/suite_test.go b/internal/controllers/networking/suite_test.go index 2b74918f6..4ed975e69 100644 --- a/internal/controllers/networking/suite_test.go +++ b/internal/controllers/networking/suite_test.go @@ -20,8 +20,10 @@ import ( . "github.com/onsi/gomega" "k8s.io/client-go/kubernetes/scheme" "k8s.io/utils/lru" + "k8s.io/utils/ptr" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" + ctrlconfig "sigs.k8s.io/controller-runtime/pkg/config" "sigs.k8s.io/controller-runtime/pkg/envtest" . "sigs.k8s.io/controller-runtime/pkg/envtest/komega" logf "sigs.k8s.io/controller-runtime/pkg/log" @@ -101,6 +103,7 @@ var _ = BeforeSuite(func() { Metrics: metricserver.Options{ BindAddress: "0", }, + Controller: ctrlconfig.Controller{SkipNameValidation: ptr.To(true)}, }) Expect(err).ToNot(HaveOccurred()) diff --git a/internal/controllers/storage/bucketclass_controller.go b/internal/controllers/storage/bucketclass_controller.go index 07ee42a56..03131c525 100644 --- a/internal/controllers/storage/bucketclass_controller.go +++ b/internal/controllers/storage/bucketclass_controller.go @@ -20,6 +20,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" "sigs.k8s.io/controller-runtime/pkg/event" "sigs.k8s.io/controller-runtime/pkg/handler" + "sigs.k8s.io/controller-runtime/pkg/reconcile" ) // BucketClassReconciler reconciles a BucketClass object @@ -123,7 +124,7 @@ func (r *BucketClassReconciler) SetupWithManager(mgr ctrl.Manager) error { Watches( &storagev1alpha1.Bucket{}, handler.Funcs{ - DeleteFunc: func(ctx context.Context, event event.DeleteEvent, queue workqueue.RateLimitingInterface) { + DeleteFunc: func(ctx context.Context, event event.DeleteEvent, queue workqueue.TypedRateLimitingInterface[reconcile.Request]) { bucket := event.Object.(*storagev1alpha1.Bucket) bucketClassRef := bucket.Spec.BucketClassRef if bucketClassRef == nil { diff --git a/internal/controllers/storage/suite_test.go b/internal/controllers/storage/suite_test.go index 6c67304a8..86902a214 100644 --- a/internal/controllers/storage/suite_test.go +++ b/internal/controllers/storage/suite_test.go @@ -12,6 +12,7 @@ import ( "github.com/ironcore-dev/controller-utils/buildutils" computev1alpha1 "github.com/ironcore-dev/ironcore/api/compute/v1alpha1" corev1alpha1 "github.com/ironcore-dev/ironcore/api/core/v1alpha1" + storagev1alpha1 "github.com/ironcore-dev/ironcore/api/storage/v1alpha1" computeclient "github.com/ironcore-dev/ironcore/internal/client/compute" storageclient "github.com/ironcore-dev/ironcore/internal/client/storage" "github.com/ironcore-dev/ironcore/internal/controllers/storage/scheduler" @@ -21,12 +22,12 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/tools/record" "k8s.io/utils/lru" + "k8s.io/utils/ptr" ctrl "sigs.k8s.io/controller-runtime" + ctrlconfig "sigs.k8s.io/controller-runtime/pkg/config" "sigs.k8s.io/controller-runtime/pkg/envtest/komega" metricserver "sigs.k8s.io/controller-runtime/pkg/metrics/server" - storagev1alpha1 "github.com/ironcore-dev/ironcore/api/storage/v1alpha1" - . "github.com/ironcore-dev/ironcore/utils/testing" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" @@ -118,6 +119,7 @@ var _ = BeforeSuite(func() { Metrics: metricserver.Options{ BindAddress: "0", }, + Controller: ctrlconfig.Controller{SkipNameValidation: ptr.To(true)}, }) Expect(err).ToNot(HaveOccurred()) diff --git a/internal/controllers/storage/volume_scheduler.go b/internal/controllers/storage/volume_scheduler.go index 33ba84f7c..e83fe0b6a 100644 --- a/internal/controllers/storage/volume_scheduler.go +++ b/internal/controllers/storage/volume_scheduler.go @@ -25,6 +25,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/handler" "sigs.k8s.io/controller-runtime/pkg/manager" "sigs.k8s.io/controller-runtime/pkg/predicate" + "sigs.k8s.io/controller-runtime/pkg/reconcile" ) const ( @@ -81,18 +82,18 @@ func (s *VolumeScheduler) skipSchedule(log logr.Logger, volume *storagev1alpha1. return isAssumed } -func (s *VolumeScheduler) matchesLabels(ctx context.Context, pool *scheduler.ContainerInfo, volume *storagev1alpha1.Volume) bool { +func (s *VolumeScheduler) matchesLabels(_ context.Context, pool *scheduler.ContainerInfo, volume *storagev1alpha1.Volume) bool { nodeLabels := labels.Set(pool.Node().Labels) volumePoolSelector := labels.SelectorFromSet(volume.Spec.VolumePoolSelector) return volumePoolSelector.Matches(nodeLabels) } -func (s *VolumeScheduler) tolerateTaints(ctx context.Context, pool *scheduler.ContainerInfo, volume *storagev1alpha1.Volume) bool { +func (s *VolumeScheduler) tolerateTaints(_ context.Context, pool *scheduler.ContainerInfo, volume *storagev1alpha1.Volume) bool { return v1alpha1.TolerateTaints(volume.Spec.Tolerations, pool.Node().Spec.Taints) } -func (s *VolumeScheduler) fitsPool(ctx context.Context, pool *scheduler.ContainerInfo, volume *storagev1alpha1.Volume) bool { +func (s *VolumeScheduler) fitsPool(_ context.Context, pool *scheduler.ContainerInfo, volume *storagev1alpha1.Volume) bool { volumeClassName := volume.Spec.VolumeClassRef.Name allocatable, ok := pool.Node().Status.Allocatable[corev1alpha1.ClassCountFor(corev1alpha1.ClassTypeVolumeClass, volumeClassName)] @@ -199,7 +200,7 @@ func (s *VolumeScheduler) reconcileExists(ctx context.Context, log logr.Logger, return ctrl.Result{}, nil } -func (s *VolumeScheduler) enqueueUnscheduledVolumes(ctx context.Context, queue workqueue.RateLimitingInterface) { +func (s *VolumeScheduler) enqueueUnscheduledVolumes(ctx context.Context, queue workqueue.TypedRateLimitingInterface[reconcile.Request]) { log := ctrl.LoggerFrom(ctx) volumeList := &storagev1alpha1.VolumeList{} if err := s.List(ctx, volumeList, client.MatchingFields{storageclient.VolumeSpecVolumePoolRefNameField: ""}); err != nil { @@ -234,7 +235,7 @@ func (s *VolumeScheduler) isVolumeNotAssigned() predicate.Predicate { func (s *VolumeScheduler) handleVolume() handler.EventHandler { return handler.Funcs{ - CreateFunc: func(ctx context.Context, evt event.CreateEvent, queue workqueue.RateLimitingInterface) { + CreateFunc: func(ctx context.Context, evt event.CreateEvent, queue workqueue.TypedRateLimitingInterface[reconcile.Request]) { volume := evt.Object.(*storagev1alpha1.Volume) log := ctrl.LoggerFrom(ctx) @@ -242,7 +243,7 @@ func (s *VolumeScheduler) handleVolume() handler.EventHandler { log.Error(err, "Error adding volume to cache") } }, - UpdateFunc: func(ctx context.Context, evt event.UpdateEvent, queue workqueue.RateLimitingInterface) { + UpdateFunc: func(ctx context.Context, evt event.UpdateEvent, queue workqueue.TypedRateLimitingInterface[reconcile.Request]) { log := ctrl.LoggerFrom(ctx) oldInstance := evt.ObjectOld.(*storagev1alpha1.Volume) @@ -251,7 +252,7 @@ func (s *VolumeScheduler) handleVolume() handler.EventHandler { log.Error(err, "Error updating volume in cache") } }, - DeleteFunc: func(ctx context.Context, evt event.DeleteEvent, queue workqueue.RateLimitingInterface) { + DeleteFunc: func(ctx context.Context, evt event.DeleteEvent, queue workqueue.TypedRateLimitingInterface[reconcile.Request]) { log := ctrl.LoggerFrom(ctx) instance := evt.Object.(*storagev1alpha1.Volume) @@ -264,18 +265,18 @@ func (s *VolumeScheduler) handleVolume() handler.EventHandler { func (s *VolumeScheduler) handleVolumePool() handler.EventHandler { return handler.Funcs{ - CreateFunc: func(ctx context.Context, evt event.CreateEvent, queue workqueue.RateLimitingInterface) { + CreateFunc: func(ctx context.Context, evt event.CreateEvent, queue workqueue.TypedRateLimitingInterface[reconcile.Request]) { pool := evt.Object.(*storagev1alpha1.VolumePool) s.Cache.AddContainer(pool) s.enqueueUnscheduledVolumes(ctx, queue) }, - UpdateFunc: func(ctx context.Context, evt event.UpdateEvent, queue workqueue.RateLimitingInterface) { + UpdateFunc: func(ctx context.Context, evt event.UpdateEvent, queue workqueue.TypedRateLimitingInterface[reconcile.Request]) { oldPool := evt.ObjectOld.(*storagev1alpha1.VolumePool) newPool := evt.ObjectNew.(*storagev1alpha1.VolumePool) s.Cache.UpdateContainer(oldPool, newPool) s.enqueueUnscheduledVolumes(ctx, queue) }, - DeleteFunc: func(ctx context.Context, evt event.DeleteEvent, queue workqueue.RateLimitingInterface) { + DeleteFunc: func(ctx context.Context, evt event.DeleteEvent, queue workqueue.TypedRateLimitingInterface[reconcile.Request]) { log := ctrl.LoggerFrom(ctx) pool := evt.Object.(*storagev1alpha1.VolumePool) diff --git a/internal/controllers/storage/volumeclass_controller.go b/internal/controllers/storage/volumeclass_controller.go index 8879f66f4..31efdf015 100644 --- a/internal/controllers/storage/volumeclass_controller.go +++ b/internal/controllers/storage/volumeclass_controller.go @@ -20,6 +20,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" "sigs.k8s.io/controller-runtime/pkg/event" "sigs.k8s.io/controller-runtime/pkg/handler" + "sigs.k8s.io/controller-runtime/pkg/reconcile" ) // VolumeClassReconciler reconciles a VolumeClass object @@ -123,7 +124,7 @@ func (r *VolumeClassReconciler) SetupWithManager(mgr ctrl.Manager) error { Watches( &storagev1alpha1.Volume{}, handler.Funcs{ - DeleteFunc: func(ctx context.Context, event event.DeleteEvent, queue workqueue.RateLimitingInterface) { + DeleteFunc: func(ctx context.Context, event event.DeleteEvent, queue workqueue.TypedRateLimitingInterface[reconcile.Request]) { volume := event.Object.(*storagev1alpha1.Volume) volumeClassRef := volume.Spec.VolumeClassRef if volumeClassRef == nil { diff --git a/poollet/bucketpoollet/bem/bem_test.go b/poollet/bucketpoollet/bem/bem_test.go index 775eaffed..0e16d2e00 100644 --- a/poollet/bucketpoollet/bem/bem_test.go +++ b/poollet/bucketpoollet/bem/bem_test.go @@ -23,8 +23,10 @@ import ( "k8s.io/apimachinery/pkg/fields" "k8s.io/client-go/kubernetes/scheme" "k8s.io/client-go/tools/record" + "k8s.io/utils/ptr" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" + ctrlconfig "sigs.k8s.io/controller-runtime/pkg/config" metricserver "sigs.k8s.io/controller-runtime/pkg/metrics/server" ) @@ -51,6 +53,7 @@ var _ = Describe("BucketEventMapper", func() { Metrics: metricserver.Options{ BindAddress: "0", }, + Controller: ctrlconfig.Controller{SkipNameValidation: ptr.To(true)}, }) Expect(err).ToNot(HaveOccurred()) diff --git a/poollet/bucketpoollet/controllers/controllers_suite_test.go b/poollet/bucketpoollet/controllers/controllers_suite_test.go index 2f081ec2f..fbd64112d 100644 --- a/poollet/bucketpoollet/controllers/controllers_suite_test.go +++ b/poollet/bucketpoollet/controllers/controllers_suite_test.go @@ -30,8 +30,10 @@ import ( "k8s.io/client-go/kubernetes/scheme" "k8s.io/client-go/rest" "k8s.io/client-go/tools/record" + "k8s.io/utils/ptr" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" + ctrlconfig "sigs.k8s.io/controller-runtime/pkg/config" "sigs.k8s.io/controller-runtime/pkg/envtest" logf "sigs.k8s.io/controller-runtime/pkg/log" "sigs.k8s.io/controller-runtime/pkg/log/zap" @@ -184,6 +186,7 @@ func SetupTest() (*corev1.Namespace, *storagev1alpha1.BucketPool, *storagev1alph Metrics: metricserver.Options{ BindAddress: "0", }, + Controller: ctrlconfig.Controller{SkipNameValidation: ptr.To(true)}, }) Expect(err).ToNot(HaveOccurred()) diff --git a/poollet/machinepoollet/controllers/controllers_suite_test.go b/poollet/machinepoollet/controllers/controllers_suite_test.go index 2a521a13f..59a2b6089 100644 --- a/poollet/machinepoollet/controllers/controllers_suite_test.go +++ b/poollet/machinepoollet/controllers/controllers_suite_test.go @@ -35,8 +35,10 @@ import ( "k8s.io/client-go/kubernetes/scheme" "k8s.io/client-go/rest" "k8s.io/client-go/tools/record" + "k8s.io/utils/ptr" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" + ctrlconfig "sigs.k8s.io/controller-runtime/pkg/config" "sigs.k8s.io/controller-runtime/pkg/envtest" . "sigs.k8s.io/controller-runtime/pkg/envtest/komega" logf "sigs.k8s.io/controller-runtime/pkg/log" @@ -193,6 +195,7 @@ func SetupTest() (*corev1.Namespace, *computev1alpha1.MachinePool, *computev1alp Metrics: metricserver.Options{ BindAddress: "0", }, + Controller: ctrlconfig.Controller{SkipNameValidation: ptr.To(true)}, }) Expect(err).ToNot(HaveOccurred()) diff --git a/poollet/machinepoollet/handler/handler.go b/poollet/machinepoollet/handler/handler.go index 6fb1fdb01..21a6c901c 100644 --- a/poollet/machinepoollet/handler/handler.go +++ b/poollet/machinepoollet/handler/handler.go @@ -13,26 +13,26 @@ import ( // EnqueueRequestForName enqueues a reconcile.Request for a name without namespace. type EnqueueRequestForName string -func (e EnqueueRequestForName) enqueue(queue workqueue.RateLimitingInterface) { +func (e EnqueueRequestForName) enqueue(queue workqueue.TypedRateLimitingInterface[reconcile.Request]) { queue.Add(reconcile.Request{NamespacedName: client.ObjectKey{Name: string(e)}}) } // Create implements handler.EventHandler. -func (e EnqueueRequestForName) Create(_ event.CreateEvent, queue workqueue.RateLimitingInterface) { +func (e EnqueueRequestForName) Create(_ event.CreateEvent, queue workqueue.TypedRateLimitingInterface[reconcile.Request]) { e.enqueue(queue) } // Update implements handler.EventHandler. -func (e EnqueueRequestForName) Update(_ event.UpdateEvent, queue workqueue.RateLimitingInterface) { +func (e EnqueueRequestForName) Update(_ event.UpdateEvent, queue workqueue.TypedRateLimitingInterface[reconcile.Request]) { e.enqueue(queue) } // Delete implements handler.EventHandler. -func (e EnqueueRequestForName) Delete(_ event.DeleteEvent, queue workqueue.RateLimitingInterface) { +func (e EnqueueRequestForName) Delete(_ event.DeleteEvent, queue workqueue.TypedRateLimitingInterface[reconcile.Request]) { e.enqueue(queue) } // Generic implements handler.EventHandler. -func (e EnqueueRequestForName) Generic(_ event.GenericEvent, queue workqueue.RateLimitingInterface) { +func (e EnqueueRequestForName) Generic(_ event.GenericEvent, queue workqueue.TypedRateLimitingInterface[reconcile.Request]) { e.enqueue(queue) } diff --git a/poollet/machinepoollet/mem/mem_test.go b/poollet/machinepoollet/mem/mem_test.go index dbcb89596..b4ecb4a5b 100644 --- a/poollet/machinepoollet/mem/mem_test.go +++ b/poollet/machinepoollet/mem/mem_test.go @@ -23,8 +23,10 @@ import ( "k8s.io/apimachinery/pkg/fields" "k8s.io/client-go/kubernetes/scheme" "k8s.io/client-go/tools/record" + "k8s.io/utils/ptr" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" + ctrlconfig "sigs.k8s.io/controller-runtime/pkg/config" metricserver "sigs.k8s.io/controller-runtime/pkg/metrics/server" ) @@ -53,6 +55,7 @@ var _ = Describe("MachineEventMapper", func() { Metrics: metricserver.Options{ BindAddress: "0", }, + Controller: ctrlconfig.Controller{SkipNameValidation: ptr.To(true)}, }) Expect(err).ToNot(HaveOccurred()) diff --git a/poollet/volumepoollet/controllers/controllers_suite_test.go b/poollet/volumepoollet/controllers/controllers_suite_test.go index fdc57fafc..090522a36 100644 --- a/poollet/volumepoollet/controllers/controllers_suite_test.go +++ b/poollet/volumepoollet/controllers/controllers_suite_test.go @@ -30,8 +30,10 @@ import ( "k8s.io/client-go/kubernetes/scheme" "k8s.io/client-go/rest" "k8s.io/client-go/tools/record" + "k8s.io/utils/ptr" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" + ctrlconfig "sigs.k8s.io/controller-runtime/pkg/config" "sigs.k8s.io/controller-runtime/pkg/envtest" . "sigs.k8s.io/controller-runtime/pkg/envtest/komega" logf "sigs.k8s.io/controller-runtime/pkg/log" @@ -208,6 +210,7 @@ func SetupTest() (*corev1.Namespace, *storagev1alpha1.VolumePool, *storagev1alph Metrics: metricserver.Options{ BindAddress: "0", }, + Controller: ctrlconfig.Controller{SkipNameValidation: ptr.To(true)}, }) Expect(err).ToNot(HaveOccurred()) diff --git a/poollet/volumepoollet/vem/vem_test.go b/poollet/volumepoollet/vem/vem_test.go index 096c42a67..516ca9b05 100644 --- a/poollet/volumepoollet/vem/vem_test.go +++ b/poollet/volumepoollet/vem/vem_test.go @@ -26,8 +26,10 @@ import ( "k8s.io/apimachinery/pkg/fields" "k8s.io/client-go/kubernetes/scheme" "k8s.io/client-go/tools/record" + "k8s.io/utils/ptr" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" + ctrlconfig "sigs.k8s.io/controller-runtime/pkg/config" metricserver "sigs.k8s.io/controller-runtime/pkg/metrics/server" ) @@ -56,6 +58,7 @@ var _ = Describe("VolumeEventMapper", func() { Metrics: metricserver.Options{ BindAddress: "0", }, + Controller: ctrlconfig.Controller{SkipNameValidation: ptr.To(true)}, }) Expect(err).ToNot(HaveOccurred()) diff --git a/utils/certificate/rotator.go b/utils/certificate/rotator.go index 9d73bcece..2f82fa54f 100644 --- a/utils/certificate/rotator.go +++ b/utils/certificate/rotator.go @@ -57,7 +57,7 @@ type rotator struct { forceInitial bool certificate atomic.Pointer[tls.Certificate] - queue workqueue.RateLimitingInterface + queue workqueue.TypedRateLimitingInterface[string] } type Rotator interface { @@ -278,7 +278,7 @@ func (r *rotator) rotate(ctx context.Context) error { return nil } -func (r *rotator) enqueue(key interface{}) { +func (r *rotator) enqueue(key string) { // If we want a forced initial rotation, respect it / reset it afterwards. force := r.forceInitial if force { @@ -349,7 +349,7 @@ func (r *rotator) Start(ctx context.Context) error { } r.started = true - r.queue = workqueue.NewRateLimitingQueue(workqueue.DefaultControllerRateLimiter()) + r.queue = workqueue.NewTypedRateLimitingQueue(workqueue.DefaultTypedControllerRateLimiter[string]()) r.startedMu.Unlock() var wg sync.WaitGroup diff --git a/utils/client/config/controller.go b/utils/client/config/controller.go index 07f3c0d70..6cd82388e 100644 --- a/utils/client/config/controller.go +++ b/utils/client/config/controller.go @@ -65,7 +65,7 @@ type controller struct { logConstructor func() logr.Logger store Store - queue workqueue.RateLimitingInterface + queue workqueue.TypedRateLimitingInterface[string] configRotator utilrest.ConfigRotator } @@ -181,7 +181,7 @@ func (c *controller) Start(ctx context.Context) error { return fmt.Errorf("controller was already started") } - c.queue = workqueue.NewRateLimitingQueue(workqueue.DefaultControllerRateLimiter()) + c.queue = workqueue.NewTypedRateLimitingQueue(workqueue.DefaultTypedControllerRateLimiter[string]()) go func() { <-ctx.Done() c.queue.ShutDown() diff --git a/utils/debug/handler.go b/utils/debug/handler.go index 255453d84..1967abab5 100644 --- a/utils/debug/handler.go +++ b/utils/debug/handler.go @@ -1,6 +1,5 @@ // SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors // SPDX-License-Identifier: Apache-2.0 - package debug import ( @@ -13,39 +12,79 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/event" "sigs.k8s.io/controller-runtime/pkg/handler" + "sigs.k8s.io/controller-runtime/pkg/reconcile" ) type loggingQueue struct { mu sync.RWMutex - done bool - log logr.Logger - workqueue.RateLimitingInterface + done bool + log logr.Logger + queue workqueue.TypedRateLimitingInterface[reconcile.Request] } -func newLoggingQueue(log logr.Logger, queue workqueue.RateLimitingInterface) *loggingQueue { - return &loggingQueue{log: log, RateLimitingInterface: queue} +func newLoggingQueue(log logr.Logger, queue workqueue.TypedRateLimitingInterface[reconcile.Request]) *loggingQueue { + return &loggingQueue{log: log, queue: queue} } -func (q *loggingQueue) Add(item interface{}) { +func (q *loggingQueue) Add(item reconcile.Request) { q.mu.RLock() defer q.mu.RUnlock() q.log.Info("Add", "Item", item, "Done", q.done) - q.RateLimitingInterface.Add(item) + q.queue.Add(item) } -func (q *loggingQueue) AddRateLimited(item interface{}) { +func (q *loggingQueue) AddRateLimited(item reconcile.Request) { q.mu.RLock() defer q.mu.RUnlock() q.log.Info("AddRateLimited", "Item", item, "Done", q.done) - q.RateLimitingInterface.AddRateLimited(item) + q.queue.AddRateLimited(item) } -func (q *loggingQueue) AddAfter(item interface{}, duration time.Duration) { +func (q *loggingQueue) AddAfter(item reconcile.Request, duration time.Duration) { q.mu.RLock() defer q.mu.RUnlock() q.log.Info("AddAfter", "Item", item, "Duration", duration, "Done", q.done) - q.RateLimitingInterface.AddAfter(item, duration) + q.queue.AddAfter(item, duration) +} + +func (q *loggingQueue) Done(item reconcile.Request) { + q.mu.Lock() + defer q.mu.Unlock() + q.done = true + q.queue.Done(item) +} + +func (q *loggingQueue) Forget(item reconcile.Request) { + q.queue.Forget(item) +} + +func (q *loggingQueue) NumRequeues(item reconcile.Request) int { + return q.queue.NumRequeues(item) +} + +func (q *loggingQueue) Get() (reconcile.Request, bool) { + item, shutdown := q.queue.Get() + if shutdown { + return reconcile.Request{}, false + } + return item, true +} + +func (q *loggingQueue) Len() int { + return q.queue.Len() +} + +func (q *loggingQueue) ShutDown() { + q.queue.ShutDown() +} + +func (q *loggingQueue) ShutDownWithDrain() { + q.queue.ShutDownWithDrain() +} + +func (q *loggingQueue) ShuttingDown() bool { + return q.queue.ShuttingDown() } func (q *loggingQueue) Finish() { @@ -60,7 +99,7 @@ type debugHandler struct { objectValue func(client.Object) any } -func (d *debugHandler) Create(ctx context.Context, evt event.CreateEvent, queue workqueue.RateLimitingInterface) { +func (d *debugHandler) Create(ctx context.Context, evt event.CreateEvent, queue workqueue.TypedRateLimitingInterface[reconcile.Request]) { log := d.log.WithValues("Event", "Create", "Object", d.objectValue(evt.Object)) log.Info("Handling Event") @@ -70,7 +109,7 @@ func (d *debugHandler) Create(ctx context.Context, evt event.CreateEvent, queue d.handler.Create(ctx, evt, lQueue) } -func (d *debugHandler) Update(ctx context.Context, evt event.UpdateEvent, queue workqueue.RateLimitingInterface) { +func (d *debugHandler) Update(ctx context.Context, evt event.UpdateEvent, queue workqueue.TypedRateLimitingInterface[reconcile.Request]) { log := d.log.WithValues("Event", "Update", "ObjectOld", d.objectValue(evt.ObjectOld), "ObjectNew", d.objectValue(evt.ObjectNew)) log.Info("Handling Event") @@ -80,7 +119,7 @@ func (d *debugHandler) Update(ctx context.Context, evt event.UpdateEvent, queue d.handler.Update(ctx, evt, lQueue) } -func (d *debugHandler) Delete(ctx context.Context, evt event.DeleteEvent, queue workqueue.RateLimitingInterface) { +func (d *debugHandler) Delete(ctx context.Context, evt event.DeleteEvent, queue workqueue.TypedRateLimitingInterface[reconcile.Request]) { log := d.log.WithValues("Event", "Delete", "Object", d.objectValue(evt.Object)) log.Info("Handling Event") @@ -90,7 +129,7 @@ func (d *debugHandler) Delete(ctx context.Context, evt event.DeleteEvent, queue d.handler.Delete(ctx, evt, lQueue) } -func (d *debugHandler) Generic(ctx context.Context, evt event.GenericEvent, queue workqueue.RateLimitingInterface) { +func (d *debugHandler) Generic(ctx context.Context, evt event.GenericEvent, queue workqueue.TypedRateLimitingInterface[reconcile.Request]) { log := d.log.WithValues("Event", "Generic", "Object", d.objectValue(evt.Object)) log.Info("Handling Event") diff --git a/utils/rest/configrotator.go b/utils/rest/configrotator.go index 53b77311d..b6d84246c 100644 --- a/utils/rest/configrotator.go +++ b/utils/rest/configrotator.go @@ -65,7 +65,7 @@ type configRotator struct { certRotator certificate.Rotator - queue workqueue.RateLimitingInterface + queue workqueue.TypedRateLimitingInterface[string] closeConns func() baseConfig *rest.Config @@ -270,7 +270,7 @@ func (r *configRotator) Start(ctx context.Context) error { return fmt.Errorf("configRotator already started") } - r.queue = workqueue.NewRateLimitingQueue(workqueue.DefaultControllerRateLimiter()) + r.queue = workqueue.NewTypedRateLimitingQueue(workqueue.DefaultTypedControllerRateLimiter[string]()) go func() { <-ctx.Done() r.queue.ShutDown()