diff --git a/nomad/structs/structs.go b/nomad/structs/structs.go index bfbb2952d..b2da43656 100644 --- a/nomad/structs/structs.go +++ b/nomad/structs/structs.go @@ -1515,6 +1515,7 @@ func (j *Job) Stopped() bool { return j == nil || j.Stop } +// HasUpdateStrategy returns if any task group in the job has an update strategy func (j *Job) HasUpdateStrategy() bool { for _, tg := range j.TaskGroups { if tg.Update != nil { @@ -3803,6 +3804,7 @@ type Deployment struct { ModifyIndex uint64 } +// NewDeployment creates a new deployment given the job. func NewDeployment(job *Job) *Deployment { return &Deployment{ ID: GenerateUUID(), @@ -4649,17 +4651,6 @@ func (p *Plan) AppendAlloc(alloc *Allocation) { p.NodeAllocation[node] = append(existing, alloc) } -// AppendDeploymentUpdate attaches an deployment update to the plan for the -// given deployment ID. -func (p *Plan) AppendDeploymentUpdate(id, status, description string) { - update := &DeploymentStatusUpdate{ - DeploymentID: id, - Status: status, - StatusDescription: description, - } - p.DeploymentUpdates = append(p.DeploymentUpdates, update) -} - // IsNoOp checks if this plan would do nothing func (p *Plan) IsNoOp() bool { return len(p.NodeUpdate) == 0 &&