Skip to content

Commit

Permalink
Upper case signals
Browse files Browse the repository at this point in the history
  • Loading branch information
dadgar committed Oct 25, 2016
1 parent 1570b3b commit b580a6a
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions nomad/structs/structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit b580a6a

Please sign in to comment.