Skip to content

Commit

Permalink
delete omitempty from Privileged in api
Browse files Browse the repository at this point in the history
Signed-off-by: ziren.wzr <ziren.wzr@alibaba-inc.com>
  • Loading branch information
HusterWan authored and fuweid committed Jan 14, 2019
1 parent 01bc2a0 commit e378474
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
5 changes: 3 additions & 2 deletions apis/swagger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2273,9 +2273,9 @@ definitions:

HostConfig:
description: "Container configuration that depends on the host we are running on"
type: "object"
allOf:
- properties:
- type: "object"
properties:
# Applicable to all platforms
Binds:
type: "array"
Expand Down Expand Up @@ -2389,6 +2389,7 @@ definitions:
- `"host"`: use the host's PID namespace inside the container
Privileged:
type: "boolean"
x-omitempty: false
description: "Gives the container full access to the host."
PublishAllPorts:
type: "boolean"
Expand Down
6 changes: 3 additions & 3 deletions apis/types/host_config.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion test/cli_inspect_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func (suite *PouchInspectSuite) TestInspectCreateAndStartedFormat(c *check.C) {
res = command.PouchRun("start", name)
res.Assert(c, icmd.Success)

// Inspect LogPath, HostnamePath, HostsPath, ResolvConfPath
// Inspect LogPath, HostnamePath, HostsPath, ResolvConfPath, Privileged
output = command.PouchRun("inspect", "-f", "{{.LogPath}}", name).Stdout()
expectedLogPath := fmt.Sprintf(rootDir+"/containers/%s/json.log", containerID)
c.Assert(strings.TrimSpace(output), check.Equals, expectedLogPath)
Expand All @@ -86,6 +86,9 @@ func (suite *PouchInspectSuite) TestInspectCreateAndStartedFormat(c *check.C) {
output = command.PouchRun("inspect", "-f", "{{.HostsPath}}", name).Stdout()
expectedLogPath = fmt.Sprintf(rootDir+"/containers/%s/hosts", containerID)
c.Assert(strings.TrimSpace(output), check.Equals, expectedLogPath)

output = command.PouchRun("inspect", "-f", "{{.HostConfig.Privileged}}", name).Stdout()
c.Assert(strings.TrimSpace(output), check.Equals, "false")
}

// TestInspectWrongFormat is to verify using wrong format flag of inspect command.
Expand Down

0 comments on commit e378474

Please sign in to comment.