Small cleanup
This commit is contained in:
parent
07b1c3e5db
commit
d5ea5a16fd
|
@ -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 &&
|
||||
|
|
Loading…
Reference in New Issue