mirror of
https://github.com/containers/podman.git
synced 2025-09-29 01:35:06 +08:00
vendor c/image/v5@main
Mainly to pull in fixes for #11636 which handles credential helpers correctly. Fixes: #11636 Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
This commit is contained in:
3
vendor/github.com/containers/image/v5/copy/copy.go
generated
vendored
3
vendor/github.com/containers/image/v5/copy/copy.go
generated
vendored
@ -1058,7 +1058,8 @@ func (ic *imageCopier) copyUpdatedConfigAndManifest(ctx context.Context, instanc
|
||||
instanceDigest = &manifestDigest
|
||||
}
|
||||
if err := ic.c.dest.PutManifest(ctx, man, instanceDigest); err != nil {
|
||||
return nil, "", errors.Wrapf(err, "writing manifest %q", string(man))
|
||||
logrus.Debugf("Error %v while writing manifest %q", err, string(man))
|
||||
return nil, "", errors.Wrapf(err, "writing manifest")
|
||||
}
|
||||
return man, manifestDigest, nil
|
||||
}
|
||||
|
12
vendor/github.com/containers/image/v5/docker/docker_image_dest.go
generated
vendored
12
vendor/github.com/containers/image/v5/docker/docker_image_dest.go
generated
vendored
@ -464,6 +464,18 @@ func (d *dockerImageDestination) PutManifest(ctx context.Context, m []byte, inst
|
||||
}
|
||||
return err
|
||||
}
|
||||
// A HTTP server may not be a registry at all, and just return 200 OK to everything
|
||||
// (in particular that can fairly easily happen after tearing down a website and
|
||||
// replacing it with a global 302 redirect to a new website, completely ignoring the
|
||||
// path in the request); in that case we could “succeed” uploading a whole image.
|
||||
// With docker/distribution we could rely on a Docker-Content-Digest header being present
|
||||
// (because docker/distribution/registry/client has been failing uploads if it was missing),
|
||||
// but that has been defined as explicitly optional by
|
||||
// https://github.com/opencontainers/distribution-spec/blob/ec90a2af85fe4d612cf801e1815b95bfa40ae72b/spec.md#legacy-docker-support-http-headers
|
||||
// So, just note the missing header in a debug log.
|
||||
if v := res.Header.Values("Docker-Content-Digest"); len(v) == 0 {
|
||||
logrus.Debugf("Manifest upload response didn’t contain a Docker-Content-Digest header, it might not be a container registry")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
4
vendor/github.com/containers/image/v5/pkg/docker/config/config.go
generated
vendored
4
vendor/github.com/containers/image/v5/pkg/docker/config/config.go
generated
vendored
@ -620,6 +620,10 @@ func getAuthFromCredHelper(credHelper, registry string) (types.DockerAuthConfig,
|
||||
p := helperclient.NewShellProgramFunc(helperName)
|
||||
creds, err := helperclient.Get(p, registry)
|
||||
if err != nil {
|
||||
if credentials.IsErrCredentialsNotFoundMessage(err.Error()) {
|
||||
logrus.Debugf("Not logged in to %s with credential helper %s", registry, credHelper)
|
||||
err = nil
|
||||
}
|
||||
return types.DockerAuthConfig{}, err
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user