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

Ability to add local directory as source #3432

Closed
neilharris123 opened this issue Apr 16, 2020 · 4 comments
Closed

Ability to add local directory as source #3432

neilharris123 opened this issue Apr 16, 2020 · 4 comments
Labels
enhancement New feature or request verify Solution needs verification

Comments

@neilharris123
Copy link

neilharris123 commented Apr 16, 2020

Summary

In the application resource YAML file, we are able to add a source repo and path.
It would be useful to be able to specify the local directory for testing locally.

Motivation

I'm creating CI tests and automated dev deployment scripts which are triggered in the PR. The container I am using already contains a replica/clone of the git branch the test will run against. I would like to change certain values in manifests in the containers local directory. But when I run argocd cli commands against the application resource file in the local directory, because the source repoURL value must point at the remote git branch, the local changes are never propagated as I would like.

Proposal

I was thinking something like the following would satisfy my needs:

spec:
  project: default
  source:
    dirPath: /path/to/dir

or

spec:
  project: default
  source:
    repoURL: local
    targetRevision: HEAD
    path: guestbook
@neilharris123 neilharris123 added the enhancement New feature or request label Apr 16, 2020
@alexmt
Copy link
Collaborator

alexmt commented Apr 17, 2020

Hello @neilharris123 ,

Some Argo CD CLI commands already supports using local directory:

compare live app state and local manifests source:

argocd app diff <appName> --local /path/to/dir

sync app using local manifests

argocd app sync <appName> --local /path/to/dir

Does it cover your use cases?

@alexmt alexmt added the verify Solution needs verification label Apr 17, 2020
@neilharris123
Copy link
Author

neilharris123 commented Apr 17, 2020

Hello @alexmt,

It does support my use case up to a point because in theory I can create the app initially from the repo, then sync to add the local changes. However, I've noticed when I perform a sync using the --local option that I get this error, because syncing from local, unlike from repo, does not seem to support kustomize build options.

: external plugins disabled; unable to load external plugin 'SimpleSOPS'

It appears kustomize build option support for sync from repo this was added here, but does not appear to work when using the --local parameter. Unless I'm missing something.

@alexmt
Copy link
Collaborator

alexmt commented Apr 17, 2020

Which Argo CD version are you using?

The local diff has started properly using build options in 1.5: bc33f19

@neilharris123
Copy link
Author

Hi @alexmt
I was using an older version, but since upgrading to 1.5, this is now working. Thanks for your help, I'll close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request verify Solution needs verification
Projects
None yet
Development

No branches or pull requests

2 participants