Skip to content

Commit

Permalink
Merge pull request #2517 from thaJeztah/compose_file_build_extra_hosts
Browse files Browse the repository at this point in the history
compose: add build.extra_hosts to v3.9 schema
  • Loading branch information
silvin-lubecki committed May 11, 2020
2 parents f327b97 + 0c5f97e commit ce2a9fa
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 39 deletions.
3 changes: 3 additions & 0 deletions cli/compose/loader/full-example.yml
Expand Up @@ -13,6 +13,9 @@ services:
cache_from:
- foo
- bar
extra_hosts:
- "ipv4.example.com:127.0.0.1"
- "ipv6.example.com:::1"
labels: [FOO=BAR]


Expand Down
13 changes: 12 additions & 1 deletion cli/compose/loader/full-struct_test.go
Expand Up @@ -39,7 +39,11 @@ func services(workingDir, homeDir string) []types.ServiceConfig {
Target: "foo",
Network: "foo",
CacheFrom: []string{"foo", "bar"},
Labels: map[string]string{"FOO": "BAR"},
ExtraHosts: types.HostsList{
"ipv4.example.com:127.0.0.1",
"ipv6.example.com:::1",
},
Labels: map[string]string{"FOO": "BAR"},
},
CapAdd: []string{"ALL"},
CapDrop: []string{"NET_ADMIN", "SYS_ADMIN"},
Expand Down Expand Up @@ -526,6 +530,9 @@ services:
cache_from:
- foo
- bar
extra_hosts:
- ipv4.example.com:127.0.0.1
- ipv6.example.com:::1
network: foo
target: foo
cap_add:
Expand Down Expand Up @@ -998,6 +1005,10 @@ func fullExampleJSON(workingDir string) string {
"foo",
"bar"
],
"extra_hosts": [
"ipv4.example.com:127.0.0.1",
"ipv6.example.com:::1"
],
"network": "foo",
"target": "foo"
},
Expand Down
74 changes: 37 additions & 37 deletions cli/compose/schema/bindata.go

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

3 changes: 2 additions & 1 deletion cli/compose/schema/data/config_schema_v3.9.json
Expand Up @@ -88,7 +88,8 @@
"cache_from": {"$ref": "#/definitions/list_of_strings"},
"network": {"type": "string"},
"target": {"type": "string"},
"shm_size": {"type": ["integer", "string"]}
"shm_size": {"type": ["integer", "string"]},
"extra_hosts": {"$ref": "#/definitions/list_or_dict"}
},
"additionalProperties": false
}
Expand Down
1 change: 1 addition & 0 deletions cli/compose/types/types.go
Expand Up @@ -221,6 +221,7 @@ type BuildConfig struct {
Args MappingWithEquals `yaml:",omitempty" json:"args,omitempty"`
Labels Labels `yaml:",omitempty" json:"labels,omitempty"`
CacheFrom StringList `mapstructure:"cache_from" yaml:"cache_from,omitempty" json:"cache_from,omitempty"`
ExtraHosts HostsList `mapstructure:"extra_hosts" yaml:"extra_hosts,omitempty" json:"extra_hosts,omitempty"`
Network string `yaml:",omitempty" json:"network,omitempty"`
Target string `yaml:",omitempty" json:"target,omitempty"`
}
Expand Down

0 comments on commit ce2a9fa

Please sign in to comment.