diff --git a/templates/group_start b/templates/group_start new file mode 100644 index 0000000..3206eb2 --- /dev/null +++ b/templates/group_start @@ -0,0 +1,20 @@ +[[- if has . "count" ]] + count = [[ .count ]] +[[- end ]] + shutdown_delay = "6s" +[[ template "common/constraints" . ]] + +[[- if has .nomad "update" ]] + + update { + [[- range $key := coll.Slice "max_parallel" "health_check" "min_healthy_time" "healthy_deadline" "progress_deadline" "auto_revert" "auto_promote" "canary" "stagger" ]] + [[- if has $.nomad.update $key ]] + [[- if or (test.IsKind "bool" (index $.nomad.update $key)) (test.IsKind "number" (index $.nomad.update $key)) ]] + [[ $key ]] = [[ index $.nomad.update $key ]] + [[- else ]] + [[ $key ]] = [[ index $.nomad.update $key | toJSON ]] + [[- end ]] + [[- end ]] + [[- end ]] + } +[[- end ]] diff --git a/templates/job_start b/templates/job_start index 92100ef..50f850b 100644 --- a/templates/job_start +++ b/templates/job_start @@ -16,7 +16,7 @@ update { [[- range $key := coll.Slice "max_parallel" "health_check" "min_healthy_time" "healthy_deadline" "progress_deadline" "auto_revert" "auto_promote" "canary" "stagger" ]] [[- if has $.nomad.update $key ]] - [[- if or (test.IsKind "bool" (index $.nomad.update $key)) (test.IsKind "int" (index $.nomad.update $key)) ]] + [[- if or (test.IsKind "bool" (index $.nomad.update $key)) (test.IsKind "number" (index $.nomad.update $key)) ]] [[ $key ]] = [[ index $.nomad.update $key ]] [[- else ]] [[ $key ]] = [[ index $.nomad.update $key | toJSON ]]