Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ssa: Align ResourceManager.Diff skipping resources with ResourceManager.Apply #862

Merged
merged 2 commits into from
Feb 6, 2025

Conversation

YvanGuidoin
Copy link
Contributor

@YvanGuidoin YvanGuidoin commented Jan 30, 2025

Solving: fluxcd/flux2#5163

Aligns ssa DiffOptions to ApplyOptions when diffing with ResourceManager

Will allow to modify diffing behavior in https://github.com/fluxcd/flux2/blob/e09ba7a8e60eb5f7be633acfee7b6c265244dc09/internal/build/diff.go#L100
to:

diffOptions := ssa.DiffOptions{
	Exclusions: map[string]string{
		"kustomize.toolkit.fluxcd.io/reconcile": "disabled",
		"kustomize.toolkit.fluxcd.io/ssa":       "ignore",
	},
	IfNotPresentSelector: map[string]string{
		"kustomize.toolkit.fluxcd.io/ssa": "ifnotpresent",
	},
}

to align to kustomize-controller behavior
https://github.com/fluxcd/kustomize-controller/blob/59676860b8cb5bb25db94efc7dea8b75f5966998/internal/controller/kustomization_controller.go#L678

@YvanGuidoin YvanGuidoin force-pushed the rework-ssa-diffoptions branch 2 times, most recently from 6986ef5 to 53daa30 Compare January 30, 2025 17:41
@YvanGuidoin YvanGuidoin marked this pull request as ready for review January 30, 2025 17:54
@YvanGuidoin YvanGuidoin changed the title ssa: Align ResourceManager.Diff Skipping resources with ResourceManager.Apply ssa: Align ResourceManager.Diff skipping resources with ResourceManager.Apply Jan 30, 2025
@YvanGuidoin YvanGuidoin force-pushed the rework-ssa-diffoptions branch from 53daa30 to 88a752e Compare February 6, 2025 09:06
Copy link
Member

@stefanprodan stefanprodan left a comment

Choose a reason for hiding this comment

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

LGTM

Thanks @YvanGuidoin 🥇

@stefanprodan stefanprodan added the area/server-side-apply SSA related issues and pull requests label Feb 6, 2025
@stefanprodan stefanprodan merged commit 7c90c14 into fluxcd:main Feb 6, 2025
12 checks passed
@YvanGuidoin YvanGuidoin deleted the rework-ssa-diffoptions branch February 6, 2025 11:09
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants