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

chore: replace UnavailableError with wrapping for i/p/client/ocisif (release4.0) #2279

Merged
merged 1 commit into from
Oct 20, 2023

Conversation

dtrudg
Copy link
Member

@dtrudg dtrudg commented Oct 20, 2023

Description of the Pull Request (PR):

In pkg/ocibundle/ocisif an UnavailableError type was provided to hold an underlying error, effectively performing error wrapping. The error was used:

  • In pkg/ocibundle/ocisif to wrap errors from a failed squashfs mount.
  • In internal/pkg/client to wrap errors from a failed tar -> squashfs conversion.

The underlying intent was to use this error type to implement fallback in the actions flows from OCI-SIF create/execution to a directory bundle.

Sharing a generic error across the packages isn't ideal, and we should be able to use Go's native error wrapping.

However, we shouldn't change pkg/ocibundle/ocisif as this modifies a public API.

This PR replaces the UnavailableError type in the client case with a specific error, and the use of error wrapping.

It was also noted that in actions.go error messages / warning were very long and confusing to read. They have been split to multiple errors / warnings.

Before submitting a PR, make sure you have done the following:

@dtrudg dtrudg self-assigned this Oct 20, 2023
@dtrudg dtrudg force-pushed the wrap-squashfs-errors-4.0 branch 2 times, most recently from 8274afa to 24b858d Compare October 20, 2023 10:33
…release4.0)

In pkg/ocibundle/ocisif an UnavailableError type was provided to
hold an underlying error, effectively performing error wrapping. The
error was used:

* In pkg/ocibundle/ocisif to wrap errors from a failed squashfs mount.
* In internal/pkg/client to wrap errors from a failed tar -> squashfs
conversion.

The underlying intent was to use this error type to implement fallback
in the actions flows from OCI-SIF create/execution to a directory
bundle.

Sharing a generic error across the packages isn't ideal, and we should
be able to use Go's native error wrapping.

However, we shouldn't change `pkg/ocibundle/ocisif` as this modifies a
public API.

This PR replaces the UnavailableError type in the client case with a
specific error, and the use of error wrapping.

It was also noted that in actions.go error messages / warning were
very long and confusing to read. They have been split to multiple
errors / warnings.
@dtrudg dtrudg force-pushed the wrap-squashfs-errors-4.0 branch from 24b858d to de01bc0 Compare October 20, 2023 10:34
@dtrudg dtrudg marked this pull request as ready for review October 20, 2023 10:47
@dtrudg dtrudg requested review from wobito and tri-adam October 20, 2023 10:47
@dtrudg dtrudg merged commit 1d9efb7 into sylabs:release-4.0 Oct 20, 2023
1 check passed
@dtrudg dtrudg deleted the wrap-squashfs-errors-4.0 branch October 20, 2023 14:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants