mirror of
https://github.com/containers/podman.git
synced 2025-05-21 00:56:36 +08:00

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>
27 lines
425 B
Go
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"
|
|
}
|
|
}
|