-
Notifications
You must be signed in to change notification settings - Fork 337
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(kumactl): mark valid-for as required for command kumactl generate…
… dataplane-token (#11849) ## Motivation fixes #11848 <!-- Why are we doing this change --> ## Implementation information Mark the option as required. Includes a small fixes that resolves #11107 (comment) ## Supporting documentation <!-- Is there a MADR? An Issue? A related PR? --> fixes #11848 <!-- > Changelog: skip --> <!-- Uncomment the above section to explicitly set a [`> Changelog:` entry here](https://github.com/kumahq/kuma/blob/master/CONTRIBUTING.md#submitting-a-patch)? --> --------- Signed-off-by: Jay Chen <[email protected]>
- Loading branch information
Showing
4 changed files
with
8 additions
and
4 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
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 |
---|---|---|
|
@@ -72,11 +72,12 @@ $ kumactl generate user-token --name [email protected] --group users --valid- | |
}, | ||
} | ||
cmd.Flags().StringVar(&args.name, "name", "", "name of the user") | ||
_ = cmd.MarkFlagRequired("name") | ||
cmd.Flags().StringSliceVar(&args.groups, "group", nil, "group of the user") | ||
cmd.Flags().DurationVar(&args.validFor, "valid-for", 0, `how long the token will be valid (for example "24h")`) | ||
cmd.Flags().StringVar(&args.signingKeyPath, "signing-key-path", "", "path to a file that contains private signing key. When specified, control plane won't be used to issue the token.") | ||
cmd.Flags().StringVar(&args.kid, "kid", "", "ID of the key that is used to issue a token. Required when --signing-key-path is used.") | ||
|
||
_ = cmd.MarkFlagRequired("name") | ||
_ = cmd.MarkFlagRequired("valid-for") | ||
return cmd | ||
} |