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

Server-side apply #363

Merged
merged 1 commit into from
Apr 11, 2022
Merged

Server-side apply #363

merged 1 commit into from
Apr 11, 2022

Conversation

sathieu
Copy link
Contributor

@sathieu sathieu commented Jan 8, 2022

@sonarcloud
Copy link

sonarcloud bot commented Jan 8, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 2 Code Smells

No Coverage information No Coverage information
4.5% 4.5% Duplication

@sathieu sathieu marked this pull request as ready for review January 8, 2022 16:54
sathieu added a commit to sathieu/argo-cd that referenced this pull request Jan 8, 2022
Fixes: argoproj#2267
Requires: argoproj/gitops-engine#363
Signed-off-by: Mathieu Parent <math.parent@gmail.com>
Copy link
Contributor

@alexmt alexmt left a comment

Choose a reason for hiding this comment

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

LGTM! Thank you @sathieu !

@leoluz can you please take a look as well? I think you know more about server side apply than me.

@codecov
Copy link

codecov bot commented Jan 10, 2022

Codecov Report

Merging #363 (811ec7f) into master (a586397) will decrease coverage by 0.03%.
The diff coverage is 33.33%.

@@            Coverage Diff             @@
##           master     #363      +/-   ##
==========================================
- Coverage   54.23%   54.20%   -0.04%     
==========================================
  Files          41       41              
  Lines        3055     3059       +4     
==========================================
+ Hits         1657     1658       +1     
- Misses       1235     1238       +3     
  Partials      163      163              
Impacted Files Coverage Δ
pkg/sync/common/types.go 58.82% <ø> (ø)
pkg/utils/kube/resource_ops.go 0.00% <0.00%> (ø)
pkg/sync/sync_context.go 71.10% <50.00%> (-0.19%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a586397...811ec7f. Read the comment docs.

@leoluz
Copy link
Contributor

leoluz commented Jan 14, 2022

Thanks for the PR @sathieu

What is the manager associated with the patch in the resources metadata.managedFields attribute when you sync in ArgoCD with server-side apply enabled?

When using server-side apply it is important to define the fieldManager to set the fields ownership to the proper actor. This is a required field for application/apply-patch patches which is the one used by SSA.

Im not sure if this the behaviour using the go client but in kubectl CLI if we don't provide the fieldManager it will automatically assign the manager as "kubectl" which is also undesirable.

I believe that we should expose a configuration to also set the manager when choosing server-side apply.

@jannfis
Copy link
Member

jannfis commented Jan 15, 2022

I believe that we should expose a configuration to also set the manager when choosing server-side apply.

I agree. Ideally, multiple consumers of gitops-engine (e.g. Argo CD instances) would be able to manage different parts of the same resource as well, as this is one of the main advantages of SSA. For Argo CD, we would need a unique identifier (maybe argocd-<installation_namespace> as the manager.

Also I wonder about what happens with the applicationInstance label, currently used to identify (exclusively) managed resources. Will Argo CD still set that label on a resource that is managed using Server-Side-Apply? How could we have multiple instances of Argo CD manage different parts of the same resource without them overwriting the label, or triggering a shared resource warning?

@varunsatokar
Copy link

When is this feature planned for release?

@leoluz
Copy link
Contributor

leoluz commented Mar 25, 2022

@varunsatokar We are currently discussing the proposal and analysing the impact it will bring.
You are welcome to participate in the review if you have something to add:
argoproj/argo-cd#8812

@leoluz
Copy link
Contributor

leoluz commented Apr 8, 2022

FYI, I rebased this branch with upstream/master to address a conflict and fix CI build

See argoproj/argo-cd#2267

Signed-off-by: Mathieu Parent <math.parent@gmail.com>
@sonarcloud
Copy link

sonarcloud bot commented Apr 11, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 2 Code Smells

No Coverage information No Coverage information
4.7% 4.7% Duplication

Copy link
Contributor

@leoluz leoluz left a comment

Choose a reason for hiding this comment

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

Reached an agreement with @alexmt to merge this PR as-is and continue the work to implement argoproj/argo-cd#8812 in a new branch

@leoluz leoluz merged commit d8b1a12 into argoproj:master Apr 11, 2022
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.

None yet

5 participants