Skip to content

Commit

Permalink
Implementing suggested changes hashicorp#7170
Browse files Browse the repository at this point in the history
  • Loading branch information
Fredrik Hoem Grelland committed Feb 19, 2020
1 parent e8927da commit f8e45c8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ IMPROVEMENTS:
* cli: Included namespace in output when querying job status [[GH-6912](https://github.com/hashicorp/nomad/issues/6912)]
* cli: Added option to change the name of the file created by the `nomad init` command [[GH-6520]](https://github.com/hashicorp/nomad/pull/6520)
* client: Supported AWS EC2 Instance Metadata Service Version 2 (IMDSv2) [[GH-6779](https://github.com/hashicorp/nomad/issues/6779)]
* client: Updated consul-template library to v0.24.1 - added support for working with consul connect. Deprecated vault_grace. [[GH-7170](https://github.com/hashicorp/nomad/pull/7170)]
* consul: Add support for service `canary_meta` [[GH-6690](https://github.com/hashicorp/nomad/pull/6690)]
* driver/docker: Added a `disable_log_collection` parameter to disable nomad log collection [[GH-6820](https://github.com/hashicorp/nomad/issues/6820)]
* server: Introduced a `default_scheduler_config` config parameter to seed initial preemption configuration. [[GH-6935](https://github.com/hashicorp/nomad/issues/6935)]
Expand Down
1 change: 1 addition & 0 deletions command/agent/job_endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -914,6 +914,7 @@ func ApiTaskToStructsTask(apiTask *api.Task, structsTask *structs.Task) {
LeftDelim: *template.LeftDelim,
RightDelim: *template.RightDelim,
Envvars: *template.Envvars,
VaultGrace: *template.VaultGrace,
}
}
}
Expand Down
10 changes: 10 additions & 0 deletions nomad/structs/structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -5960,6 +5960,12 @@ type Template struct {
// Empty lines and lines starting with # will be ignored, but to avoid
// escaping issues #s within lines will not be treated as comments.
Envvars bool

// VaultGrace is the grace duration between lease renewal and reacquiring a
// secret. If the lease of a secret is less than the grace, a new secret is
// acquired.
// COMPAT(0.12) VaultGrace has been ignored by Vault since Vault v0.5.
VaultGrace time.Duration
}

// DefaultTemplate returns a default template.
Expand Down Expand Up @@ -6033,6 +6039,10 @@ func (t *Template) Validate() error {
}
}

if t.VaultGrace > 0 {
multierror.Append(&mErr, fmt.Errorf("VaultGrace has been deprecated as of Nomad 0.11 and ignored since Vault 0.5. Please remove VaultGrace / vault_grace from template stanza."))
}

return mErr.ErrorOrNil()
}

Expand Down

0 comments on commit f8e45c8

Please sign in to comment.