-
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
return notfound errors w/o wrappering them #9763
return notfound errors w/o wrappering them #9763
Conversation
[test] |
@smarterclayton ptal |
@@ -233,6 +233,9 @@ func (g *BuildGenerator) Instantiate(ctx kapi.Context, request *buildapi.BuildRe | |||
|
|||
newBuild, err := g.generateBuildFromConfig(ctx, bc, request.Revision, request.Binary) | |||
if err != nil { | |||
if errors.IsNotFound(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.
All of the other API types should be ignored. generateBuildFromConfig is responsible for generating the correct API error type - if you want to transform it, transform it in generateBuildFromConfig. We should not be wrapping any error that comes out of gbfc unless it's not an API 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.
updated.
1cdaad3
to
abc4b32
Compare
@@ -233,6 +234,9 @@ func (g *BuildGenerator) Instantiate(ctx kapi.Context, request *buildapi.BuildRe | |||
|
|||
newBuild, err := g.generateBuildFromConfig(ctx, bc, request.Revision, request.Binary) | |||
if err != nil { | |||
if oerrors.IsKnownAPIErrorType(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.
The correct test is casting to APIStatus in the kube pkg/api/errors
package - if the error implements that, we consider it already handled.
abc4b32
to
87a21e0
Compare
@smarterclayton updated. |
Evaluated for origin test up to 87a21e0 |
LGTM [merge] |
continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/6079/) (Image: devenv-rhel7_4569) |
Evaluated for origin merge up to 87a21e0 |
continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/6079/) |
No description provided.