Skip to content
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

Enhance error messages around image to tag resolving. #5920

Merged

Conversation

markusthoemmes
Copy link
Contributor

Fixes #5410

Proposed Changes

We currently surface the plain error returned from the tag resolution without further explanation. This adds wrapping around those errors to explain in which step it fails and adds wrapping around the outer layer to make sure the user gets enough context to be able to tell what exactly failed.

Release Note

Added more expressive error messages around image to tag resolving.

/assign @dgerd

We currently surface the plain error returned from the tag resolution without further explanation. This adds wrapping around those errors to explain in which step it fails and adds wrapping around the outer layer to make sure the user gets enough context to be able to tell what exactly failed.

Fixes knative#5410
@googlebot googlebot added the cla: yes Indicates the PR's author has signed the CLA. label Nov 1, 2019
@knative-prow-robot knative-prow-robot added area/API API objects and controllers size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Nov 1, 2019
Copy link
Contributor

@knative-prow-robot knative-prow-robot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@markusthoemmes: 1 warning.

In response to this:

Fixes #5410

Proposed Changes

We currently surface the plain error returned from the tag resolution without further explanation. This adds wrapping around those errors to explain in which step it fails and adds wrapping around the outer layer to make sure the user gets enough context to be able to tell what exactly failed.

Release Note

Added more expressive error messages around image to tag resolving.

/assign @dgerd

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

}

func TestResolutionFailed(t *testing.T) {
ctx, cancel, _, controller, _ := newTestController(t)
defer cancel()

// Unconditionally return this error during resolution.
errorMessage := "I am the expected error message, hear me ROAR!"
controller.Reconciler.(*Reconciler).resolver = &errorResolver{errorMessage}
innerError := errors.New("I am the expected error message, hear me ROAR!")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Golint errors: error strings should not be capitalized or end with punctuation or a newline. More info.

@knative-prow-robot knative-prow-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 1, 2019
@knative-metrics-robot
Copy link

The following is the coverage report on the affected files.
Say /test pull-knative-serving-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/reconciler/revision/revision.go 85.9% 86.1% 0.2

Copy link
Contributor

@vagababov vagababov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
It's a pity we verify only first possible error return path, though :|

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Nov 1, 2019
@markusthoemmes
Copy link
Contributor Author

/retest

@dprotaso
Copy link
Member

dprotaso commented Nov 1, 2019

/lgtm
/approve

@knative-prow-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dprotaso, markusthoemmes

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@dprotaso
Copy link
Member

dprotaso commented Nov 1, 2019

/retest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/API API objects and controllers cla: yes Indicates the PR's author has signed the CLA. lgtm Indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wrap the error from the registry with an explanatory message when image digest resolution failed
7 participants