mirror of
https://github.com/containers/podman.git
synced 2025-11-02 14:55:28 +08:00
vendor in latests containers/common
To include export HostContainersInternal Signed-off-by: Black-Hole1 <bh@bugs.cc>
This commit is contained in:
8
vendor/github.com/containers/common/libimage/image.go
generated
vendored
8
vendor/github.com/containers/common/libimage/image.go
generated
vendored
@ -424,14 +424,12 @@ func (i *Image) removeRecursive(ctx context.Context, rmMap map[string]*RemoveIma
|
||||
numNames := len(i.Names())
|
||||
|
||||
// NOTE: the `numNames == 1` check is not only a performance
|
||||
// optimization but also preserves exiting Podman/Docker behaviour.
|
||||
// optimization but also preserves existing Podman/Docker behaviour.
|
||||
// If image "foo" is used by a container and has only this tag/name,
|
||||
// an `rmi foo` will not untag "foo" but instead attempt to remove the
|
||||
// entire image. If there's a container using "foo", we should get an
|
||||
// error.
|
||||
if referencedBy == "" || numNames == 1 {
|
||||
// DO NOTHING, the image will be removed
|
||||
} else {
|
||||
if !(referencedBy == "" || numNames == 1) {
|
||||
byID := strings.HasPrefix(i.ID(), referencedBy)
|
||||
byDigest := strings.HasPrefix(referencedBy, "sha256:")
|
||||
if !options.Force {
|
||||
@ -737,7 +735,7 @@ func (i *Image) RepoDigests() ([]string, error) {
|
||||
// Mount the image with the specified mount options and label, both of which
|
||||
// are directly passed down to the containers storage. Returns the fully
|
||||
// evaluated path to the mount point.
|
||||
func (i *Image) Mount(ctx context.Context, mountOptions []string, mountLabel string) (string, error) {
|
||||
func (i *Image) Mount(_ context.Context, mountOptions []string, mountLabel string) (string, error) {
|
||||
if i.runtime.eventChannel != nil {
|
||||
defer i.runtime.writeEvent(&Event{ID: i.ID(), Name: "", Time: time.Now(), Type: EventTypeImageMount})
|
||||
}
|
||||
|
||||
10
vendor/github.com/containers/common/libimage/manifest_list.go
generated
vendored
10
vendor/github.com/containers/common/libimage/manifest_list.go
generated
vendored
@ -388,10 +388,7 @@ func (m *ManifestList) AnnotateInstance(d digest.Digest, options *ManifestListAn
|
||||
}
|
||||
|
||||
// Write the changes to disk.
|
||||
if err := m.saveAndReload(); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
return m.saveAndReload()
|
||||
}
|
||||
|
||||
// RemoveInstance removes the instance specified by `d` from the manifest list.
|
||||
@ -402,10 +399,7 @@ func (m *ManifestList) RemoveInstance(d digest.Digest) error {
|
||||
}
|
||||
|
||||
// Write the changes to disk.
|
||||
if err := m.saveAndReload(); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
return m.saveAndReload()
|
||||
}
|
||||
|
||||
// ManifestListPushOptions allow for customizing pushing a manifest list.
|
||||
|
||||
2
vendor/github.com/containers/common/libimage/manifests/manifests.go
generated
vendored
2
vendor/github.com/containers/common/libimage/manifests/manifests.go
generated
vendored
@ -423,7 +423,7 @@ func (l *list) Remove(instanceDigest digest.Digest) error {
|
||||
// then use that list's SaveToImage() method to save a modified version of the
|
||||
// list to that image record use this lock to avoid accidentally wiping out
|
||||
// changes that another process is also attempting to make.
|
||||
func LockerForImage(store storage.Store, image string) (lockfile.Locker, error) {
|
||||
func LockerForImage(store storage.Store, image string) (lockfile.Locker, error) { // nolint:staticcheck
|
||||
img, err := store.Image(image)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("locating image %q for locating lock: %w", image, err)
|
||||
|
||||
Reference in New Issue
Block a user