mirror of
https://github.com/containers/podman.git
synced 2025-09-26 16:25:00 +08:00
Switch eventlogger to journald by default
[NO TESTS NEEDED] Since we are just testing the default. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:

committed by
Nalin Dahyabhai

parent
d1137664fe
commit
6b06e9b77c
17
vendor/github.com/containers/common/libimage/image.go
generated
vendored
17
vendor/github.com/containers/common/libimage/image.go
generated
vendored
@ -448,14 +448,24 @@ func (i *Image) removeRecursive(ctx context.Context, rmMap map[string]*RemoveIma
|
||||
return parent.removeRecursive(ctx, rmMap, processedIDs, "", options)
|
||||
}
|
||||
|
||||
var errTagDigest = errors.New("tag by digest not supported")
|
||||
|
||||
// Tag the image with the specified name and store it in the local containers
|
||||
// storage. The name is normalized according to the rules of NormalizeName.
|
||||
func (i *Image) Tag(name string) error {
|
||||
if strings.HasPrefix(name, "sha256:") { // ambiguous input
|
||||
return errors.Wrap(errTagDigest, name)
|
||||
}
|
||||
|
||||
ref, err := NormalizeName(name)
|
||||
if err != nil {
|
||||
return errors.Wrapf(err, "error normalizing name %q", name)
|
||||
}
|
||||
|
||||
if _, isDigested := ref.(reference.Digested); isDigested {
|
||||
return errors.Wrap(errTagDigest, name)
|
||||
}
|
||||
|
||||
logrus.Debugf("Tagging image %s with %q", i.ID(), ref.String())
|
||||
if i.runtime.eventChannel != nil {
|
||||
defer i.runtime.writeEvent(&Event{ID: i.ID(), Name: name, Time: time.Now(), Type: EventTypeImageTag})
|
||||
@ -480,7 +490,7 @@ var errUntagDigest = errors.New("untag by digest not supported")
|
||||
// the local containers storage. The name is normalized according to the rules
|
||||
// of NormalizeName.
|
||||
func (i *Image) Untag(name string) error {
|
||||
if strings.HasPrefix(name, "sha256:") {
|
||||
if strings.HasPrefix(name, "sha256:") { // ambiguous input
|
||||
return errors.Wrap(errUntagDigest, name)
|
||||
}
|
||||
|
||||
@ -488,6 +498,11 @@ func (i *Image) Untag(name string) error {
|
||||
if err != nil {
|
||||
return errors.Wrapf(err, "error normalizing name %q", name)
|
||||
}
|
||||
|
||||
if _, isDigested := ref.(reference.Digested); isDigested {
|
||||
return errors.Wrap(errUntagDigest, name)
|
||||
}
|
||||
|
||||
name = ref.String()
|
||||
|
||||
logrus.Debugf("Untagging %q from image %s", ref.String(), i.ID())
|
||||
|
Reference in New Issue
Block a user