fix(serviceaccount): add service account input validation#512
fix(serviceaccount): add service account input validation#512craicoverflow merged 1 commit intomainfrom
Conversation
36d5a92 to
d2a5171
Compare
f4a3e21 to
5d41de5
Compare
rkpattnaik780
left a comment
There was a problem hiding this comment.
Should we put exact args to be zero for this command, it can be bit confusing
| } | ||
|
|
||
| err = survey.AskOne(promptName, &opts.name, survey.WithValidator(survey.Required)) | ||
| err = survey.AskOne(promptName, &opts.name, survey.WithValidator(survey.Required), survey.WithValidator(validation.ValidateDescription)) |
There was a problem hiding this comment.
| err = survey.AskOne(promptName, &opts.name, survey.WithValidator(survey.Required), survey.WithValidator(validation.ValidateDescription)) | |
| err = survey.AskOne(promptName, &opts.name, survey.WithValidator(survey.Required), survey.WithValidator(validation.ValidateName)) |
Sure, what was confusing about it? Was it something related to this code change? |
Nothing related to these changes. I tried doing something like |
Hmm, since it is so small, I will apply it now. |
b1856d8 to
13a3080
Compare
36dc67b to
ec76591
Compare
|
@craicoverflow would this PR also solve this: #515 or this is separate? |
Separate. |
| Long: localizer.MustLocalizeFromID("serviceAccount.create.cmd.longDescription"), | ||
| Example: localizer.MustLocalizeFromID("serviceAccount.create.cmd.example"), | ||
| RunE: func(cmd *cobra.Command, _ []string) error { | ||
| Args: cobra.NoArgs, |
There was a problem hiding this comment.
We should change cobra.ExactArgs(0) to cobra.NoArgs throughout the app in a follow up PR.
There was a problem hiding this comment.
Agreed. thanks!
Description
fixes #505
Verification Steps
Run
rhoas serviceaccount createcommands and enter various values from the rules below to test validation on name and description fields. Do this in both flags and interactive prompt.Name
Description
Type of change
Checklist