Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compose: add build.extra_hosts to v3.9 schema #2517

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions cli/compose/loader/full-example.yml
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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