diff --git a/cmd/argocd/commands/repo.go b/cmd/argocd/commands/repo.go index 0a4837dbb5..445f48b8cd 100644 --- a/cmd/argocd/commands/repo.go +++ b/cmd/argocd/commands/repo.go @@ -52,7 +52,10 @@ func NewRepoAddCommand(clientOpts *argocdclient.ClientOptions) *cobra.Command { // For better readability and easier formatting var repoAddExamples = ` # Add a Git repository via SSH using a private key for authentication, ignoring the server's host key: - argocd repo add git@git.example.com:repos/repo --insecure-ignore-host-key --ssh-private-key-path ~/id_rsa + argocd repo add git@git.example.com:repos/repo --insecure-ignore-host-key --ssh-private-key-path ~/id_rsa + + # Add a Git repository via SSH on a non-default port - need to use ssh:// style URLs here + argocd repo add ssh://git@git.example.com:2222/repos/repo --ssh-private-key-path ~/id_rsa # Add a private Git repository via HTTPS using username/password and TLS client certificates: argocd repo add https://git.example.com/repos/repo --username git --password secret --tls-client-cert-path ~/mycert.crt --tls-client-cert-key-path ~/mycert.key diff --git a/cmd/argocd/commands/repocreds.go b/cmd/argocd/commands/repocreds.go index e4a34915e0..4c4156959f 100644 --- a/cmd/argocd/commands/repocreds.go +++ b/cmd/argocd/commands/repocreds.go @@ -19,7 +19,7 @@ import ( "github.com/argoproj/argo-cd/util/git" ) -// NewRepoCredsCommand returns a new instance of an `argocd repo` command +// NewRepoCredsCommand returns a new instance of an `argocd repocreds` command func NewRepoCredsCommand(clientOpts *argocdclient.ClientOptions) *cobra.Command { var command = &cobra.Command{ Use: "repocreds", @@ -36,7 +36,7 @@ func NewRepoCredsCommand(clientOpts *argocdclient.ClientOptions) *cobra.Command return command } -// NewRepoCredsAddCommand returns a new instance of an `argocd repo add` command +// NewRepoCredsAddCommand returns a new instance of an `argocd repocreds add` command func NewRepoCredsAddCommand(clientOpts *argocdclient.ClientOptions) *cobra.Command { var ( repo appsv1.RepoCreds @@ -50,8 +50,8 @@ func NewRepoCredsAddCommand(clientOpts *argocdclient.ClientOptions) *cobra.Comma var repocredsAddExamples = ` # Add credentials with user/pass authentication to use for all repositories under https://git.example.com/repos argocd repocreds add https://git.example.com/repos/ --username git --password secret - # Add credentials with SSH private key authentication to use for all repositories under https://git.example.com/repos - argocd repocreds add https://git.example.com/repos/ --ssh-private-key-path ~/.ssh/id_rsa + # Add credentials with SSH private key authentication to use for all repositories under ssh://git@git.example.com/repos + argocd repocreds add ssh://git@git.example.com/repos/ --ssh-private-key-path ~/.ssh/id_rsa ` var command = &cobra.Command{ @@ -131,7 +131,7 @@ func NewRepoCredsAddCommand(clientOpts *argocdclient.ClientOptions) *cobra.Comma return command } -// NewRepoCredsRemoveCommand returns a new instance of an `argocd repo list` command +// NewRepoCredsRemoveCommand returns a new instance of an `argocd repocreds rm` command func NewRepoCredsRemoveCommand(clientOpts *argocdclient.ClientOptions) *cobra.Command { var command = &cobra.Command{ Use: "rm CREDSURL", @@ -172,7 +172,7 @@ func printRepoCredsUrls(repos []appsv1.RepoCreds) { } } -// NewRepoCredsListCommand returns a new instance of an `argocd repo rm` command +// NewRepoCredsListCommand returns a new instance of an `argocd repo list` command func NewRepoCredsListCommand(clientOpts *argocdclient.ClientOptions) *cobra.Command { var ( output string