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:
parent
82a318db5f
commit
90dfb1c8ad
1 changed files with 7 additions and 3 deletions
|
@ -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, "[]"))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue