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

ForceApply #11

Closed
wants to merge 3 commits into from
Closed

ForceApply #11

wants to merge 3 commits into from

Conversation

bdw617
Copy link
Contributor

@bdw617 bdw617 commented Sep 28, 2023

added .ForceApply(), that will overwrite (when it can) versus failing if there's a conflict like .Apply().

Functions exactly like Apply() but will set this:
url.searchParams.set("force", opts.method === "FORCEAPPLY" ? "true" : "false");

This saves the user from using a JSON patch with .Patch() and letting us use SSA

failing if there's a conflict like .Apply()
Copy link
Contributor

@cmwylie19 cmwylie19 left a comment

Choose a reason for hiding this comment

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

LMK if these comments make sense

Comment on lines +145 to +146
let result = await kube.ForceApply({ metadata: { name: "fake" }, spec: { priority: 3 } });
result = await kube.ForceApply({ metadata: { name: "fake" }, spec: { priority: 3 } });
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
let result = await kube.ForceApply({ metadata: { name: "fake" }, spec: { priority: 3 } });
result = await kube.ForceApply({ metadata: { name: "fake" }, spec: { priority: 3 } });
let result = await kube.ForceApply({ metadata: { name: "fake" }, spec: { priority: 3 } });

Copy link
Contributor

Choose a reason for hiding this comment

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

result seems duplicated.

Another question I had @bdw617, is will this trigger a conflict? I didn't see a change in field that another manager also claims to manage? I am new to SSA so i could be wrong.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah, I was lazy, let me update it :)

@bdw617 bdw617 closed this Oct 6, 2023
@bdw617 bdw617 deleted the ForceApply branch October 6, 2023 19:23
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