fix: propagate suspend/resume via annotation, not hub-side Status.Suspended - #214
Merged
Merged
Conversation
…tion synchronization and controller reconciliation
Contributor
Author
|
just noted that e2e tests are failing. Working into fixing them |
…tion Two watches were silently broken by an earlier make manifests run that correctly reflected missing +kubebuilder:rbac markers, removing permissions the code still needs: - WorkloadReconciler watches networkingv1alpha.Network (workload_controller.go) but had no marker requesting networking.datumapis.com/networks at all. - WorkloadDeploymentFederator.mapDownstreamDeploymentToRequest reads Namespace via FederationCluster.GetClient(), a cached/informer-backed client (unlike the direct FederationClient used elsewhere in this file), which needs list;watch to populate its cache even though the code only calls Get() — the existing marker only requested get;list. Both broke real functionality, not just generated-manifest hygiene: this is what was failing chainsaw e2e tests unrelated to suspension (deletion-cascade, propagation-policy-lifecycle, referenced-data-mounts, etc.) — the manager couldn't establish these watches/caches, so WorkloadDeploymentFederator never got a chance to run. Add the markers back and regenerate manifests.
scotwells
approved these changes
Aug 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR: fix: propagate suspend/resume via annotation, not hub-side Status.Suspended
Summary
Project suspensions weren't stopping instances:
ComputeSuspend/ComputeResumepatchedWorkloadDeployment.Status.Suspendeddirectly on the project-namespace object, but that write was silently reverted.WorkloadDeploymentFederatornever propagatesStatushub→cell (onlySpecand one specific annotation), and itssyncStatusFromDownstreamoverwrites the entire project-namespace status with whatever Karmada aggregated from the cell on every reconcile — which fires immediately off the hook's own update. The patch logged success with no error, but the object'sresourceVersionnever actually changed.This switches the hooks to write a
SuspendedAnnotationinstead, the same channel already used forExpectedReferencedDataAnnotation— one of the few things Karmada does propagate hub→cell. The cell's ownWorkloadDeploymentReconcilernow derivesStatus.Suspendedfrom that annotation locally, beforereconcileInstanceGatespropagates it to owned Instances. The cell is the correct authoritative writer here: Karmada only aggregates status cell→hub, never the reverse, so only the cell can honestly confirm suspension actually happened.Status.Suspendedthen rides the existing generic status-aggregation path back up to the hub — no federator changes needed for that direction.wdReferencedDataChangedPredicateis extended to fire on the annotation changing too, since that's a metadata-only change (sameGeneration) that would otherwise never trigger the reconcile that acts on it.Test plan
go build ./...go test ./...(438 passed)SuspendedAnnotation), since the existing conformance test only checksServiceConsumer'sPausedcondition and hand-labels its fixture, so it wouldn't have caught this bug or the earlierWorkloadDeploymentlabeling bug eitherStatus.Suspendedreaches theWorkloadDeployment, propagates toInstance, and the pod is deleted (and recreated on resume)