From 603d2e2bcbfa5d8d416ff3dfd88c826eb93d3893 Mon Sep 17 00:00:00 2001 From: Chiranjeevi R Date: Fri, 6 Oct 2023 11:33:15 +0530 Subject: [PATCH 1/4] feat: Add example to argocd relogin command Signed-off-by: Chiranjeevi R --- cmd/argocd/commands/relogin.go | 22 ++++++++++++++++++---- docs/user-guide/commands/argocd_relogin.md | 16 +++++++++++++++- 2 files changed, 33 insertions(+), 5 deletions(-) diff --git a/cmd/argocd/commands/relogin.go b/cmd/argocd/commands/relogin.go index ba630270a2de7..0d591e83025e6 100644 --- a/cmd/argocd/commands/relogin.go +++ b/cmd/argocd/commands/relogin.go @@ -24,10 +24,9 @@ func NewReloginCommand(globalClientOpts *argocdclient.ClientOptions) *cobra.Comm ssoPort int ) var command = &cobra.Command{ - Use: "relogin", - Short: "Refresh an expired authenticate token", - Long: "Refresh an expired authenticate token", - Example: "argocd relogin --password YOUR_PASSWORD", + Use: "relogin", + Short: "Refresh an expired authenticate token", + Long: "Refresh an expired authenticate token", Run: func(c *cobra.Command, args []string) { ctx := c.Context() @@ -85,6 +84,21 @@ func NewReloginCommand(globalClientOpts *argocdclient.ClientOptions) *cobra.Comm errors.CheckError(err) fmt.Printf("Context '%s' updated\n", localCfg.CurrentContext) }, + Example: ` +# Reinitiates the login with previous contexts +argocd relogin + +# Reinitiates the logins with sso +argocd relogin --sso + +# Reinitiates the login with password +"argocd relogin --password YOUR_PASSWORD" + +# Configure direct access using Kubernetes API server +argocd login cd.argoproj.io --core + +# If user logged in with - "argocd login cd.argoproj.io --sso" +# The command - "argocd relogin" will Reinitiates SSO login and updates the server context`, } command.Flags().StringVar(&password, "password", "", "The password of an account to authenticate") command.Flags().IntVar(&ssoPort, "sso-port", DefaultSSOLocalPort, "Port to run local OAuth2 login application") diff --git a/docs/user-guide/commands/argocd_relogin.md b/docs/user-guide/commands/argocd_relogin.md index 40bd2b05e0cbc..84abbf34fe12e 100644 --- a/docs/user-guide/commands/argocd_relogin.md +++ b/docs/user-guide/commands/argocd_relogin.md @@ -15,7 +15,21 @@ argocd relogin [flags] ### Examples ``` -argocd relogin --password YOUR_PASSWORD + +# Reinitiates the login with previous contexts +argocd relogin + +# Reinitiates the logins with sso +argocd relogin --sso + +# Reinitiates the login with password +"argocd relogin --password YOUR_PASSWORD" + +# Configure direct access using Kubernetes API server +argocd login cd.argoproj.io --core + +# If user logged in with - "argocd login cd.argoproj.io --sso" +# The command - "argocd relogin" will Reinitiates SSO login and updates the server context ``` ### Options From 7259cbbb88f8e6dce5f013a11d80982b3ce3dddb Mon Sep 17 00:00:00 2001 From: Chiranjeevi R Date: Fri, 6 Oct 2023 15:32:09 +0530 Subject: [PATCH 2/4] feat: Add example to argocd relogin command Signed-off-by: Chiranjeevi R --- cmd/argocd/commands/relogin.go | 2 +- docs/user-guide/commands/argocd_relogin.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/argocd/commands/relogin.go b/cmd/argocd/commands/relogin.go index 0d591e83025e6..1f3677f111eec 100644 --- a/cmd/argocd/commands/relogin.go +++ b/cmd/argocd/commands/relogin.go @@ -89,7 +89,7 @@ func NewReloginCommand(globalClientOpts *argocdclient.ClientOptions) *cobra.Comm argocd relogin # Reinitiates the logins with sso -argocd relogin --sso +argocd relogin --sso # Reinitiates the login with password "argocd relogin --password YOUR_PASSWORD" diff --git a/docs/user-guide/commands/argocd_relogin.md b/docs/user-guide/commands/argocd_relogin.md index 84abbf34fe12e..5a80af51ab659 100644 --- a/docs/user-guide/commands/argocd_relogin.md +++ b/docs/user-guide/commands/argocd_relogin.md @@ -20,7 +20,7 @@ argocd relogin [flags] argocd relogin # Reinitiates the logins with sso -argocd relogin --sso +argocd relogin --sso # Reinitiates the login with password "argocd relogin --password YOUR_PASSWORD" From b5588eaaba98d8f2a2008a5e45b20feb5851898e Mon Sep 17 00:00:00 2001 From: Chiranjeevi R Date: Fri, 6 Oct 2023 20:44:18 +0530 Subject: [PATCH 3/4] correc --sso flag Signed-off-by: Chiranjeevi R --- cmd/argocd/commands/relogin.go | 5 +---- docs/user-guide/commands/argocd_relogin.md | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/cmd/argocd/commands/relogin.go b/cmd/argocd/commands/relogin.go index 1f3677f111eec..37bcd41e93b82 100644 --- a/cmd/argocd/commands/relogin.go +++ b/cmd/argocd/commands/relogin.go @@ -88,16 +88,13 @@ func NewReloginCommand(globalClientOpts *argocdclient.ClientOptions) *cobra.Comm # Reinitiates the login with previous contexts argocd relogin -# Reinitiates the logins with sso -argocd relogin --sso - # Reinitiates the login with password "argocd relogin --password YOUR_PASSWORD" # Configure direct access using Kubernetes API server argocd login cd.argoproj.io --core -# If user logged in with - "argocd login cd.argoproj.io --sso" +# If user logged in with - "argocd login cd.argoproj.io" with sso login # The command - "argocd relogin" will Reinitiates SSO login and updates the server context`, } command.Flags().StringVar(&password, "password", "", "The password of an account to authenticate") diff --git a/docs/user-guide/commands/argocd_relogin.md b/docs/user-guide/commands/argocd_relogin.md index 5a80af51ab659..4fdc205f36536 100644 --- a/docs/user-guide/commands/argocd_relogin.md +++ b/docs/user-guide/commands/argocd_relogin.md @@ -19,16 +19,13 @@ argocd relogin [flags] # Reinitiates the login with previous contexts argocd relogin -# Reinitiates the logins with sso -argocd relogin --sso - # Reinitiates the login with password "argocd relogin --password YOUR_PASSWORD" # Configure direct access using Kubernetes API server argocd login cd.argoproj.io --core -# If user logged in with - "argocd login cd.argoproj.io --sso" +# If user logged in with - "argocd login cd.argoproj.io" with sso login # The command - "argocd relogin" will Reinitiates SSO login and updates the server context ``` From 0c7a145ad446dde9f112df98476372ebbea3d3f4 Mon Sep 17 00:00:00 2001 From: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com> Date: Fri, 6 Oct 2023 17:23:21 -0400 Subject: [PATCH 4/4] Apply suggestions from code review Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com> --- cmd/argocd/commands/relogin.go | 2 +- docs/user-guide/commands/argocd_relogin.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/argocd/commands/relogin.go b/cmd/argocd/commands/relogin.go index 37bcd41e93b82..92affe05b2e5b 100644 --- a/cmd/argocd/commands/relogin.go +++ b/cmd/argocd/commands/relogin.go @@ -89,7 +89,7 @@ func NewReloginCommand(globalClientOpts *argocdclient.ClientOptions) *cobra.Comm argocd relogin # Reinitiates the login with password -"argocd relogin --password YOUR_PASSWORD" +argocd relogin --password YOUR_PASSWORD # Configure direct access using Kubernetes API server argocd login cd.argoproj.io --core diff --git a/docs/user-guide/commands/argocd_relogin.md b/docs/user-guide/commands/argocd_relogin.md index 4fdc205f36536..430ab4a9222c9 100644 --- a/docs/user-guide/commands/argocd_relogin.md +++ b/docs/user-guide/commands/argocd_relogin.md @@ -20,7 +20,7 @@ argocd relogin [flags] argocd relogin # Reinitiates the login with password -"argocd relogin --password YOUR_PASSWORD" +argocd relogin --password YOUR_PASSWORD # Configure direct access using Kubernetes API server argocd login cd.argoproj.io --core