Skip to content

Commit

Permalink
feat: Support context switch for argocd-util
Browse files Browse the repository at this point in the history
Signed-off-by: Atsushi Neki <nekiaiken@gmail.com>
  • Loading branch information
nekia committed Nov 6, 2021
1 parent 0a64781 commit 663962a
Show file tree
Hide file tree
Showing 134 changed files with 134 additions and 0 deletions.
1 change: 1 addition & 0 deletions cmd/argocd/commands/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,6 @@ func NewCommand() *cobra.Command {
command.PersistentFlags().StringVar(&clientOpts.PortForwardNamespace, "port-forward-namespace", config.GetFlag("port-forward-namespace", ""), "Namespace name which should be used for port forwarding")
command.PersistentFlags().IntVar(&clientOpts.HttpRetryMax, "http-retry-max", 0, "Maximum number of retries to establish http connection to Argo CD server")
command.PersistentFlags().BoolVar(&clientOpts.Core, "core", false, "If set to true then CLI talks directly to Kubernetes instead of talking to Argo CD API server")
command.PersistentFlags().StringVar(&clientOpts.Context, "argocd-context", "", "The name of the Argo-CD server context to use")
return command
}
1 change: 1 addition & 0 deletions docs/user-guide/commands/argocd.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ argocd [flags]
### Options

```
--argocd-context string The name of the Argo-CD server context to use
--auth-token string Authentication token
--client-crt string Client certificate file
--client-crt-key string Client certificate key file
Expand Down
1 change: 1 addition & 0 deletions docs/user-guide/commands/argocd_account.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ argocd account [flags]
### Options inherited from parent commands

```
--argocd-context string The name of the Argo-CD server context to use
--auth-token string Authentication token
--client-crt string Client certificate file
--client-crt-key string Client certificate key file
Expand Down
1 change: 1 addition & 0 deletions docs/user-guide/commands/argocd_account_can-i.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ Resources: [clusters projects applications repositories certificates]
### Options inherited from parent commands

```
--argocd-context string The name of the Argo-CD server context to use
--auth-token string Authentication token
--client-crt string Client certificate file
--client-crt-key string Client certificate key file
Expand Down
1 change: 1 addition & 0 deletions docs/user-guide/commands/argocd_account_delete-token.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ argocd account delete-token --account <account-name> ID
### Options inherited from parent commands

```
--argocd-context string The name of the Argo-CD server context to use
--auth-token string Authentication token
--client-crt string Client certificate file
--client-crt-key string Client certificate key file
Expand Down
1 change: 1 addition & 0 deletions docs/user-guide/commands/argocd_account_generate-token.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ argocd account generate-token --account <account-name>
### Options inherited from parent commands

```
--argocd-context string The name of the Argo-CD server context to use
--auth-token string Authentication token
--client-crt string Client certificate file
--client-crt-key string Client certificate key file
Expand Down
1 change: 1 addition & 0 deletions docs/user-guide/commands/argocd_account_get-user-info.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ argocd account get-user-info [flags]
### Options inherited from parent commands

```
--argocd-context string The name of the Argo-CD server context to use
--auth-token string Authentication token
--client-crt string Client certificate file
--client-crt-key string Client certificate key file
Expand Down
1 change: 1 addition & 0 deletions docs/user-guide/commands/argocd_account_get.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ argocd account get --account <account-name>
### Options inherited from parent commands

```
--argocd-context string The name of the Argo-CD server context to use
--auth-token string Authentication token
--client-crt string Client certificate file
--client-crt-key string Client certificate key file
Expand Down
1 change: 1 addition & 0 deletions docs/user-guide/commands/argocd_account_list.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ argocd account list
### Options inherited from parent commands

```
--argocd-context string The name of the Argo-CD server context to use
--auth-token string Authentication token
--client-crt string Client certificate file
--client-crt-key string Client certificate key file
Expand Down
1 change: 1 addition & 0 deletions docs/user-guide/commands/argocd_account_update-password.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ argocd account update-password [flags]
### Options inherited from parent commands

```
--argocd-context string The name of the Argo-CD server context to use
--auth-token string Authentication token
--client-crt string Client certificate file
--client-crt-key string Client certificate key file
Expand Down
1 change: 1 addition & 0 deletions docs/user-guide/commands/argocd_admin.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ argocd admin [flags]
### Options inherited from parent commands

```
--argocd-context string The name of the Argo-CD server context to use
--auth-token string Authentication token
--client-crt string Client certificate file
--client-crt-key string Client certificate key file
Expand Down
1 change: 1 addition & 0 deletions docs/user-guide/commands/argocd_admin_app.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ argocd admin app [flags]
### Options inherited from parent commands

```
--argocd-context string The name of the Argo-CD server context to use
--auth-token string Authentication token
--client-crt string Client certificate file
--client-crt-key string Client certificate key file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ argocd admin app diff-reconcile-results PATH1 PATH2 [flags]
### Options inherited from parent commands

```
--argocd-context string The name of the Argo-CD server context to use
--auth-token string Authentication token
--client-crt string Client certificate file
--client-crt-key string Client certificate key file
Expand Down
1 change: 1 addition & 0 deletions docs/user-guide/commands/argocd_admin_app_generate-spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ argocd admin app generate-spec APPNAME [flags]
### Options inherited from parent commands

```
--argocd-context string The name of the Argo-CD server context to use
--auth-token string Authentication token
--client-crt string Client certificate file
--client-crt-key string Client certificate key file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ argocd admin app get-reconcile-results PATH [flags]
### Options inherited from parent commands

```
--argocd-context string The name of the Argo-CD server context to use
--auth-token string Authentication token
--client-crt string Client certificate file
--client-crt-key string Client certificate key file
Expand Down
1 change: 1 addition & 0 deletions docs/user-guide/commands/argocd_admin_cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ argocd admin cluster [flags]
### Options inherited from parent commands

```
--argocd-context string The name of the Argo-CD server context to use
--auth-token string Authentication token
--client-crt string Client certificate file
--client-crt-key string Client certificate key file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ argocd admin cluster generate-spec CONTEXT [flags]
### Options inherited from parent commands

```
--argocd-context string The name of the Argo-CD server context to use
--auth-token string Authentication token
--client-crt string Client certificate file
--client-crt-key string Client certificate key file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ argocd admin cluster kubeconfig CLUSTER_URL OUTPUT_PATH [flags]
### Options inherited from parent commands

```
--argocd-context string The name of the Argo-CD server context to use
--auth-token string Authentication token
--client-crt string Client certificate file
--client-crt-key string Client certificate key file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ argocd admin cluster namespaces [flags]
### Options inherited from parent commands

```
--argocd-context string The name of the Argo-CD server context to use
--auth-token string Authentication token
--client-crt string Client certificate file
--client-crt-key string Client certificate key file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ argocd admin cluster namespaces disable-namespaced-mode PATTERN [flags]
### Options inherited from parent commands

```
--argocd-context string The name of the Argo-CD server context to use
--as string Username to impersonate for the operation
--as-group stringArray Group to impersonate for the operation, this flag can be repeated to specify multiple groups.
--auth-token string Authentication token
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ argocd admin cluster namespaces enable-namespaced-mode PATTERN [flags]
### Options inherited from parent commands

```
--argocd-context string The name of the Argo-CD server context to use
--as string Username to impersonate for the operation
--as-group stringArray Group to impersonate for the operation, this flag can be repeated to specify multiple groups.
--auth-token string Authentication token
Expand Down
1 change: 1 addition & 0 deletions docs/user-guide/commands/argocd_admin_cluster_shards.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ argocd admin cluster shards [flags]
### Options inherited from parent commands

```
--argocd-context string The name of the Argo-CD server context to use
--auth-token string Authentication token
--client-crt string Client certificate file
--client-crt-key string Client certificate key file
Expand Down
1 change: 1 addition & 0 deletions docs/user-guide/commands/argocd_admin_cluster_stats.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ argocd admin cluster stats [flags]
### Options inherited from parent commands

```
--argocd-context string The name of the Argo-CD server context to use
--auth-token string Authentication token
--client-crt string Client certificate file
--client-crt-key string Client certificate key file
Expand Down
1 change: 1 addition & 0 deletions docs/user-guide/commands/argocd_admin_dashboard.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ argocd admin dashboard [flags]
### Options inherited from parent commands

```
--argocd-context string The name of the Argo-CD server context to use
--auth-token string Authentication token
--client-crt string Client certificate file
--client-crt-key string Client certificate key file
Expand Down
1 change: 1 addition & 0 deletions docs/user-guide/commands/argocd_admin_export.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ argocd admin export [flags]
### Options inherited from parent commands

```
--argocd-context string The name of the Argo-CD server context to use
--auth-token string Authentication token
--client-crt string Client certificate file
--client-crt-key string Client certificate key file
Expand Down
1 change: 1 addition & 0 deletions docs/user-guide/commands/argocd_admin_import.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ argocd admin import SOURCE [flags]
### Options inherited from parent commands

```
--argocd-context string The name of the Argo-CD server context to use
--auth-token string Authentication token
--client-crt string Client certificate file
--client-crt-key string Client certificate key file
Expand Down
1 change: 1 addition & 0 deletions docs/user-guide/commands/argocd_admin_proj.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ argocd admin proj [flags]
### Options inherited from parent commands

```
--argocd-context string The name of the Argo-CD server context to use
--auth-token string Authentication token
--client-crt string Client certificate file
--client-crt-key string Client certificate key file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ argocd admin proj generate-allow-list CLUSTERROLE_PATH PROJ_NAME [flags]
### Options inherited from parent commands

```
--argocd-context string The name of the Argo-CD server context to use
--auth-token string Authentication token
--client-crt string Client certificate file
--client-crt-key string Client certificate key file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ argocd admin proj generate-spec PROJECT [flags]
### Options inherited from parent commands

```
--argocd-context string The name of the Argo-CD server context to use
--auth-token string Authentication token
--client-crt string Client certificate file
--client-crt-key string Client certificate key file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ argocd admin proj update-role-policy PROJECT_GLOB MODIFICATION ACTION [flags]
### Options inherited from parent commands

```
--argocd-context string The name of the Argo-CD server context to use
--auth-token string Authentication token
--client-crt string Client certificate file
--client-crt-key string Client certificate key file
Expand Down
1 change: 1 addition & 0 deletions docs/user-guide/commands/argocd_admin_repo.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ argocd admin repo [flags]
### Options inherited from parent commands

```
--argocd-context string The name of the Argo-CD server context to use
--auth-token string Authentication token
--client-crt string Client certificate file
--client-crt-key string Client certificate key file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ argocd admin repo generate-spec REPOURL [flags]
### Options inherited from parent commands

```
--argocd-context string The name of the Argo-CD server context to use
--auth-token string Authentication token
--client-crt string Client certificate file
--client-crt-key string Client certificate key file
Expand Down
1 change: 1 addition & 0 deletions docs/user-guide/commands/argocd_admin_settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ argocd admin settings [flags]
### Options inherited from parent commands

```
--argocd-context string The name of the Argo-CD server context to use
--auth-token string Authentication token
--client-crt string Client certificate file
--client-crt-key string Client certificate key file
Expand Down
1 change: 1 addition & 0 deletions docs/user-guide/commands/argocd_admin_settings_rbac.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ argocd admin settings rbac [flags]

```
--argocd-cm-path string Path to local argocd-cm.yaml file
--argocd-context string The name of the Argo-CD server context to use
--argocd-secret-path string Path to local argocd-secret.yaml file
--as string Username to impersonate for the operation
--as-group stringArray Group to impersonate for the operation, this flag can be repeated to specify multiple groups.
Expand Down
1 change: 1 addition & 0 deletions docs/user-guide/commands/argocd_admin_settings_rbac_can.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ argocd admin settings rbac can someuser create application 'default/app' --defau

```
--argocd-cm-path string Path to local argocd-cm.yaml file
--argocd-context string The name of the Argo-CD server context to use
--argocd-secret-path string Path to local argocd-secret.yaml file
--as string Username to impersonate for the operation
--as-group stringArray Group to impersonate for the operation, this flag can be repeated to specify multiple groups.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ argocd admin settings rbac validate --policy-file=POLICYFILE [flags]

```
--argocd-cm-path string Path to local argocd-cm.yaml file
--argocd-context string The name of the Argo-CD server context to use
--argocd-secret-path string Path to local argocd-secret.yaml file
--as string Username to impersonate for the operation
--as-group stringArray Group to impersonate for the operation, this flag can be repeated to specify multiple groups.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ argocd admin settings resource-overrides [flags]

```
--argocd-cm-path string Path to local argocd-cm.yaml file
--argocd-context string The name of the Argo-CD server context to use
--argocd-secret-path string Path to local argocd-secret.yaml file
--as string Username to impersonate for the operation
--as-group stringArray Group to impersonate for the operation, this flag can be repeated to specify multiple groups.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ argocd admin settings resource-overrides health ./deploy.yaml --argocd-cm-path .

```
--argocd-cm-path string Path to local argocd-cm.yaml file
--argocd-context string The name of the Argo-CD server context to use
--argocd-secret-path string Path to local argocd-secret.yaml file
--as string Username to impersonate for the operation
--as-group stringArray Group to impersonate for the operation, this flag can be repeated to specify multiple groups.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ argocd admin settings resource-overrides ignore-differences ./deploy.yaml --argo

```
--argocd-cm-path string Path to local argocd-cm.yaml file
--argocd-context string The name of the Argo-CD server context to use
--argocd-secret-path string Path to local argocd-secret.yaml file
--as string Username to impersonate for the operation
--as-group stringArray Group to impersonate for the operation, this flag can be repeated to specify multiple groups.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ argocd admin settings resource-overrides action list /tmp/deploy.yaml --argocd-c

```
--argocd-cm-path string Path to local argocd-cm.yaml file
--argocd-context string The name of the Argo-CD server context to use
--argocd-secret-path string Path to local argocd-secret.yaml file
--as string Username to impersonate for the operation
--as-group stringArray Group to impersonate for the operation, this flag can be repeated to specify multiple groups.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ argocd admin settings resource-overrides action run /tmp/deploy.yaml restart --a

```
--argocd-cm-path string Path to local argocd-cm.yaml file
--argocd-context string The name of the Argo-CD server context to use
--argocd-secret-path string Path to local argocd-secret.yaml file
--as string Username to impersonate for the operation
--as-group stringArray Group to impersonate for the operation, this flag can be repeated to specify multiple groups.
Expand Down
1 change: 1 addition & 0 deletions docs/user-guide/commands/argocd_admin_settings_validate.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ argocd admin settings validate --group accounts --group plugins --load-cluster-s

```
--argocd-cm-path string Path to local argocd-cm.yaml file
--argocd-context string The name of the Argo-CD server context to use
--argocd-secret-path string Path to local argocd-secret.yaml file
--as string Username to impersonate for the operation
--as-group stringArray Group to impersonate for the operation, this flag can be repeated to specify multiple groups.
Expand Down
1 change: 1 addition & 0 deletions docs/user-guide/commands/argocd_app.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ argocd app [flags]
### Options inherited from parent commands

```
--argocd-context string The name of the Argo-CD server context to use
--auth-token string Authentication token
--client-crt string Client certificate file
--client-crt-key string Client certificate key file
Expand Down
1 change: 1 addition & 0 deletions docs/user-guide/commands/argocd_app_actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ argocd app actions [flags]
### Options inherited from parent commands

```
--argocd-context string The name of the Argo-CD server context to use
--auth-token string Authentication token
--client-crt string Client certificate file
--client-crt-key string Client certificate key file
Expand Down
1 change: 1 addition & 0 deletions docs/user-guide/commands/argocd_app_actions_list.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ argocd app actions list APPNAME [flags]
### Options inherited from parent commands

```
--argocd-context string The name of the Argo-CD server context to use
--auth-token string Authentication token
--client-crt string Client certificate file
--client-crt-key string Client certificate key file
Expand Down
1 change: 1 addition & 0 deletions docs/user-guide/commands/argocd_app_actions_run.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ argocd app actions run APPNAME ACTION [flags]
### Options inherited from parent commands

```
--argocd-context string The name of the Argo-CD server context to use
--auth-token string Authentication token
--client-crt string Client certificate file
--client-crt-key string Client certificate key file
Expand Down
1 change: 1 addition & 0 deletions docs/user-guide/commands/argocd_app_create.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ argocd app create APPNAME [flags]
### Options inherited from parent commands

```
--argocd-context string The name of the Argo-CD server context to use
--auth-token string Authentication token
--client-crt string Client certificate file
--client-crt-key string Client certificate key file
Expand Down
Loading

0 comments on commit 663962a

Please sign in to comment.