Skip to content
This repository was archived by the owner on Jan 8, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .changelog/3883.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
```release-note:bug
plugin/nomad: Update Nomad task launcher plugin to respect namespace and region
configs in runner profile
```
```release-note:bug
plugin/nomad-jobspec: Update Nomad jobspec status check to not report partial
health for deployments with canaries
```
9 changes: 9 additions & 0 deletions builtin/nomad/jobspec/platform.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,15 @@ func (p *Platform) resourceJobStatus(
}
}

// Need to subtract # of canaries in the update stanza from
// "completed". Canary allocs will end up in the "completed"
// state after the deployment, and thusly throw off the count
// of otherwise "completed" allocs, resulting in a partial
// state, when it's actually healthy
if complete > 0 {
complete = complete - *job.Update.Canary
}

if running == currentJobVersionAllocs && hasSquashedEvals == false {
jobResource.Health = sdk.StatusReport_READY
jobResource.HealthMessage = fmt.Sprintf("Job %q is reporting ready!", state.Name)
Expand Down
6 changes: 5 additions & 1 deletion builtin/nomad/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,11 @@ func (p *TaskLauncher) StartTask(
job.TaskGroups[0].Tasks[0].Config = config

log.Debug("registering on-demand task job", "task-name", taskName)
_, _, err = jobclient.Register(job, nil)
writeOptions := &api.WriteOptions{
Region: p.config.Region,
Namespace: p.config.Namespace,
}
_, _, err = jobclient.Register(job, writeOptions)
if err != nil {
log.Debug("failed to register job to nomad")
return nil, err
Expand Down