-
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
Preventing build from inheriting master log level #9905
Conversation
Commit also includes minor modifications of sti -> s2i |
For reference, the previous behavior was to apply the BUILD_LOGLEVEL at build pod creation time. The application was achieved by setting args=--loglevel=## directly in the build pod (e.g. https://github.com/openshift/origin/pull/9905/files#diff-5c9f2bf12ec684975c1fd68247f951dbL85). As @csrwng points out in the issue, this means the BuildDefaults' env variables were too late to the party to affect logging since they are merged in after the pod is defined (and the loglevel already established as a pod/spec/args entry). I could have chosen to have the BuildDefaults plugin inspect and potentially modify the --loglevel arg in the pod definition, but this would have led to relatively complexity parsing code and, more importantly, established three areas of code all attempting to manage this one argument. Instead, I moved the full responsibility of setting the loglevel to the BuildDefaults admission plugin. |
[test] |
binary builds still create build pods, why can't they set this env variable on the build pod that is being created? |
err = applyBuildLogLevel(build, pod) | ||
if err != nil { | ||
return admission.NewForbidden(a, fmt.Errorf("unable to set loglevel in pod: %v", err)) | ||
} |
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.
shouldn't this be in its own function? SetBuild is for setting the BUILD env variable w/ the build json definition.
@bparees I had the same reaction since it seemed heavy handed. It is an architectural implication of the REST calls.
vs non-binary:
And intentionally codified: |
@jupierce hm. I guess since the binaryinstantiate POST body is the files being sent in, there is nowhere to provide a request object that defines the log level for the build request. (unless we added support for query parameters) |
@bparees Do we not support multipart form data? |
I'm not actually sure. |
New commit:
|
[testextended][extended:core(BUILD_LOGLEVEL)] |
lgtm pending passing tests. |
[testextended][extended:core(builds)] |
|
@bparees govet bombing on files I haven't changed...? |
@jupierce known flake issue w/ travis, don't worry about it. and the jenkins failures are yum repos you also can't do anything about. i'll kick the travis test to run again, but the failure doesn't really matter. |
[test] |
re[test] |
1 similar comment
re[test] |
@bparees Just to get back on your radar. |
fmt.Fprintf(g.GinkgoWriter, "\nbuild log:\n%s\n", buildLog) | ||
o.Expect(err).NotTo(o.HaveOccurred()) | ||
|
||
g.By(fmt.Sprintf("verifying the build output is verbose")) |
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.
is not verbose?
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's right, thanks. The correction actually applies to the subsequent test spec "BUILD_LOGLEVEL in buildconfig can be overridden by build-loglevel".
one nit and lgtm |
(assuming tests start passing of course :) ) |
lgtm, will merge on passing extended tests |
Evaluated for origin testextended up to fee7e4d |
continuous-integration/openshift-jenkins/testextended SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin_extended/399/) (Extended Tests: core(builds), core(BUILD_LOGLEVEL)) |
Evaluated for origin test up to fee7e4d |
continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/7523/) |
@bparees All clear. |
[merge] |
continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/7599/) (Image: devenv-rhel7_4770) |
Evaluated for origin merge up to fee7e4d |
Fixes #8738
This implementation:
Example master-config entry: