Skip to content

fix: let the fabric identity sweep run without stopping the manager - #18

Merged
scotwells merged 1 commit into
mainfrom
fix/fabric-identity-sweep-rbac
Aug 27, 2026
Merged

fix: let the fabric identity sweep run without stopping the manager#18
scotwells merged 1 commit into
mainfrom
fix/fabric-identity-sweep-rbac

Conversation

@scotwells

Copy link
Copy Markdown
Collaborator

What is wrong

fabric-identity-controller is in CrashLoopBackOff on staging since #17 rolled, so no fabric identity is being reconciled at all.

problem running manager: remove the legacy placement policy "cloud-fabric-identity-us-central-1":
  clusterpropagationpolicies.policy.karmada.io "cloud-fabric-identity-us-central-1" is forbidden:
  User "system:fabric-identity-federation@cloud.datumapis.com" cannot delete resource
  "clusterpropagationpolicies" in API group "policy.karmada.io" at the cluster scope

Two mistakes in #17, mine:

  1. The credential could not delete. It had create;get;list;patch;update;watch on clusterpropagationpolicies. The sweep deletes, and so does collect via unplace, so delete was needed and neither path could have worked.
  2. A sweep failure stopped the manager. It runs as a manager runnable, where a returned error is fatal. A permissions gap in best-effort cleanup took down the whole controller — strictly worse than the leftover policies it was clearing, since a controller that will not start reconciles nothing.

What changed

  • delete added to the clusterpropagationpolicies marker; config/rbac/role.yaml regenerated with task generate:rbac (one line).
  • The sweep never returns an error. A policy it cannot read or delete is logged at error level, naming the policy and saying it will keep competing for identities, and the manager starts regardless.

The second change is the one that matters: it makes this class of mistake visible rather than fatal.

Test plan

  • A sweep that cannot delete is not an error and does not stop the manager
  • A sweep that cannot even list the policies is equally survivable
  • Making the sweep fatal again fails the new test
  • go build, go vet, full go test ./...
  • Controller reaches Running on staging and the legacy cloud-fabric-identity-us-central-1 policy is gone

The sweep added with the per-identity placement policies deletes the
per-location policies it replaced, but the federation credential could only
create and patch them. The forbidden delete came back from a manager runnable,
where an error stops the manager, so the controller crash-looped and nothing
was reconciled at all -- worse than the leftover policies it was clearing.

Grant the delete the sweep and collect both already needed, and make the sweep
best-effort: a policy it cannot remove is logged loudly and the manager still
starts. A controller that refuses to run reconciles nothing, where a leftover
policy is a correctness problem that is at least visible and recoverable.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@scotwells
scotwells requested a review from a team as a code owner August 27, 2026 21:59
@scotwells
scotwells requested a review from felixwidjaja August 27, 2026 21:59
@scotwells
scotwells merged commit fd53ae7 into main Aug 27, 2026
5 of 6 checks passed
@scotwells
scotwells deleted the fix/fabric-identity-sweep-rbac branch August 27, 2026 22:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants