mirror of https://github.com/docker/cli.git
Support for rollback config in compose 3.7
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
This commit is contained in:
parent
df6e38b81a
commit
4e6e5d583c
|
@ -162,6 +162,7 @@ func Service(
|
||||||
EndpointSpec: endpoint,
|
EndpointSpec: endpoint,
|
||||||
Mode: mode,
|
Mode: mode,
|
||||||
UpdateConfig: convertUpdateConfig(service.Deploy.UpdateConfig),
|
UpdateConfig: convertUpdateConfig(service.Deploy.UpdateConfig),
|
||||||
|
RollbackConfig: convertUpdateConfig(service.Deploy.RollbackConfig),
|
||||||
}
|
}
|
||||||
|
|
||||||
// add an image label to serviceSpec
|
// add an image label to serviceSpec
|
||||||
|
|
|
@ -550,3 +550,17 @@ func (c *fakeClient) ConfigList(ctx context.Context, options types.ConfigListOpt
|
||||||
}
|
}
|
||||||
return []swarm.Config{}, nil
|
return []swarm.Config{}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestConvertUpdateConfigParallelism(t *testing.T) {
|
||||||
|
parallel := uint64(4)
|
||||||
|
|
||||||
|
// test default behavior
|
||||||
|
updateConfig := convertUpdateConfig(&composetypes.UpdateConfig{})
|
||||||
|
assert.Check(t, is.Equal(uint64(1), updateConfig.Parallelism))
|
||||||
|
|
||||||
|
// Non default value
|
||||||
|
updateConfig = convertUpdateConfig(&composetypes.UpdateConfig{
|
||||||
|
Parallelism: ¶llel,
|
||||||
|
})
|
||||||
|
assert.Check(t, is.Equal(parallel, updateConfig.Parallelism))
|
||||||
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
version: "3.6"
|
version: "3.7"
|
||||||
|
|
||||||
services:
|
services:
|
||||||
foo:
|
foo:
|
||||||
|
@ -39,6 +39,13 @@ services:
|
||||||
mode: replicated
|
mode: replicated
|
||||||
replicas: 6
|
replicas: 6
|
||||||
labels: [FOO=BAR]
|
labels: [FOO=BAR]
|
||||||
|
rollback_config:
|
||||||
|
parallelism: 3
|
||||||
|
delay: 10s
|
||||||
|
failure_action: continue
|
||||||
|
monitor: 60s
|
||||||
|
max_failure_ratio: 0.3
|
||||||
|
order: start-first
|
||||||
update_config:
|
update_config:
|
||||||
parallelism: 3
|
parallelism: 3
|
||||||
delay: 10s
|
delay: 10s
|
||||||
|
|
|
@ -10,7 +10,7 @@ import (
|
||||||
|
|
||||||
func fullExampleConfig(workingDir, homeDir string) *types.Config {
|
func fullExampleConfig(workingDir, homeDir string) *types.Config {
|
||||||
return &types.Config{
|
return &types.Config{
|
||||||
Version: "3.6",
|
Version: "3.7",
|
||||||
Services: services(workingDir, homeDir),
|
Services: services(workingDir, homeDir),
|
||||||
Networks: networks(),
|
Networks: networks(),
|
||||||
Volumes: volumes(),
|
Volumes: volumes(),
|
||||||
|
@ -41,6 +41,14 @@ func services(workingDir, homeDir string) []types.ServiceConfig {
|
||||||
Mode: "replicated",
|
Mode: "replicated",
|
||||||
Replicas: uint64Ptr(6),
|
Replicas: uint64Ptr(6),
|
||||||
Labels: map[string]string{"FOO": "BAR"},
|
Labels: map[string]string{"FOO": "BAR"},
|
||||||
|
RollbackConfig: &types.UpdateConfig{
|
||||||
|
Parallelism: uint64Ptr(3),
|
||||||
|
Delay: time.Duration(10 * time.Second),
|
||||||
|
FailureAction: "continue",
|
||||||
|
Monitor: time.Duration(60 * time.Second),
|
||||||
|
MaxFailureRatio: 0.3,
|
||||||
|
Order: "start-first",
|
||||||
|
},
|
||||||
UpdateConfig: &types.UpdateConfig{
|
UpdateConfig: &types.UpdateConfig{
|
||||||
Parallelism: uint64Ptr(3),
|
Parallelism: uint64Ptr(3),
|
||||||
Delay: time.Duration(10 * time.Second),
|
Delay: time.Duration(10 * time.Second),
|
||||||
|
@ -393,7 +401,7 @@ func volumes() map[string]types.VolumeConfig {
|
||||||
}
|
}
|
||||||
|
|
||||||
func fullExampleYAML(workingDir string) string {
|
func fullExampleYAML(workingDir string) string {
|
||||||
return fmt.Sprintf(`version: "3.6"
|
return fmt.Sprintf(`version: "3.7"
|
||||||
services:
|
services:
|
||||||
foo:
|
foo:
|
||||||
build:
|
build:
|
||||||
|
@ -436,6 +444,13 @@ services:
|
||||||
monitor: 1m0s
|
monitor: 1m0s
|
||||||
max_failure_ratio: 0.3
|
max_failure_ratio: 0.3
|
||||||
order: start-first
|
order: start-first
|
||||||
|
rollback_config:
|
||||||
|
parallelism: 3
|
||||||
|
delay: 10s
|
||||||
|
failure_action: continue
|
||||||
|
monitor: 1m0s
|
||||||
|
max_failure_ratio: 0.3
|
||||||
|
order: start-first
|
||||||
resources:
|
resources:
|
||||||
limits:
|
limits:
|
||||||
cpus: "0.001"
|
cpus: "0.001"
|
||||||
|
|
|
@ -19,7 +19,7 @@ func TestMarshallConfig(t *testing.T) {
|
||||||
assert.Check(t, is.Equal(expected, string(actual)))
|
assert.Check(t, is.Equal(expected, string(actual)))
|
||||||
|
|
||||||
// Make sure the expected still
|
// Make sure the expected still
|
||||||
dict, err := ParseYAML([]byte("version: '3.6'\n" + expected))
|
dict, err := ParseYAML([]byte("version: '3.7'\n" + expected))
|
||||||
assert.NilError(t, err)
|
assert.NilError(t, err)
|
||||||
_, err = Load(buildConfigDetails(dict, map[string]string{}))
|
_, err = Load(buildConfigDetails(dict, map[string]string{}))
|
||||||
assert.NilError(t, err)
|
assert.NilError(t, err)
|
||||||
|
|
|
@ -467,44 +467,44 @@ DoTuq9lAU9Q4O1xV/59X/w8AAP//zRo7vm9CAAA=
|
||||||
|
|
||||||
"/data/config_schema_v3.7.json": {
|
"/data/config_schema_v3.7.json": {
|
||||||
local: "data/config_schema_v3.7.json",
|
local: "data/config_schema_v3.7.json",
|
||||||
size: 17007,
|
size: 17540,
|
||||||
modtime: 1518458244,
|
modtime: 1518458244,
|
||||||
compressed: `
|
compressed: `
|
||||||
H4sIAAAAAAAC/+xbS4/jNhK++1cYTG7pxwAb7GLntsc97Z634RFoqmwzTZFMkfK0M/B/X+jZEkWKtK2e
|
H4sIAAAAAAAC/+xcS2/jOBK++1cImrlNHg3sYBfbtz3uafe8gVug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ZfN+Gy6Z51P2UAYT3FToNsdZtBXiPOcLxo+HX2aQ
|
TRX+OPIGy4v4LOID6PWd1TU5DJ3qaqk+1fXe6rKaVQZqm16uzEkyuqN2NbxL6bdhkzn+fwNfBuPdlO+K
|
||||||
4lyT8xtBrAU6wvw6dUoUq77/y/0SN+wjuvGT73IrPuVpcs/zbdwD0HxTuxnJxyFpvi0YBOxNUuLr+1rX
|
z1q0FeI85wueHw+/zCDFuc73N4JYC7QJunVqlShWfVOg/Xm2P0Z04ycfa1d8iuPk8u/7uDGk+dB6PZKP
|
||||||
7UDovpoNNEWNs8NV9f959f8AAAD//7jxwB5vQgAA
|
RdJ8cDI4sNdRia/rE267LaX7lNrTKTfODlfV39Pq/wEAAP//il2qfYREAAA=
|
||||||
`,
|
`,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -348,6 +348,20 @@
|
||||||
"endpoint_mode": {"type": "string"},
|
"endpoint_mode": {"type": "string"},
|
||||||
"replicas": {"type": "integer"},
|
"replicas": {"type": "integer"},
|
||||||
"labels": {"$ref": "#/definitions/list_or_dict"},
|
"labels": {"$ref": "#/definitions/list_or_dict"},
|
||||||
|
"rollback_config": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"parallelism": {"type": "integer"},
|
||||||
|
"delay": {"type": "string", "format": "duration"},
|
||||||
|
"failure_action": {"type": "string"},
|
||||||
|
"monitor": {"type": "string", "format": "duration"},
|
||||||
|
"max_failure_ratio": {"type": "number"},
|
||||||
|
"order": {"type": "string", "enum": [
|
||||||
|
"start-first", "stop-first"
|
||||||
|
]}
|
||||||
|
},
|
||||||
|
"additionalProperties": false
|
||||||
|
},
|
||||||
"update_config": {
|
"update_config": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
|
|
@ -114,3 +114,92 @@ func TestValidateIsolation(t *testing.T) {
|
||||||
}
|
}
|
||||||
assert.NilError(t, Validate(config, "3.5"))
|
assert.NilError(t, Validate(config, "3.5"))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestValidateRollbackConfig(t *testing.T) {
|
||||||
|
config := dict{
|
||||||
|
"version": "3.4",
|
||||||
|
"services": dict{
|
||||||
|
"foo": dict{
|
||||||
|
"image": "busybox",
|
||||||
|
"deploy": dict{
|
||||||
|
"rollback_config": dict{
|
||||||
|
"parallelism": 1,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
assert.NilError(t, Validate(config, "3.7"))
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestValidateRollbackConfigWithOrder(t *testing.T) {
|
||||||
|
config := dict{
|
||||||
|
"version": "3.4",
|
||||||
|
"services": dict{
|
||||||
|
"foo": dict{
|
||||||
|
"image": "busybox",
|
||||||
|
"deploy": dict{
|
||||||
|
"rollback_config": dict{
|
||||||
|
"parallelism": 1,
|
||||||
|
"order": "start-first",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
assert.NilError(t, Validate(config, "3.7"))
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestValidateRollbackConfigWithUpdateConfig(t *testing.T) {
|
||||||
|
config := dict{
|
||||||
|
"version": "3.4",
|
||||||
|
"services": dict{
|
||||||
|
"foo": dict{
|
||||||
|
"image": "busybox",
|
||||||
|
"deploy": dict{
|
||||||
|
"update_config": dict{
|
||||||
|
"parallelism": 1,
|
||||||
|
"order": "start-first",
|
||||||
|
},
|
||||||
|
"rollback_config": dict{
|
||||||
|
"parallelism": 1,
|
||||||
|
"order": "start-first",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
assert.NilError(t, Validate(config, "3.7"))
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestValidateRollbackConfigWithUpdateConfigFull(t *testing.T) {
|
||||||
|
config := dict{
|
||||||
|
"version": "3.4",
|
||||||
|
"services": dict{
|
||||||
|
"foo": dict{
|
||||||
|
"image": "busybox",
|
||||||
|
"deploy": dict{
|
||||||
|
"update_config": dict{
|
||||||
|
"parallelism": 1,
|
||||||
|
"order": "start-first",
|
||||||
|
"delay": "10s",
|
||||||
|
"failure_action": "pause",
|
||||||
|
"monitor": "10s",
|
||||||
|
},
|
||||||
|
"rollback_config": dict{
|
||||||
|
"parallelism": 1,
|
||||||
|
"order": "start-first",
|
||||||
|
"delay": "10s",
|
||||||
|
"failure_action": "pause",
|
||||||
|
"monitor": "10s",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
assert.NilError(t, Validate(config, "3.7"))
|
||||||
|
}
|
||||||
|
|
|
@ -194,6 +194,7 @@ type DeployConfig struct {
|
||||||
Replicas *uint64 `yaml:",omitempty"`
|
Replicas *uint64 `yaml:",omitempty"`
|
||||||
Labels Labels `yaml:",omitempty"`
|
Labels Labels `yaml:",omitempty"`
|
||||||
UpdateConfig *UpdateConfig `mapstructure:"update_config" yaml:"update_config,omitempty"`
|
UpdateConfig *UpdateConfig `mapstructure:"update_config" yaml:"update_config,omitempty"`
|
||||||
|
RollbackConfig *UpdateConfig `mapstructure:"rollback_config" yaml:"rollback_config,omitempty"`
|
||||||
Resources Resources `yaml:",omitempty"`
|
Resources Resources `yaml:",omitempty"`
|
||||||
RestartPolicy *RestartPolicy `mapstructure:"restart_policy" yaml:"restart_policy,omitempty"`
|
RestartPolicy *RestartPolicy `mapstructure:"restart_policy" yaml:"restart_policy,omitempty"`
|
||||||
Placement Placement `yaml:",omitempty"`
|
Placement Placement `yaml:",omitempty"`
|
||||||
|
|
Loading…
Reference in New Issue