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

WIP: FastApply #327

Closed
wants to merge 11 commits into from
Closed

WIP: FastApply #327

wants to merge 11 commits into from

Conversation

moio
Copy link
Contributor

@moio moio commented Oct 20, 2023

This PR implements a faster Apply option that uses 2-way merge instead of 3-way merge.

// WithFastApply configures Apply to use 2-way merging, which is less CPU intensive than the default 3-way merging.
// WithFastApply has the same behavior as Apply (including to honor strategic merge patch tags) apart from one case:
//
// When applying an object with a nil field, WithFastApply will clear the corresponding field in the cluster object.
// If that is not wanted, specify the field in dotted notation in dontClearFields, and it will be left unchanged.
//
// Instead, when applying an object with a nil field, basic Apply will decide whether to clear it or not depending on
// the **immediately previous** Apply. If the field set nil was also nil in the immediately preceeding Apply, then
// it is not cleared, otherwise it is.
func (a *apply) WithFastApply(dontClearFields ...string) Apply {

@moio
Copy link
Contributor Author

moio commented Feb 26, 2024

Approach has been abandoned for the time being, might be revisited later. Until that point I am closing this PR.

@moio moio closed this Feb 26, 2024
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.

1 participant