-
Notifications
You must be signed in to change notification settings - Fork 231
Make warning message more accurate when adding invalid secret/configMap #2617
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make warning message more accurate when adding invalid secret/configMap #2617
Conversation
| <div class="help-block"> | ||
| <span class="pf-icon pficon-warning-triangle-o" aria-hidden="true"></span> | ||
| Some of the keys for {{ctrl.apiObject.kind | humanizeKind}} <strong>{{ctrl.apiObject.metadata.name}}</strong> are not valid environment variable names and will not be added. | ||
| Some of the keys for {{ctrl.apiObject.kind | humanizeKind}} <strong>{{ctrl.apiObject.metadata.name}}</strong> are not valid environment variable names. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The message was saying just the invalid keys won't be added, not that the secret won't be added. But maybe the wording was confusing.
I think we still need to tell the user what will happen. How about...?
Some of the keys for {{ctrl.apiObject.kind | humanizeKind}} <strong>{{ctrl.apiObject.metadata.name}}</strong> are not valid environment variable names.
Only {{ctrl.apiObject.kind | humanizeKind}} keys with valid names will be added as environment variables.cc @jwforres
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that sounds good to me 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I like @spadgett's message better generally than what is there. My point in the bug is that we say "Some" even when its really "All"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we say
{{ctrl.apiObject.kind | humanizeKind}} <strong>{{ctrl.apiObject.metadata.name}}</strong> contains keys that are not valid environment variable names.
Only {{ctrl.apiObject.kind | humanizeKind}} keys with valid names will be added as environment variables.
then one message works generally
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will need to update that first humanized string so the first letter is capitalized, i.e. "Config map"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That message is better 👍
Will need upperFirst to capitalize the first word in the sentence.
{{ctrl.apiObject.kind | humanizeKind | upperFirst}} <strong>{{ctrl.apiObject.metadata.name}}</strong> ...There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIRC the capitalize option on humanizeKind filter capitalizes both words? if so then you can just wrap this humanizeKind filter call in parens and pass it to _.capitalize
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jwforres We were making the same comment at the same time :)
I think upperFirst filter should do what we want.
9e4927f to
781fc76
Compare
781fc76 to
3a0c9fb
Compare
|
/lgtm |
|
Automatic merge from submit-queue. |
This fix is based from https://bugzilla.redhat.com/show_bug.cgi?id=1529467 where we suggested that best fix would be just warn user that the envVar is invalid.
@jwforres @spadgett PTAL