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)
| 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. |
| 156 | func (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. |
no test coverage detected