0ffa3dd870
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>
22 lines
559 B
Go
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))
|
|
}
|