-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
update forbidden messages #2319
Conversation
MakeMessage(ctx MessageContext) (string, error) | ||
} | ||
|
||
// MessageContext contains sufficient information to create a forbidden message. It is bundled in this one object to make it easy and obvious hwo to build a golang template |
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.
s/hwo/how/
type ForbiddenMessageResolver struct { | ||
// TODO if these maps were map[string]map[util.StringSet]ForbiddenMessageMaker, we'd be able to handle cases where sets of resources wanted slightly different messages | ||
// unfortunately, maps don't support keys like that, requiring StringSet serialization and deserialization. | ||
namespacedVerbsToResourcesToForbiddenMessageMaker map[string]map[string]ForbiddenMessageMaker |
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.
This wins an award for Longest Variable Name in a Go struct, 2015.
6975716
to
79dd65a
Compare
Fixed typo. |
@liggitt bump. |
} | ||
|
||
func newTemplateForbiddenMessageMaker(text string) templateForbiddenMessageMaker { | ||
parsedTemplate, err := template.New("").Parse(text) |
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.
template.Must(template.New(...
LGTM with a cursory reading |
79dd65a
to
c6a7597
Compare
[merge] |
continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/merge_pull_requests_origin/2037/) (Image: devenv-fedora_1586) |
[Test]ing while waiting on the merge queue |
continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pull_requests_origin/2306/) |
c6a7597
to
38dcdcc
Compare
re[merge] |
flake:
re[merge] |
38dcdcc
to
9276301
Compare
flake I haven't seen before: https://ci.openshift.redhat.com/jenkins/job/merge_pull_requests_origin/2031/
It passed on the test run: https://ci.openshift.redhat.com/jenkins/job/test_pull_requests_origin/2306/
@derekwaynecarr you seen this one before? [merge] please? |
UI failure: https://ci.openshift.redhat.com/jenkins/job/merge_pull_requests_origin/2036/
This thing is cursed. Pretty please [merge]? |
Evaluated for origin up to 9276301 |
Merged by openshift-bot
Fixes #1558.
Allows for forbidden messages on a verb/resource basis.
@liggitt