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

refactor: server side apply over create / update #3075

Merged
merged 42 commits into from
Nov 6, 2024
Merged

Conversation

AustinAbro321
Copy link
Contributor

Description

There are several situations where we create, check if the resource already existed, and if it does then we update. It is simpler in this situation to just use server side apply

Related Issue

Fixes #2626

Checklist before merging

Signed-off-by: Austin Abro <AustinAbro321@gmail.com>
Copy link

netlify bot commented Oct 7, 2024

Deploy Preview for zarf-docs canceled.

Name Link
🔨 Latest commit 20f1069
🔍 Latest deploy log https://app.netlify.com/sites/zarf-docs/deploys/672a5d3b544adb0008a78936

Signed-off-by: Austin Abro <AustinAbro321@gmail.com>
Signed-off-by: Austin Abro <AustinAbro321@gmail.com>
Signed-off-by: Austin Abro <AustinAbro321@gmail.com>
Signed-off-by: Austin Abro <AustinAbro321@gmail.com>
Signed-off-by: Austin Abro <AustinAbro321@gmail.com>
Signed-off-by: Austin Abro <AustinAbro321@gmail.com>
Signed-off-by: Austin Abro <AustinAbro321@gmail.com>
Signed-off-by: Austin Abro <AustinAbro321@gmail.com>
Copy link

codecov bot commented Oct 17, 2024

Codecov Report

Attention: Patch coverage is 77.89474% with 42 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/pkg/cluster/zarf.go 0.00% 19 Missing ⚠️
src/pkg/packager/remove.go 0.00% 9 Missing ⚠️
src/internal/packager/helm/post-render.go 0.00% 8 Missing ⚠️
src/pkg/packager/deploy.go 0.00% 4 Missing ⚠️
src/pkg/cluster/state.go 85.71% 2 Missing ⚠️
Files with missing lines Coverage Δ
src/pkg/cluster/cluster.go 0.00% <ø> (ø)
src/pkg/cluster/injector.go 66.35% <100.00%> (-3.65%) ⬇️
src/pkg/cluster/namespace.go 16.66% <100.00%> (-22.47%) ⬇️
src/pkg/cluster/secrets.go 63.06% <100.00%> (-3.61%) ⬇️
src/pkg/cluster/state.go 60.33% <85.71%> (-0.65%) ⬇️
src/pkg/packager/deploy.go 5.41% <0.00%> (+0.10%) ⬆️
src/internal/packager/helm/post-render.go 12.85% <0.00%> (+1.56%) ⬆️
src/pkg/packager/remove.go 0.00% <0.00%> (ø)
src/pkg/cluster/zarf.go 14.83% <0.00%> (+2.46%) ⬆️

... and 2 files with indirect coverage changes

Signed-off-by: Austin Abro <AustinAbro321@gmail.com>
Signed-off-by: Austin Abro <AustinAbro321@gmail.com>
Signed-off-by: Austin Abro <AustinAbro321@gmail.com>
Signed-off-by: Austin Abro <AustinAbro321@gmail.com>
Signed-off-by: Austin Abro <AustinAbro321@gmail.com>
Signed-off-by: Austin Abro <AustinAbro321@gmail.com>
Signed-off-by: Austin Abro <AustinAbro321@gmail.com>
Signed-off-by: Austin Abro <AustinAbro321@gmail.com>
Signed-off-by: Austin Abro <AustinAbro321@gmail.com>
Signed-off-by: Austin Abro <AustinAbro321@gmail.com>
Signed-off-by: Austin Abro <AustinAbro321@gmail.com>
Signed-off-by: Austin Abro <AustinAbro321@gmail.com>
Signed-off-by: Austin Abro <austinabro321@gmail.com>
Signed-off-by: Austin Abro <austinabro321@gmail.com>
Signed-off-by: Austin Abro <austinabro321@gmail.com>
AustinAbro321 and others added 5 commits October 24, 2024 17:00
Signed-off-by: Austin Abro <AustinAbro321@gmail.com>
Signed-off-by: Austin Abro <AustinAbro321@gmail.com>
Signed-off-by: Austin Abro <AustinAbro321@gmail.com>
@AustinAbro321 AustinAbro321 marked this pull request as ready for review October 24, 2024 17:07
@AustinAbro321 AustinAbro321 requested review from a team as code owners October 24, 2024 17:07
@AustinAbro321 AustinAbro321 changed the title refactor: change create or update if not exists operations to use server side apply refactor: server side apply over create / update Oct 24, 2024
Copy link
Member

@phillebaba phillebaba left a comment

Choose a reason for hiding this comment

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

Small comment. Additionally have we looked into if it is possible to set a global field manager?

src/pkg/cluster/state.go Show resolved Hide resolved
@AustinAbro321
Copy link
Contributor Author

@phillebaba As far as I can tell it's not possible to set a global field manager. I thought about making a function like cluster.DefaultApplyOpts(), lmk if you'd prefer that

AustinAbro321 and others added 2 commits October 29, 2024 14:13
Signed-off-by: Austin Abro <AustinAbro321@gmail.com>
@phillebaba
Copy link
Member

For now just make a constant called something like FieldManagerName so that we can track where it is being used.

AustinAbro321 and others added 5 commits November 1, 2024 16:40
Signed-off-by: Austin Abro <AustinAbro321@gmail.com>
Signed-off-by: Austin Abro <AustinAbro321@gmail.com>
Signed-off-by: Austin Abro <AustinAbro321@gmail.com>
Signed-off-by: Austin Abro <AustinAbro321@gmail.com>
Signed-off-by: Austin Abro <AustinAbro321@gmail.com>
Signed-off-by: Austin Abro <AustinAbro321@gmail.com>
@AustinAbro321 AustinAbro321 added this pull request to the merge queue Nov 6, 2024
Merged via the queue into main with commit e0040ab Nov 6, 2024
26 checks passed
@AustinAbro321 AustinAbro321 deleted the try-out-ssa branch November 6, 2024 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use Server Side Apply when creating Kubernetes resources
2 participants