Skip to content

Allow more fine-grained sync (#508)#666

Merged
merenbach merged 31 commits intoargoproj:masterfrom
merenbach:508-sync-single-resource
Oct 10, 2018
Merged

Allow more fine-grained sync (#508)#666
merenbach merged 31 commits intoargoproj:masterfrom
merenbach:508-sync-single-resource

Conversation

@merenbach
Copy link
Contributor

@merenbach merenbach commented Oct 1, 2018

Background

In #262, we added the ability to delete individual resources. Now, per #508, we'd like to extend this to sync the same. This PR closes #508. WIP. Please do not merge yet.

Use like this:

./dist/argocd app sync ks-guestbook --resource :Service:ks-guestbook-ui
./dist/argocd app sync ks-guestbook --resource apps:Deployment:ks-guestbook-ui

This hangs a K8s cluster—may be a bug (thanks @alexmt):

./dist/argocd app sync ks-guestbook --resource :Deployment:ks-guestbook-ui

Todo

  • Add an optional resource list to sync operations on API server. If unspecified, the behavior will default to the current behavior.
  • Add an optional resource list to sync operations on CLI. If unspecified, the behavior will default to the current behavior.
  • Modify the controller to respect this resource list.
  • Modify CLI to watch only specified resources.
  • Test changes before removing WIP status or merging

@merenbach merenbach requested a review from alexmt October 2, 2018 18:38
@merenbach merenbach added help-wanted Extra attention is needed and removed help-wanted Extra attention is needed labels Oct 2, 2018
@merenbach merenbach changed the title [WIP] Allow more fine-grained sync (#508) Allow more fine-grained sync (#508) Oct 5, 2018
@merenbach merenbach requested a review from jessesuen October 5, 2018 20:22
Copy link
Collaborator

Choose a reason for hiding this comment

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

Both liveObj or targetObj might be null. Check should be
sc.syncResources == nil || argo.ContainsSyncResource(liveObj, sc.syncResources) || argo.ContainsSyncResource(targetObj, sc.syncResources)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Add json annotations

@merenbach merenbach merged commit 1ba52c8 into argoproj:master Oct 10, 2018
@merenbach merenbach deleted the 508-sync-single-resource branch October 10, 2018 17:12
leoluz pushed a commit to leoluz/argo-cd that referenced this pull request Mar 13, 2025
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
leoluz pushed a commit to leoluz/argo-cd that referenced this pull request Mar 13, 2025
…rgoproj#662)

* fix: New kube applier for server side diff dry run with refactoring

Part of a fix for: argoproj#21488

Separate logic to handle server side diff dry run applies.

Signed-off-by: Andrii Korotkov <andrii.korotkov@verkada.com>

* Break backwards compatibility for a better code

Signed-off-by: Andrii Korotkov <andrii.korotkov@verkada.com>

* Don't put applier constructor in the interface

Signed-off-by: Andrii Korotkov <andrii.korotkov@verkada.com>

* Address comments

Signed-off-by: Andrii Korotkov <andrii.korotkov@verkada.com>

* Address more comments

Signed-off-by: Andrii Korotkov <andrii.korotkov@verkada.com>

* chore: enable testifylint linter (argoproj#657)

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
Signed-off-by: Andrii Korotkov <andrii.korotkov@verkada.com>

* chore: enable gofumpt, gosimple and whitespace linters (argoproj#666)

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
Signed-off-by: Andrii Korotkov <andrii.korotkov@verkada.com>

* chore: enable use-any from revive (argoproj#667)

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
Signed-off-by: Andrii Korotkov <andrii.korotkov@verkada.com>

* chore: bump golangci-lint to v1.63.4 and list argo-cd linters (argoproj#670)

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
Signed-off-by: Andrii Korotkov <andrii.korotkov@verkada.com>

* chore: enable unused-parameter and var-declaration from revive (argoproj#668)

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
Signed-off-by: Andrii Korotkov <andrii.korotkov@verkada.com>

* chore: remove actions/cache duplicated behavior with actions/setup-go (argoproj#658)

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
Signed-off-by: Andrii Korotkov <andrii.korotkov@verkada.com>

* Add Leo's code

Signed-off-by: Andrii Korotkov <andrii.korotkov@verkada.com>

* Make linter happy

Signed-off-by: Andrii Korotkov <andrii.korotkov@verkada.com>

---------

Signed-off-by: Andrii Korotkov <andrii.korotkov@verkada.com>
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
Co-authored-by: Matthieu MOREL <matthieu.morel35@gmail.com>
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.

Need a way to sync a single resource

2 participants