Skip to content

Handle commit error gracefully - #385

Closed
boaz0 wants to merge 1 commit into
podman-container-tools:masterfrom
boaz0:handle_error_on_commit_failure
Closed

Handle commit error gracefully#385
boaz0 wants to merge 1 commit into
podman-container-tools:masterfrom
boaz0:handle_error_on_commit_failure

Conversation

@boaz0

@boaz0 boaz0 commented Jan 7, 2018

Copy link
Copy Markdown
Contributor

This change gives a better error message when the commit fails because of bad authentication.

This fixes #254 and should be merged only after containers/image#390 is merged.

Comment thread cmd/buildah/commit.go Outdated
oErr := nErr[0]
for _, e := range nErr[1:] {
oErr = errors.Wrapf(e, oErr.Error())
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Iteratively wrapping each error with a separate call to errors.Wrapf() is going to produce duplication in the call stack. Perhaps converting the errcode.Errors into a github.com/urfave/cli/MultiError with its NewMultiError() function and then wrapping that result by calling errors.Wrapf() once would produce something more readable?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I found out that errors.Wrapfing MultiError makes the error message a little bit confusing so I went with returning just MultiError instead.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ah, I was wondering about that. Makes sense.

@rhatdan

rhatdan commented Jan 10, 2018

Copy link
Copy Markdown
Contributor

@ripcurld0 You have to sign your PR.

This change gives a better error message when the commit fails
because of bad authentication.

Signed-off-by: Boaz Shuster <ripcurld.github@gmail.com>
@rhatdan

rhatdan commented Jan 15, 2018

Copy link
Copy Markdown
Contributor

LGTM

@rhatdan

rhatdan commented Jan 15, 2018

Copy link
Copy Markdown
Contributor

@nalind @TomSweeneyRedHat PTAL

@TomSweeneyRedHat TomSweeneyRedHat left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@rhatdan

rhatdan commented Jan 15, 2018

Copy link
Copy Markdown
Contributor

@rh-atomic-bot r+

@rh-atomic-bot

Copy link
Copy Markdown

📌 Commit 8ca2bdb has been approved by rhatdan

@rh-atomic-bot

Copy link
Copy Markdown

⚡ Test exempted: merge already tested.

@rhatdan

rhatdan commented Jan 15, 2018

Copy link
Copy Markdown
Contributor

This should not have been merged yet.

@nalind

nalind commented Jan 15, 2018

Copy link
Copy Markdown
Contributor

Until containers/image#390 gets merged (and vendored here), this should just produce the same behavior we have now, so no harm done, right?

@boaz0

boaz0 commented Jan 15, 2018

Copy link
Copy Markdown
Contributor Author

@nalind correct.

@nalind

nalind commented Jan 15, 2018

Copy link
Copy Markdown
Contributor

Thanks!

@boaz0

boaz0 commented Jan 15, 2018

Copy link
Copy Markdown
Contributor Author

@nalind no problem 👍

nalind pushed a commit that referenced this pull request Apr 2, 2018
When trying to tag an alias (tag) of an image using only the shortname
and no tag, we were unable to find the image in storage.  This corrects
that issue and adds an integration test to protect against regression. I
also updated the man page per the filed issue.

While writing the integration test, I discovered that inspect could also
not find a tagged image without its :tag.

Resolves Issue #385
Resolves Issue #384

Signed-off-by: baude <bbaude@redhat.com>

Closes: #398
Approved by: mheon
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Oct 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Commit has misleading error when creds are required but not supplied

5 participants