-
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
master: check both places to fix bug 1372618 #11045
master: check both places to fix bug 1372618 #11045
Conversation
91bf290
to
f9c06a3
Compare
@openshift/api-review seems like the best fit to review this change? |
pretty sure the test failure had nothing to do with me |
[test] again for fun |
https://ci.openshift.redhat.com/jenkins/job/test_pull_requests_origin_conformance/6409/consoleFull had a different conformance error:
[test] once more |
f9c06a3
to
eb77c69
Compare
@csrwng PTAL |
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.
some style comments
} | ||
} | ||
|
||
// Look for ClusterResourceOverrideConfig in the PluginConfig |
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.
fix godoc
} | ||
|
||
// Look for ClusterResourceOverrideConfig in the PluginConfig | ||
func tryOverrideConfig(ac configapi.AdmissionConfig) (*overrideapi.ClusterResourceOverrideConfig, error) { |
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.
maybe use a more descriptive function name?
@@ -527,6 +516,44 @@ func StartAPI(oc *origin.MasterConfig, kc *kubernetes.MasterConfig) error { | |||
return nil | |||
} | |||
|
|||
// Look in two potential places where ClusterResourceOverrideConfig can be specified | |||
func getResourceOverrideConfig(oc *origin.MasterConfig) (*overrideapi.ClusterResourceOverrideConfig, error) { | |||
if overrideConfig, err := tryOverrideConfig(oc.Options.AdmissionConfig); err != nil { |
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.
move the if to its own line, followed by 2 if's ...
https://golang.org/doc/effective_go.html#if
if oc.Options.KubernetesMasterConfig == nil { // external kube gets you a nil pointer here | ||
return nil, nil | ||
} | ||
if overrideConfig, err := tryOverrideConfig(oc.Options.KubernetesMasterConfig.AdmissionConfig); err != nil { |
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.
Put if in its own line, get rid of the else
} | ||
if overrideConfig, err := override.ReadConfig(configFile); err != nil { | ||
return nil, err | ||
} else { |
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.
get rid of the else
@mfojtik PTAL |
eb77c69
to
fdedd83
Compare
Addressed @csrwng 's feedback. Going ahead with [merge] to get it into online ASAP. |
continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/9390/) (Image: devenv-rhel7_5092) |
Evaluated for origin merge up to fdedd83 |
re-[test] |
Evaluated for origin test up to fdedd83 |
continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/9390/) |
https://bugzilla.redhat.com/show_bug.cgi?id=1372618
openshift/origin-web-console#554