hashicorp / hashicorp/nomad

make `hook` to accept array of values

Open
#25,124 1 comment 0 reactions 0 assignees View on GitHub
stage/needs-discussion theme/task lifecycle type/enhancement
Dominant language
Go
Stars
17k
Forks
2.1k
Avg merge
1d 9h
Merged PRs (30d)
105

Description

### Proposal
https://developer.hashicorp.com/nomad/docs/job-specification/lifecycle#lifecycle-parameters
Allow `hook` to accept array

### Use-cases
We have cleanup task. The definition is the exactly the same for `prestart` and `poststop` hooks. It would be nice to configure them as:
```tf
task "cleanup-smthg" {
lifecycle {
hook = ["prestart", "poststop" ]
sidecar = false
}
...
}
```

### Attempted Solutions
Copy/paste hook and change its type: prestart -> poststop

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the lifecycle parameters documentation linked in the issue and locate the implementation and validation for lifecycle.hook. Trace how prestart and poststop are represented, then determine what tests cover hook values; done means one task definition can use both hooks in an array without breaking existing single-value configurations.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
devops, infrastructure
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.