Skip to content

Report ownership conflicts during SSA - #1377

Merged
matheuscscp merged 1 commit into
fluxcd:mainfrom
DDINGJOO:report-ownership-conflicts
Nov 12, 2026
Merged

matheuscscp merged 1 commit into
fluxcd:mainfrom
DDINGJOO:report-ownership-conflicts

Conversation

@DDINGJOO

Copy link
Copy Markdown
Contributor

kustomize-controller needs to identify the previous owner of a resource before applying it. A separate lookup adds an API request per resource even though SSA already reads the live object.

Add an optional OnOwnershipConflict callback to ApplyOptions. Apply and ApplyAll call it after the skip checks when both objects have complete, different owner label pairs. It receives the resource subject and previous owner so callers can emit their own warning.

This supports kustomize-controller #1807 and #1724. Tests cover conflict reporting, same-owner resources, skipped resources, and creation through both apply paths. The controller regression checks that the warning precedes the first PATCH and that the number of GETs drops from two to one.

Validation: make test-ssa GO_TEST_ARGS='-race -count=1' passes for all five SSA packages.

AI assistance used Codex (GPT-6).

Reuse the live object already fetched by the apply paths to report
ownership conflicts through an optional callback. Controllers can emit
a warning before the first write without adding another API lookup.

Cover both apply paths, matching owners, skipped objects and creation.

Signed-off-by: MyungJoo Song <173995233+DDINGJOO@users.noreply.github.com>
Assisted-by: Codex/GPT-6

@matheuscscp matheuscscp left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM overall!

Just one blocker 🙏

Comment thread ssa/manager_apply.go Resolved
@matheuscscp matheuscscp added enhancement New feature or request area/server-side-apply SSA related issues and pull requests labels Nov 12, 2026
@matheuscscp
matheuscscp force-pushed the report-ownership-conflicts branch from ee79a0d to a36eace Compare November 12, 2026 07:28

@matheuscscp matheuscscp left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@matheuscscp
matheuscscp merged commit 788e904 into fluxcd:main Nov 12, 2026
29 of 30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/server-side-apply SSA related issues and pull requests enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants