mirror of
https://github.com/containers/podman.git
synced 2025-12-01 10:38:05 +08:00
vendor containers/common@e27c30ee9b
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
This commit is contained in:
19
vendor/github.com/containers/common/libimage/image.go
generated
vendored
19
vendor/github.com/containers/common/libimage/image.go
generated
vendored
@@ -23,6 +23,17 @@ import (
|
||||
// Image represents an image in the containers storage and allows for further
|
||||
// operations and data manipulation.
|
||||
type Image struct {
|
||||
// ListData that is being set by (*Runtime).ListImages(). Note that
|
||||
// the data may be outdated.
|
||||
ListData struct {
|
||||
// Dangling indicates if the image is dangling. Use
|
||||
// `IsDangling()` to compute the latest state.
|
||||
IsDangling *bool
|
||||
// Parent points to the parent image. Use `Parent()` to
|
||||
// compute the latest state.
|
||||
Parent *Image
|
||||
}
|
||||
|
||||
// Backwards pointer to the runtime.
|
||||
runtime *Runtime
|
||||
|
||||
@@ -216,10 +227,14 @@ func (i *Image) TopLayer() string {
|
||||
|
||||
// Parent returns the parent image or nil if there is none
|
||||
func (i *Image) Parent(ctx context.Context) (*Image, error) {
|
||||
tree, err := i.runtime.layerTree()
|
||||
tree, err := i.runtime.layerTree(nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return i.parent(ctx, tree)
|
||||
}
|
||||
|
||||
func (i *Image) parent(ctx context.Context, tree *layerTree) (*Image, error) {
|
||||
return tree.parent(ctx, i)
|
||||
}
|
||||
|
||||
@@ -246,7 +261,7 @@ func (i *Image) Children(ctx context.Context) ([]*Image, error) {
|
||||
// created for this invocation only.
|
||||
func (i *Image) getChildren(ctx context.Context, all bool, tree *layerTree) ([]*Image, error) {
|
||||
if tree == nil {
|
||||
t, err := i.runtime.layerTree()
|
||||
t, err := i.runtime.layerTree(nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user