-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improve apply and config command help (#1194)
- Loading branch information
Showing
12 changed files
with
96 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,14 +24,21 @@ import ( | |
func Command() *cobra.Command { | ||
cmd := &cobra.Command{ | ||
Use: "auth", | ||
Short: "Manage authentication to the API Registry", | ||
Long: "Authentication to the registry is via tokens. These tokens can be provided " + | ||
"directly by using '--registry.token' in any command, or can be generated as needed " + | ||
"by setting the token-source property in a configuration. The token-source can be set " + | ||
"to any executable command that prints a registry token by using the 'config set token-source'. " + | ||
"Once set, the command will be executed before a registry command is run and the output used " + | ||
"as the token passed to the registry. The output can be verified by 'auth print-token'.", | ||
Example: "config set token-source 'gcloud auth print-access-token [email protected]'", | ||
Short: "Manage client authentication to the API Registry", | ||
Long: `Manage client authentication to the API Registry. | ||
Authentication to the registry is via tokens. These tokens can be provided | ||
directly by using '--registry.token' in any command, or can be generated as | ||
needed by setting the token-source property in a configuration. | ||
The token-source can be set to any executable command that prints a registry | ||
token by using 'registry config set token-source'. Once set, the command will | ||
be executed before a registry command is run and the output used as the token | ||
passed to the registry. | ||
Output of the token-source setting can be verified by 'auth print-token'.`, | ||
Example: `registry config set token-source 'gcloud auth print-access-token [email protected] | ||
registry auth print-token`, | ||
} | ||
|
||
cmd.AddCommand(printTokenCommand()) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,14 +25,16 @@ func setCommand() *cobra.Command { | |
cmd := &cobra.Command{ | ||
Use: "set PROPERTY VALUE", | ||
Short: "Set a property value in the active configuration", | ||
Long: "Set a property value in the active configuration. The following are valid properties:\n" + | ||
" - registry.address\n" + | ||
" - registry.insecure\n" + | ||
" - registry.location\n" + | ||
" - registry.project\n" + | ||
" - token-source", | ||
Example: "registry config set registry.address localhost:8080\n" + | ||
"registry config set token-source 'gcloud auth print-access-token [email protected]'", | ||
Long: `Set a property value in the active configuration. | ||
The following are valid configuration properties: | ||
- address | ||
- insecure | ||
- location | ||
- project | ||
- token-source`, | ||
Example: `registry config set address localhost:8080 | ||
registry config set token-source 'gcloud auth print-access-token [email protected]'`, | ||
Args: cobra.ExactArgs(2), | ||
RunE: func(cmd *cobra.Command, args []string) error { | ||
target, c, err := config.ActiveRaw() | ||
|