Skip to content

2150 cleanup shard eviction - #2221

Open
rg3122 wants to merge 7 commits into
fluxcd:mainfrom
rg3122:2150-cleanup-shard-eviction
Open

rg3122 wants to merge 7 commits into
fluxcd:mainfrom
rg3122:2150-cleanup-shard-eviction

Conversation

@rg3122

@rg3122 rg3122 commented Oct 29, 2026

Copy link
Copy Markdown

Summary

When a source object stops matching a controller shard's watch label selector, the previous shard may receive a NotFound response while its local artifact directory still exists. This can leave stale artifacts on disk and mask sharding misconfigurations.

This change cleans up the local artifacts when reconciliation encounters a missing object across the Bucket, GitRepository, HelmChart, HelmRepository, and OCIRepository controllers.

  • Adds a shared helper to safely resolve and remove the object's artifact directory.
  • Retries reconciliation if artifact cleanup fails.
  • Adds a unit test verifying that only the target object's artifacts are removed and unrelated artifacts are preserved.

Fixes #2150

Validation

  • Added unit test: TestRemoveArtifactsForMissingObject
  • Full Go test suite has not been run; CI validation is still required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant