mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
c8d/integration-cli: Adjust TestBuildClearCmd
Config serialization performed by the graphdriver implementation maintained the distinction between an empty array and having no Cmd set. With containerd integration we serialize the OCI types directly that use the `omitempty` option which doesn't persist that distinction. Considering that both values should have exactly the same semantics (no cmd being passed) it should be fine if in this case the Cmd would be null instead of an empty array. Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
This commit is contained in:
@@ -3144,9 +3144,13 @@ func (s *DockerCLIBuildSuite) TestBuildClearCmd(c *testing.T) {
|
||||
ENTRYPOINT ["/bin/bash"]
|
||||
CMD []`))
|
||||
|
||||
res := inspectFieldJSON(c, name, "Config.Cmd")
|
||||
if res != "[]" {
|
||||
c.Fatalf("Cmd %s, expected %s", res, "[]")
|
||||
cmd := inspectFieldJSON(c, name, "Config.Cmd")
|
||||
// OCI types specify `omitempty` JSON annotation which doesn't serialize
|
||||
// empty arrays and the Cmd will not be present at all.
|
||||
if testEnv.UsingSnapshotter() {
|
||||
assert.Check(c, is.Equal(cmd, "null"))
|
||||
} else {
|
||||
assert.Check(c, is.Equal(cmd, "[]"))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user