From d5ea5a16fdc754ea4284cb8070ed29b87217d6d4 Mon Sep 17 00:00:00 2001 From: Alex Dadgar Date: Mon, 22 May 2017 17:06:46 -0700 Subject: [PATCH] Small cleanup --- nomad/structs/structs.go | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) 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 &&