Skip to content

feat(appset): add progressive sync strategy CRDS#15313

Open
alexymantha wants to merge 7 commits intoargoproj:masterfrom
alexymantha:add-syncstrategy
Open

feat(appset): add progressive sync strategy CRDS#15313
alexymantha wants to merge 7 commits intoargoproj:masterfrom
alexymantha:add-syncstrategy

Conversation

@alexymantha
Copy link
Member

@alexymantha alexymantha commented Sep 1, 2023

As discussed in #14458, adds new CRDs to define sync strategies that can be referenced and used by multiple ApplicationSets.

SyncStrategy is a namespaced resource and needs to be in the same namespace as the ApplicationSet referencing it.

ClusterSyncStrategy is a cluster-wide SyncStrategy that can be referenced by ApplicationSets from any namespace.

Closes #14458

Checklist:

  • Either (a) I've created an enhancement proposal and discussed it with the community, (b) this is a bug fix, or (c) this does not need to be in the release notes.
  • The title of the PR states what changed and the related issues number (used for the release note).
  • The title of the PR conforms to the Toolchain Guide
  • I've included "Closes [ISSUE #]" or "Fixes [ISSUE #]" in the description to automatically close the associated issue.
  • I've updated both the CLI and UI to expose my feature, or I plan to submit a second PR with them.
  • Does this PR require documentation updates?
  • I've updated documentation as required by this PR.
  • Optional. My organization is added to USERS.md.
  • I have signed off all my commits as required by DCO
  • I have written unit and/or e2e tests for my change. PRs without these are unlikely to be merged.
  • My build is green (troubleshooting builds).
  • My new feature complies with the feature status guidelines.
  • I have added a brief description of why this PR is necessary and/or what this PR solves.

@codecov
Copy link

codecov bot commented Sep 1, 2023

Codecov Report

❌ Patch coverage is 67.41573% with 29 lines in your changes missing coverage. Please review.
✅ Project coverage is 49.92%. Comparing base (f3911a4) to head (e0ac218).
⚠️ Report is 3579 commits behind head on master.

Files with missing lines Patch % Lines
...cationset/controllers/applicationset_controller.go 71.60% 18 Missing and 5 partials ⚠️
pkg/apis/application/v1alpha1/register.go 0.00% 4 Missing ⚠️
cmd/argocd/commands/app.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #15313      +/-   ##
==========================================
+ Coverage   49.88%   49.92%   +0.03%     
==========================================
  Files         263      263              
  Lines       45204    45275      +71     
==========================================
+ Hits        22549    22602      +53     
- Misses      20439    20453      +14     
- Partials     2216     2220       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@alexymantha alexymantha force-pushed the add-syncstrategy branch 6 times, most recently from 1d71ceb to 315aff0 Compare September 1, 2023 01:08
commit 315aff0
Merge: effd359 ef7f32e
Author: Alexy Mantha <alexy@mantha.dev>
Date:   Thu Aug 31 17:05:33 2023 -0700

    Merge branch 'master' into add-syncstrategy

commit effd359
Author: Alexy Mantha <alexy.mantha@goto.com>
Date:   Thu Aug 31 19:55:56 2023 -0400

    add tests

commit 0b4e77d
Author: Alexy Mantha <alexy.mantha@goto.com>
Date:   Thu Aug 31 16:32:09 2023 -0400

    fix tests

commit 461046b
Merge: d670109 dd49e22
Author: Alexy Mantha <alexy.mantha@goto.com>
Date:   Thu Aug 24 17:01:21 2023 -0400

    Merge branch 'master' into add-syncstrategy

commit d670109
Author: Alexy Mantha <alexy.mantha@goto.com>
Date:   Thu Aug 24 16:41:49 2023 -0400

    add clusterkind

commit f398c57
Author: Alexy Mantha <alexy.mantha@goto.com>
Date:   Mon Aug 21 23:31:37 2023 -0400

    add clustersyncstrategy

commit df5ad7d
Merge: ac86c16 bfaac2b
Author: Alexy Mantha <alexy.mantha@goto.com>
Date:   Tue Aug 15 21:09:27 2023 -0400

    Merge branch 'master' into add-syncstrategy

commit ac86c16
Author: Alexy Mantha <alexy.mantha@goto.com>
Date:   Thu Aug 10 18:04:13 2023 -0400

    changes from codegen

commit 587f866
Author: Alexy Mantha <alexy.mantha@goto.com>
Date:   Thu Aug 10 17:35:08 2023 -0400

    fix naming conflict

commit 21f58e5
Author: Alexy Mantha <alexy.mantha@goto.com>
Date:   Thu Aug 10 16:11:27 2023 -0400

    Changes from codegen

commit bbb7de8
Merge: 89b2ba9 c31da64
Author: Alexy Mantha <alexy.mantha@goto.com>
Date:   Thu Aug 10 16:09:41 2023 -0400

    Merge branch 'master' into add-syncstrategy

commit 89b2ba9
Author: Alexy Mantha <alexy.mantha@goto.com>
Date:   Wed Aug 9 17:21:23 2023 -0400

    wip

commit 110bda5
Author: Alexy Mantha <alexy.mantha@goto.com>
Date:   Wed Aug 9 13:26:20 2023 -0400

    wip

Signed-off-by: Alexy Mantha <alexy@mantha.dev>
Signed-off-by: Alexy Mantha <alexy@mantha.dev>
Signed-off-by: Alexy Mantha <alexy@mantha.dev>
// SyncStrategy controls the manner in which a sync is performed
type SyncStrategy struct {
// SyncOperationStrategy controls the manner in which a sync is performed
type SyncOperationStrategy struct {
Copy link
Member Author

Choose a reason for hiding this comment

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

I had to rename this because it was colliding the SyncStrategy CRD. I considered using ApplicationSetSyncStrategy for the CRD and leaving this one as SyncStrategy but I think it is better to have SyncStrategy as the front-facing CRD and have the longer name for this internal type. Open to suggestions

@alexymantha alexymantha marked this pull request as ready for review September 5, 2023 16:54
Copy link
Member

@agaudreault agaudreault left a comment

Choose a reason for hiding this comment

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

Looks really good 🚀 👏

var spec *argov1alpha1.SyncStrategySpec
if ref.Kind == application.ClusterSyncStrategyKind {
css := &argov1alpha1.ClusterSyncStrategy{}
err := r.Get(
Copy link
Member

Choose a reason for hiding this comment

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

You might have to update the default argocd ClusterRole/Role to explicitly add this. It makes it easier for people with custom roles other than *

alexymantha and others added 4 commits September 7, 2023 10:28
Co-authored-by: Alexandre Gaudreault <alexandre.gaudreault@logmein.com>
Signed-off-by: Alexy Mantha <alexy@mantha.dev>
Signed-off-by: Alexy Mantha <alexy@mantha.dev>
Signed-off-by: Alexy Mantha <alexy@mantha.dev>
Copy link
Member

@jannfis jannfis left a comment

Choose a reason for hiding this comment

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

While I really like the idea and also appreciate the effort that went into this PR, I think we shouldn't introduce new CRDs lightly, or just after some brief discussion.

IMHO, a change like this has to go through our proposal process

@alexymantha
Copy link
Member Author

Working on the proposal!

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.

RollingSync strategy for multiple ApplicationSets

3 participants