Переглянути джерело

Merge pull request #13718 from runcom/fix-containers-json

SizeRW & SizeRootFs omitted if empty in /container/json call
Jessie Frazelle 10 роки тому
батько
коміт
fdd6175bca
2 змінених файлів з 2 додано та 4 видалено
  1. 2 2
      api/types/types.go
  2. 0 2
      integration-cli/docker_api_containers_test.go

+ 2 - 2
api/types/types.go

@@ -107,8 +107,8 @@ type Container struct {
 	Command    string
 	Command    string
 	Created    int
 	Created    int
 	Ports      []Port
 	Ports      []Port
-	SizeRw     int
-	SizeRootFs int
+	SizeRw     int `json:",omitempty"`
+	SizeRootFs int `json:",omitempty"`
 	Labels     map[string]string
 	Labels     map[string]string
 	Status     string
 	Status     string
 }
 }

+ 0 - 2
integration-cli/docker_api_containers_test.go

@@ -71,8 +71,6 @@ func (s *DockerSuite) TestContainerApiGetJSONNoFieldsOmitted(c *check.C) {
 		"Command",
 		"Command",
 		"Created",
 		"Created",
 		"Ports",
 		"Ports",
-		"SizeRw",
-		"SizeRootFs",
 		"Labels",
 		"Labels",
 		"Status",
 		"Status",
 	}
 	}