-
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
Bug 1596440 - surface OOMKilled pod to build #20297
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,7 +53,11 @@ func (strategy) PrepareForUpdate(ctx context.Context, obj, old runtime.Object) { | |
// of the reason and message. This is to prevent the build controller from | ||
// overwriting the reason and message that was set by the builder pod | ||
// when it updated the build's details. | ||
if oldBuild.Status.Phase == buildapi.BuildPhaseFailed { | ||
// Only allow OOMKilled override because various processes in a container | ||
// can get OOMKilled and this confuses builder to prematurely populate | ||
// failure reason | ||
if oldBuild.Status.Phase == buildapi.BuildPhaseFailed && | ||
newBuild.Status.Reason != buildapi.StatusReasonOutOfMemoryKilled { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @bparees I think the API was overriding the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. so without this change the reason was never getting set to OOM, or it only sometimes getting set? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. most of the time it was setting OOM, only sometimes, when There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. well, it's an ugly hack, but i don't have a better idea at the moment :) |
||
newBuild.Status.Reason = oldBuild.Status.Reason | ||
newBuild.Status.Message = oldBuild.Status.Message | ||
} | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
kind: BuildConfig | ||
apiVersion: v1 | ||
metadata: | ||
name: statusfail-oomkilled | ||
spec: | ||
resources: | ||
limits: | ||
memory: 10Mi | ||
source: | ||
git: | ||
uri: "https://github.com/openshift/ruby-hello-world" | ||
strategy: | ||
type: Source | ||
sourceStrategy: | ||
from: | ||
kind: DockerImage | ||
name: centos/ruby-23-centos7:latest |
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.
you have constant for this right?
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.
I thought since that constant is in
builds
context, it shouldn't be used to check the status reason forpods
(they currently have the same string describing it but potentially this could change, maybe?)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.
yeah technically they are two different constants. One is the "build failure reason" and the other is the "pod status reason" so i agree that keeping them as separate constants makes sense.
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.
it's too bad there's no k8s constant for this that we can reference.