For a follow-up, we must look into this signature.
#44964 (comment)
When working on the CLI I was wondering why pkg/archive was imported in some location where I wouldn't expect it, and I stumbled upon this code; https://github.com/docker/cli/blob/14482589df194a86b2ee07df643ba3277b40df7d/cli/command/container/formatter_diff.go#L56-L67
func (d *diffContext) Type() string {
var kind string
switch d.c.Kind {
case archive.ChangeModify:
kind = "C"
case archive.ChangeAdd:
kind = "A"
case archive.ChangeDelete:
kind = "D"
}
return kind
}
It turns out that the Client returns its own type for this, but that type does not have the enum values;
|
func (cli *Client) ContainerDiff(ctx context.Context, containerID string) ([]container.ContainerChangeResponseItem, error) { |
|
type ContainerChangeResponseItem struct { |
We should consider to either
- add the enums to the API types
- have the backend return the correct type
- have a utility to convert the type
- (possibly alias one for the other if needed)
Originally posted by @thaJeztah in #44964 (comment)
For a follow-up, we must look into this signature.
#44964 (comment)
When working on the CLI I was wondering why
pkg/archivewas imported in some location where I wouldn't expect it, and I stumbled upon this code; https://github.com/docker/cli/blob/14482589df194a86b2ee07df643ba3277b40df7d/cli/command/container/formatter_diff.go#L56-L67It turns out that the Client returns its own type for this, but that type does not have the enum values;
moby/client/container_diff.go
Line 12 in 1855a55
moby/api/types/container/container_changes.go
Line 11 in 1855a55
We should consider to either
Originally posted by @thaJeztah in #44964 (comment)