podman/libpod/define/diff.go
Paul Holzinger 8f6a0243f4
podman diff accept two images or containers
First, make podman diff accept optionally a second argument. This allows
the user to specify a second image/container to compare the first with.
If it is not set the parent layer will be used as before.

Second, podman container diff should only use containers and podman
image diff should only use images. Previously, podman container diff
would use the image when both an image and container with this name
exists.

To make this work two new parameters have been added to the api. If they
are not used the previous behaviour is used. The same applies to the
bindings.

Fixes #10649

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-07-02 17:11:56 +02:00

27 lines
425 B
Go

package define
// extra type to use as enum
type DiffType uint8
const (
// only diff containers
DiffContainer DiffType = 1 << iota
// only diff images
DiffImage
// diff both containers and images
DiffAll DiffType = 0b11111111
)
func (d DiffType) String() string {
switch d {
case DiffAll:
return "all"
case DiffContainer:
return "container"
case DiffImage:
return "image"
default:
return "unknown"
}
}