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

Repository type should be mandatory for repo add command in CLI #2622

Closed
3 tasks done
jannfis opened this issue Nov 1, 2019 · 1 comment · Fixed by #2628
Closed
3 tasks done

Repository type should be mandatory for repo add command in CLI #2622

jannfis opened this issue Nov 1, 2019 · 1 comment · Fixed by #2628
Labels
bug Something isn't working

Comments

@jannfis
Copy link
Member

jannfis commented Nov 1, 2019

Checklist:

  • I've searched in the docs and FAQ for my answer: http://bit.ly/argocd-faq.
  • I've included steps to reproduce the bug.
  • I've pasted the output of argocd version.

Describe the bug

With v1.3 first-class support of Helm, each repository has a type nominator to specify whether it's a Git or a Helm repo. The repo add command of the CLI has a corresponding switch, but this switch is not mandatory and not specifying the type has weird side-effects (i.e. assuming Helm repository for SSH URLs, which are not supported).

To Reproduce

Helm assumes HTTPS URL:

$ argocd repo add root@127.0.0.1:2222/app/git/repos/test --ssh-private-key-path test/fixture/testrepos/id_rsa --insecure-ignore-host-key
FATA[0000] rpc error: code = Unknown desc = parse root@127.0.0.1:2222/app/git/repos/test: first path segment in URL cannot contain colon 

Helm does not support explicit ssh protocol:

$ argocd repo add ssh://root@127.0.0.1:2222/app/git/repos/test --ssh-private-key-path test/fixture/testrepos/id_rsa --insecure-ignore-host-key
FATA[0000] rpc error: code = Unknown desc = Get ssh://root@127.0.0.1:2222/app/git/repos/test/index.yaml: unsupported protocol scheme "ssh" 

However, neither Git nor Helm is the dedicated default:

$ argocd repo add | grep -- --type
      --type string                         type of the repository, "git" or "helm"

Expected behavior

Either the --type switch for repo add should be mandatory, or the default should be noted in the usage. If defaulting, the default should be git for backwards compatibility. If mandatory, maybe it should be a prepended argument instead of a switch, i.e. argocd add repo <type> <url> - this is open for discussion.

Screenshots

If applicable, add screenshots to help explain your problem.

Version

argocd: v1.3.0+a0d758a.dirty
  BuildDate: 2019-10-31T20:57:15Z
  GitCommit: a0d758a571e6de819119b4e97bd42f0722d63bc3
  GitTreeState: dirty
  GoVersion: go1.12.5
  Compiler: gc
  Platform: linux/amd64

Logs

Paste any relevant application logs here.
@jannfis jannfis added the bug Something isn't working label Nov 1, 2019
@alexec
Copy link
Contributor

alexec commented Nov 1, 2019

It should probably be backwards compatible - so default to git

alexmt pushed a commit that referenced this issue Nov 4, 2019
* Assume git as default repository type

* Add helm repo with name in E2E tests
alexmt pushed a commit that referenced this issue Nov 4, 2019
* Assume git as default repository type

* Add helm repo with name in E2E tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants