MCPcopy Create free account
hub / github.com/containers/common / isDangling

Method isDangling

libimage/image.go:156–165  ·  view source on GitHub ↗

isDangling returns true if the image is dangling, that is an untagged image without children. If tree is nil, it will created for this invocation only.

(ctx context.Context, tree *layerTree)

Source from the content-addressed store, hash-verified

154// isDangling returns true if the image is dangling, that is an untagged image
155// without children. If tree is nil, it will created for this invocation only.
156func (i *Image) isDangling(ctx context.Context, tree *layerTree) (bool, error) {
157 if len(i.Names()) > 0 {
158 return false, nil
159 }
160 children, err := i.getChildren(ctx, false, tree)
161 if err != nil {
162 return false, err
163 }
164 return len(children) == 0, nil
165}
166
167// IsIntermediate returns true if the image is an intermediate image, that is
168// an untagged image with children.

Callers 2

IsDanglingMethod · 0.95
filterDanglingFunction · 0.80

Calls 2

NamesMethod · 0.95
getChildrenMethod · 0.95

Tested by

no test coverage detected