moby/daemon/containerd/image_import_test.go
Paweł Gronowski 0ffa3dd870
daemon/c8d: Use Docker imagespec
This makes the c8d code which creates/reads OCI types not lose
Docker-specific features like ONBUILD or Healthcheck.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-08-31 17:15:05 +02:00

22 lines
559 B
Go

package containerd
import (
"testing"
"github.com/docker/docker/api/types/container"
"github.com/docker/go-connections/nat"
"gotest.tools/v3/assert"
is "gotest.tools/v3/assert/cmp"
)
// regression test for https://github.com/moby/moby/issues/45904
func TestContainerConfigToDockerImageConfig(t *testing.T) {
ociCFG := containerConfigToDockerOCIImageConfig(&container.Config{
ExposedPorts: nat.PortSet{
"80/tcp": struct{}{},
},
})
expected := map[string]struct{}{"80/tcp": {}}
assert.Check(t, is.DeepEqual(ociCFG.ExposedPorts, expected))
}