Support for rollback config in compose 3.7
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
version: "3.6"
|
||||
version: "3.7"
|
||||
|
||||
services:
|
||||
foo:
|
||||
@ -39,6 +39,13 @@ services:
|
||||
mode: replicated
|
||||
replicas: 6
|
||||
labels: [FOO=BAR]
|
||||
rollback_config:
|
||||
parallelism: 3
|
||||
delay: 10s
|
||||
failure_action: continue
|
||||
monitor: 60s
|
||||
max_failure_ratio: 0.3
|
||||
order: start-first
|
||||
update_config:
|
||||
parallelism: 3
|
||||
delay: 10s
|
||||
|
||||
@ -10,7 +10,7 @@ import (
|
||||
|
||||
func fullExampleConfig(workingDir, homeDir string) *types.Config {
|
||||
return &types.Config{
|
||||
Version: "3.6",
|
||||
Version: "3.7",
|
||||
Services: services(workingDir, homeDir),
|
||||
Networks: networks(),
|
||||
Volumes: volumes(),
|
||||
@ -41,6 +41,14 @@ func services(workingDir, homeDir string) []types.ServiceConfig {
|
||||
Mode: "replicated",
|
||||
Replicas: uint64Ptr(6),
|
||||
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{
|
||||
Parallelism: uint64Ptr(3),
|
||||
Delay: time.Duration(10 * time.Second),
|
||||
@ -393,7 +401,7 @@ func volumes() map[string]types.VolumeConfig {
|
||||
}
|
||||
|
||||
func fullExampleYAML(workingDir string) string {
|
||||
return fmt.Sprintf(`version: "3.6"
|
||||
return fmt.Sprintf(`version: "3.7"
|
||||
services:
|
||||
foo:
|
||||
build:
|
||||
@ -436,6 +444,13 @@ services:
|
||||
monitor: 1m0s
|
||||
max_failure_ratio: 0.3
|
||||
order: start-first
|
||||
rollback_config:
|
||||
parallelism: 3
|
||||
delay: 10s
|
||||
failure_action: continue
|
||||
monitor: 1m0s
|
||||
max_failure_ratio: 0.3
|
||||
order: start-first
|
||||
resources:
|
||||
limits:
|
||||
cpus: "0.001"
|
||||
|
||||
@ -19,7 +19,7 @@ func TestMarshallConfig(t *testing.T) {
|
||||
assert.Check(t, is.Equal(expected, string(actual)))
|
||||
|
||||
// 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)
|
||||
_, err = Load(buildConfigDetails(dict, map[string]string{}))
|
||||
assert.NilError(t, err)
|
||||
|
||||
Reference in New Issue
Block a user