mirror of https://github.com/docker/cli.git
Rollback config type interpolation on fields "parallelism" and "max_failure_ratio" were missing, as it uses the same type as update_config.
Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
This commit is contained in:
parent
83aa71c45c
commit
efdf36fa81
|
@ -16,6 +16,8 @@ var interpolateTypeCastMapping = map[interp.Path]interp.Cast{
|
||||||
servicePath("deploy", "replicas"): toInt,
|
servicePath("deploy", "replicas"): toInt,
|
||||||
servicePath("deploy", "update_config", "parallelism"): toInt,
|
servicePath("deploy", "update_config", "parallelism"): toInt,
|
||||||
servicePath("deploy", "update_config", "max_failure_ratio"): toFloat,
|
servicePath("deploy", "update_config", "max_failure_ratio"): toFloat,
|
||||||
|
servicePath("deploy", "rollback_config", "parallelism"): toInt,
|
||||||
|
servicePath("deploy", "rollback_config", "max_failure_ratio"): toFloat,
|
||||||
servicePath("deploy", "restart_policy", "max_attempts"): toInt,
|
servicePath("deploy", "restart_policy", "max_attempts"): toInt,
|
||||||
servicePath("ports", interp.PathMatchList, "target"): toInt,
|
servicePath("ports", interp.PathMatchList, "target"): toInt,
|
||||||
servicePath("ports", interp.PathMatchList, "published"): toInt,
|
servicePath("ports", interp.PathMatchList, "published"): toInt,
|
||||||
|
|
|
@ -582,7 +582,7 @@ volumes:
|
||||||
|
|
||||||
func TestLoadWithInterpolationCastFull(t *testing.T) {
|
func TestLoadWithInterpolationCastFull(t *testing.T) {
|
||||||
dict, err := ParseYAML([]byte(`
|
dict, err := ParseYAML([]byte(`
|
||||||
version: "3.4"
|
version: "3.7"
|
||||||
services:
|
services:
|
||||||
web:
|
web:
|
||||||
configs:
|
configs:
|
||||||
|
@ -599,6 +599,9 @@ services:
|
||||||
update_config:
|
update_config:
|
||||||
parallelism: $theint
|
parallelism: $theint
|
||||||
max_failure_ratio: $thefloat
|
max_failure_ratio: $thefloat
|
||||||
|
rollback_config:
|
||||||
|
parallelism: $theint
|
||||||
|
max_failure_ratio: $thefloat
|
||||||
restart_policy:
|
restart_policy:
|
||||||
max_attempts: $theint
|
max_attempts: $theint
|
||||||
ports:
|
ports:
|
||||||
|
@ -649,7 +652,7 @@ networks:
|
||||||
assert.NilError(t, err)
|
assert.NilError(t, err)
|
||||||
expected := &types.Config{
|
expected := &types.Config{
|
||||||
Filename: "filename.yml",
|
Filename: "filename.yml",
|
||||||
Version: "3.4",
|
Version: "3.7",
|
||||||
Services: []types.ServiceConfig{
|
Services: []types.ServiceConfig{
|
||||||
{
|
{
|
||||||
Name: "web",
|
Name: "web",
|
||||||
|
@ -675,6 +678,10 @@ networks:
|
||||||
Parallelism: uint64Ptr(555),
|
Parallelism: uint64Ptr(555),
|
||||||
MaxFailureRatio: 3.14,
|
MaxFailureRatio: 3.14,
|
||||||
},
|
},
|
||||||
|
RollbackConfig: &types.UpdateConfig{
|
||||||
|
Parallelism: uint64Ptr(555),
|
||||||
|
MaxFailureRatio: 3.14,
|
||||||
|
},
|
||||||
RestartPolicy: &types.RestartPolicy{
|
RestartPolicy: &types.RestartPolicy{
|
||||||
MaxAttempts: uint64Ptr(555),
|
MaxAttempts: uint64Ptr(555),
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue