diff --git a/nomad/structs/structs.go b/nomad/structs/structs.go index a034c60570b..37855765148 100644 --- a/nomad/structs/structs.go +++ b/nomad/structs/structs.go @@ -2091,6 +2091,14 @@ func (t *Task) Canonicalize(job *Job, tg *TaskGroup) { if t.KillTimeout == 0 { t.KillTimeout = DefaultKillTimeout } + + if t.Vault != nil { + t.Vault.Canonicalize() + } + + for _, template := range t.Templates { + template.Canonicalize() + } } func (t *Task) GoString() string { @@ -2315,6 +2323,12 @@ func (t *Template) Copy() *Template { return copy } +func (t *Template) Canonicalize() { + if t.ChangeSignal != "" { + t.ChangeSignal = strings.ToUpper(t.ChangeSignal) + } +} + func (t *Template) Validate() error { var mErr multierror.Error @@ -2916,6 +2930,12 @@ func (v *Vault) Copy() *Vault { return nv } +func (v *Vault) Canonicalize() { + if v.ChangeSignal != "" { + v.ChangeSignal = strings.ToUpper(v.ChangeSignal) + } +} + // Validate returns if the Vault block is valid. func (v *Vault) Validate() error { if v == nil {