chore: Bump golang dependencies in backend & controller - #1306
Conversation
b7ec83f to
b9e25e7
Compare
|
@christian-heusel: GitHub didn't allow me to request PR reviews from the following users: aojea. Note that only kubeflow members and repo collaborators can review this PR, and authors cannot review their own PRs. DetailsIn response to this: Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
/lgtm |
|
@aojea: changing LGTM is restricted to collaborators DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
b9e25e7 to
f27a456
Compare
andyatmiami
left a comment
There was a problem hiding this comment.
thanks @christian-heusel - I have one suggestion here from reviewing the various change logs across these version bumps...
controller-runtime v0.21: client-side rate limiter removed
Starting with controller-runtime v0.21, the default client-side rate limiter (QPS=20, Burst=30) was disabled by default — the rest config now ships with no client-side rate limiting.
Backend: Already mitigated. cmd/main.go explicitly sets kubeconfig.QPS and kubeconfig.Burst from env vars (defaults: QPS=50, Burst=100).
Controller: Uses ctrl.GetConfigOrDie() at cmd/main.go:123 without setting explicit QPS/Burst on the rest config. After this bump, the controller will have no client-side rate limiting on API calls. The API server's server-side priority & fairness provides some protection, but under heavy load (many workspaces reconciling simultaneously) the controller may generate more concurrent API requests than before.
Purely out of paranoia - seems like maybe we should configure the controller similarly to the backend - but note as I say this - I'm not fully appreciative of the ramifications here... feel free to push back
Note: The
RateLimiteratcmd/main.go:176/191is the workqueue rate limiter (controls reconcile requeue timing), not the Kubernetes API client rate limiter.
good catch , I think the importance of this parameters is on the number of write requests the controller does, how many objects it updates and creates , so having client side enable always help to avoid storming the apiserver and being consistent across the project seems a good call |
f27a456 to
f6fc70f
Compare
controller-runtime deprecates Result.Requeue in favor of RequeueAfter / returning an error (see the v0.24.1 field docs). The dependency bump in kubeflow#1306 moves the controller to a version where staticcheck flags every usage as SA1019, so this proactively removes them (the change is valid on the current controller-runtime v0.19.1 too). This replaces every usage in the controller reconcilers: - Conflict-retry sites now return the conflict error so the workqueue rate-limiter handles retry-on-error (its documented purpose), which preserves the same rate-limited backoff that Requeue: true provided. - Stale-cache sites (ServiceAccount not yet in the cache) rely on the Owns(ServiceAccount) watch to requeue, matching the existing comments. - mergeReconcileResult drops its .Requeue handling and now merges purely on RequeueAfter; its unit test is updated accordingly. Tradeoff for discussion: conflict errors are now surfaced by controller-runtime at error level rather than staying quiet at V(2). Assisted-by: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Christian Heusel <christian@heusel.eu>
f6fc70f to
837bfbc
Compare
Bump k8s.io libraries, controller-runtime, ginkgo/gomega, and their transitive deps. Fix `headerrequest.New` call in internal/auth for its new `uidHeaders` parameter, and regenerate the OpenAPI spec to pick up the resulting upstream API changes. Assisted-by: Claude Sonnet 5 <noreply@anthropic.com> Signed-off-by: Christian Heusel <christian@heusel.eu>
Bump k8s.io libraries, controller-runtime, istio.io/api and istio.io/client-go, and their transitive deps, to match the versions used in workspaces/backend. Also switch NewWebhookManagedBy/admission.Validator usage in workspace_webhook.go and workspacekind_webhook.go to the typed API instead of manually type-asserting runtime.Object. Regenerate the WorkspaceKind CRD for new upstream corev1 fields. Assisted-by: Claude Sonnet 5 <noreply@anthropic.com> Signed-off-by: Christian Heusel <christian@heusel.eu>
controller-runtime v0.21 removed the default client-side rate limiter (QPS=20, Burst=30), so the controller's Kubernetes API client no longer has any client-side rate limiting after the dependency bump. Mirror the backend by setting QPS/Burst explicitly on the rest.Config, configurable via --client-qps/CLIENT_QPS (default 50) and --client-burst/CLIENT_BURST (default 100). REFERENCE: kubernetes-sigs/controller-runtime#3119 Assisted-by: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Christian Heusel <christian@heusel.eu>
controller-runtime deprecates Result.Requeue in favor of RequeueAfter / returning an error (see the v0.24.1 field docs). The dependency bump in kubeflow#1306 moves the controller to a version where staticcheck flags every usage as SA1019, so this proactively removes them (the change is valid on the current controller-runtime v0.19.1 too). This replaces every usage in the controller reconcilers: - Conflict-retry sites now return the conflict error so the workqueue rate-limiter handles retry-on-error (its documented purpose), which preserves the same rate-limited backoff that Requeue: true provided. - Stale-cache sites (ServiceAccount not yet in the cache) rely on the Owns(ServiceAccount) watch to requeue, matching the existing comments. - mergeReconcileResult drops its .Requeue handling and now merges purely on RequeueAfter; its unit test is updated accordingly. Tradeoff for discussion: conflict errors are now surfaced by controller-runtime at error level rather than staying quiet at V(2). Assisted-by: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Christian Heusel <christian@heusel.eu>
837bfbc to
17a3f8e
Compare
`controller-runtime` deprecates `reconcile.Result.Requeue` in favor of `RequeueAfter` / returning an error. The dependency bump in kubeflow#1306 moves the controller to `controller-runtime v0.24.1`, where `staticcheck` flags **every** `Result{Requeue: true}` usage as `SA1019`: This setting is deprecated as it causes confusion and there is no good reason to use it. When waiting for an external event to happen, either the duration until it is supposed to happen or an appropriate poll interval should be used, rather than an interval emitted by a ratelimiter whose purpose it is to control retry on error. Deprecated: Use `RequeueAfter` instead. Therefore this change replaces every usage in the controller reconcilers: - Conflict-retry sites now return the conflict error so the workqueue rate-limiter handles retry-on-error (its documented purpose), which preserves the same rate-limited backoff that `Requeue: true` provided. - Stale-cache sites (`ServiceAccount` not yet in the cache) rely on the `Owns(ServiceAccount)` watch to requeue, matching the existing comments. - `mergeReconcileResult` drops its `.Requeue` handling and now merges purely on `RequeueAfter` its unit test is updated accordingly. Tradeoff for discussion: conflict errors are now surfaced by controller-runtime at error level rather than staying quiet at `V(2)`. Assisted-by: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Christian Heusel <christian@heusel.eu>
cef17ca to
9f20305
Compare
…pimachinery import Assisted-by: Claude Sonnet 5 <noreply@anthropic.com> Signed-off-by: Christian Heusel <christian@heusel.eu>
`controller-runtime` deprecates `reconcile.Result.Requeue` in favor of `RequeueAfter` / returning an error. The dependency bump in kubeflow#1306 moves the controller to `controller-runtime v0.24.1`, where `staticcheck` flags **every** `Result{Requeue: true}` usage as `SA1019`: This setting is deprecated as it causes confusion and there is no good reason to use it. When waiting for an external event to happen, either the duration until it is supposed to happen or an appropriate poll interval should be used, rather than an interval emitted by a ratelimiter whose purpose it is to control retry on error. Deprecated: Use `RequeueAfter` instead. Therefore this change replaces every usage in the controller reconcilers: - Conflict-retry sites now return the conflict error so the workqueue rate-limiter handles retry-on-error (its documented purpose), which preserves the same rate-limited backoff that `Requeue: true` provided. - Stale-cache sites (`ServiceAccount` not yet in the cache) rely on the `Owns(ServiceAccount)` watch to requeue, matching the existing comments. - `mergeReconcileResult` drops its `.Requeue` handling and now merges purely on `RequeueAfter` its unit test is updated accordingly. Tradeoff for discussion: conflict errors are now surfaced by controller-runtime at error level rather than staying quiet at `V(2)`. Assisted-by: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Christian Heusel <christian@heusel.eu>
Fixing it will involve more care and work than appropriate to this dependency bump PR, hence we'll defer this refactor to another task. Signed-off-by: Christian Heusel <christian@heusel.eu>
9f20305 to
94c7ef4
Compare
andyatmiami
left a comment
There was a problem hiding this comment.
/lgtm
/approve
thanks @christian-heusel - really appreciate you always pushing and staying on top of the little details like dependency versions to make Kubeflow Workspaces awesome and enterprise ready.
from reviewing the change logs for the dependencies being updated - and the minimal changes you delivered to account for these dep upgrades - I think this is looking good and ready to be merged...
timing wise - as we just shipping the beta - this is also the best time to do work like this.. in the event we missed some weird/subtle thing - we'll have plenty of time to find it (or let community find it) - and be better position for our GA near EOY!
testing methodology:
- PR-1306-TEST-RESULTS.md
- agent driven, human reviewed/approved
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: andyatmiami The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
4802939
into
kubeflow:notebooks-v2
`controller-runtime` deprecates `reconcile.Result.Requeue` in favor of `RequeueAfter` / returning an error. The dependency bump in kubeflow#1306 moves the controller to `controller-runtime v0.24.1`, where `staticcheck` flags **every** `Result{Requeue: true}` usage as `SA1019`: This setting is deprecated as it causes confusion and there is no good reason to use it. When waiting for an external event to happen, either the duration until it is supposed to happen or an appropriate poll interval should be used, rather than an interval emitted by a ratelimiter whose purpose it is to control retry on error. Deprecated: Use `RequeueAfter` instead. Therefore this change replaces every usage in the controller reconcilers: - Conflict-retry sites now return the conflict error so the workqueue rate-limiter handles retry-on-error (its documented purpose), which preserves the same rate-limited backoff that `Requeue: true` provided. - Stale-cache sites (`ServiceAccount` not yet in the cache) rely on the `Owns(ServiceAccount)` watch to requeue, matching the existing comments. - `mergeReconcileResult` drops its `.Requeue` handling and now merges purely on `RequeueAfter` its unit test is updated accordingly. Tradeoff for discussion: conflict errors are now surfaced by controller-runtime at error level rather than staying quiet at `V(2)`. Assisted-by: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Christian Heusel <christian@heusel.eu>
`controller-runtime` deprecates `reconcile.Result.Requeue` in favor of `RequeueAfter` / returning an error. The dependency bump in kubeflow#1306 moves the controller to `controller-runtime v0.24.1`, where `staticcheck` flags **every** `Result{Requeue: true}` usage as `SA1019`: This setting is deprecated as it causes confusion and there is no good reason to use it. When waiting for an external event to happen, either the duration until it is supposed to happen or an appropriate poll interval should be used, rather than an interval emitted by a ratelimiter whose purpose it is to control retry on error. Deprecated: Use `RequeueAfter` instead. Therefore this change replaces every usage in the controller reconcilers: - Conflict-retry sites now return the conflict error so the workqueue rate-limiter handles retry-on-error (its documented purpose), which preserves the same rate-limited backoff that `Requeue: true` provided. - Stale-cache sites (`ServiceAccount` not yet in the cache) rely on the `Owns(ServiceAccount)` watch to requeue, matching the existing comments. - `mergeReconcileResult` drops its `.Requeue` handling and now merges purely on `RequeueAfter` its unit test is updated accordingly. Tradeoff for discussion: conflict errors are now surfaced by controller-runtime at error level rather than staying quiet at `V(2)`. Assisted-by: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Christian Heusel <christian@heusel.eu>
`controller-runtime` deprecates `reconcile.Result.Requeue` in favor of `RequeueAfter` / returning an error. The dependency bump in kubeflow#1306 moves the controller to `controller-runtime v0.24.1`, where `staticcheck` flags **every** `Result{Requeue: true}` usage as `SA1019`: This setting is deprecated as it causes confusion and there is no good reason to use it. When waiting for an external event to happen, either the duration until it is supposed to happen or an appropriate poll interval should be used, rather than an interval emitted by a ratelimiter whose purpose it is to control retry on error. Deprecated: Use `RequeueAfter` instead. Therefore this change replaces every usage in the controller reconcilers: - Conflict-retry sites now return the conflict error so the workqueue rate-limiter handles retry-on-error (its documented purpose), which preserves the same rate-limited backoff that `Requeue: true` provided. - Stale-cache sites (`ServiceAccount` not yet in the cache) rely on the `Owns(ServiceAccount)` watch to requeue, matching the existing comments. - `mergeReconcileResult` drops its `.Requeue` handling and now merges purely on `RequeueAfter` its unit test is updated accordingly. Tradeoff for discussion: conflict errors are now surfaced by controller-runtime at error level rather than staying quiet at `V(2)`. Assisted-by: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Christian Heusel <christian@heusel.eu>
`controller-runtime` deprecates `reconcile.Result.Requeue` in favor of `RequeueAfter` / returning an error. The dependency bump in kubeflow#1306 moves the controller to `controller-runtime v0.24.1`, where `staticcheck` flags **every** `Result{Requeue: true}` usage as `SA1019`: This setting is deprecated as it causes confusion and there is no good reason to use it. When waiting for an external event to happen, either the duration until it is supposed to happen or an appropriate poll interval should be used, rather than an interval emitted by a ratelimiter whose purpose it is to control retry on error. Deprecated: Use `RequeueAfter` instead. Therefore this change replaces every usage in the controller reconcilers: - Conflict-retry sites now return the conflict error so the workqueue rate-limiter handles retry-on-error (its documented purpose), which preserves the same rate-limited backoff that `Requeue: true` provided. - Stale-cache sites (`ServiceAccount` not yet in the cache) rely on the `Owns(ServiceAccount)` watch to requeue, matching the existing comments. - `mergeReconcileResult` drops its `.Requeue` handling and now merges purely on `RequeueAfter` its unit test is updated accordingly. Tradeoff for discussion: conflict errors are now surfaced by controller-runtime at error level rather than staying quiet at `V(2)`. Assisted-by: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Christian Heusel <christian@heusel.eu>
…#1348) * refactor: replace deprecated Result.Requeue in controller reconcilers `controller-runtime` deprecates `reconcile.Result.Requeue` in favor of `RequeueAfter` / returning an error. The dependency bump in #1306 moves the controller to `controller-runtime v0.24.1`, where `staticcheck` flags **every** `Result{Requeue: true}` usage as `SA1019`: This setting is deprecated as it causes confusion and there is no good reason to use it. When waiting for an external event to happen, either the duration until it is supposed to happen or an appropriate poll interval should be used, rather than an interval emitted by a ratelimiter whose purpose it is to control retry on error. Deprecated: Use `RequeueAfter` instead. Therefore this change replaces every usage in the controller reconcilers: - Conflict-retry sites now return the conflict error so the workqueue rate-limiter handles retry-on-error (its documented purpose), which preserves the same rate-limited backoff that `Requeue: true` provided. - Stale-cache sites (`ServiceAccount` not yet in the cache) rely on the `Owns(ServiceAccount)` watch to requeue, matching the existing comments. - `mergeReconcileResult` drops its `.Requeue` handling and now merges purely on `RequeueAfter` its unit test is updated accordingly. Tradeoff for discussion: conflict errors are now surfaced by controller-runtime at error level rather than staying quiet at `V(2)`. Assisted-by: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Christian Heusel <christian@heusel.eu> * fix: requeue with a fixed delay on stale ServiceAccount cache Addresses review feedback on the stale-cache handling: relying on the `Owns(ServiceAccount)` watch to requeue is not guaranteed, because a ServiceAccount with the deterministic name that is owned by another controller will never be mapped back to this Workspace. Requeue with a small fixed `RequeueAfter` instead: a stale cache is common and is not write contention, so no exponential backoff is needed. Assisted-by: Qwen3.8-27B Signed-off-by: Christian Heusel <christian@heusel.eu> --------- Signed-off-by: Christian Heusel <christian@heusel.eu>
Notable changes
workspaces/backend/internal/auth/authentication.go:headerrequest.New()gained a newuidHeaders []stringparameter upstreamin
k8s.io/apiserver. Updated the call site to passnilfor it since it'sunused (auth is keyed on name/group headers only).
workspaces/controller/internal/webhook/workspace_webhook.go/workspacekind_webhook.gocontroller-runtimev0.24made the webhook builder generic:ctrl.NewWebhookManagedBy(mgr).For(&T{})→ctrl.NewWebhookManagedBy(mgr, &T{})admission.Validatormethods (ValidateCreate/Update/Delete) now take the concrete type (*Workspace,*WorkspaceKind) directly instead ofruntime.Object, so the manualobj.(*T)type assertions +apierrors.NewBadRequestfallback were dropped — that check is now enforced by the compiler instead of at request time (type mismatches are caught by the compiler; runtime failures are now JSON-decode errors, not type-assertion errors — seesigs.k8s.io/controller-runtime/pkg/webhook/admission/validator_custom.go).workspaces/controller/internal/helper/probe.go:k8s.io/apimachinery/pkg/util/httpstream→k8s.io/streaming/pkg/httpstreamworkspaces/controller/internal/controller/workspace_activity_test.go&Result.Requeuedeprecation (will open another task to refactor this deprecated type out)