mirror of
https://github.com/containers/podman.git
synced 2025-12-06 05:37:49 +08:00
support multi-image (docker) archives
Support loading and saving tarballs with more than one image. Add a new `/libpod/images/export` endpoint to the rest API to allow for exporting/saving multiple images into an archive. Note that a non-release version of containers/image is vendored. A release version must be vendored before cutting a new Podman release. We force the containers/image version via a replace in the go.mod file; this way go won't try to match the versions. Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
This commit is contained in:
14
vendor/github.com/containers/image/v5/docker/errors.go
generated
vendored
14
vendor/github.com/containers/image/v5/docker/errors.go
generated
vendored
@@ -44,3 +44,17 @@ func httpResponseToError(res *http.Response, context string) error {
|
||||
return perrors.Errorf("%sinvalid status code from registry %d (%s)", context, res.StatusCode, http.StatusText(res.StatusCode))
|
||||
}
|
||||
}
|
||||
|
||||
// registryHTTPResponseToError creates a Go error from an HTTP error response of a docker/distribution
|
||||
// registry
|
||||
func registryHTTPResponseToError(res *http.Response) error {
|
||||
errResponse := client.HandleErrorResponse(res)
|
||||
if e, ok := perrors.Cause(errResponse).(*client.UnexpectedHTTPResponseError); ok {
|
||||
response := string(e.Response)
|
||||
if len(response) > 50 {
|
||||
response = response[:50] + "..."
|
||||
}
|
||||
errResponse = fmt.Errorf("StatusCode: %d, %s", e.StatusCode, response)
|
||||
}
|
||||
return errResponse
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user