Skip to content

Commit

Permalink
comment replace COMPAT 0.7.0 for job.Update with more current info
Browse files Browse the repository at this point in the history
  • Loading branch information
langmartin committed May 21, 2019
1 parent 121483e commit 8b3ab79
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
4 changes: 3 additions & 1 deletion command/agent/job_endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,9 @@ func ApiJobToStructJob(job *api.Job) *structs.Job {
Affinities: ApiAffinitiesToStructs(job.Affinities),
}

// COMPAT: Remove in 0.7.0. Update has been pushed into the task groups
// Update has been pushed into the task groups. stagger and max_parallel are
// preserved at the job level, but all other values are discarded. The job.Update
// api value is passed down to the taskgroups so that they can use it as a default
if job.Update != nil {
j.Update = structs.UpdateStrategy{}

Expand Down
1 change: 0 additions & 1 deletion jobspec/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -1594,7 +1594,6 @@ func parseUpdate(result **api.UpdateStrategy, list *ast.ObjectList) error {

// Check for invalid keys
valid := []string{
// COMPAT: Remove in 0.7.0. Stagger is deprecated in 0.6.0.
"stagger",
"max_parallel",
"health_check",
Expand Down
3 changes: 1 addition & 2 deletions nomad/structs/diff.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ type JobDiff struct {
// diffable. If contextual diff is enabled, objects within the job will contain
// field information even if unchanged.
func (j *Job) Diff(other *Job, contextual bool) (*JobDiff, error) {
// COMPAT: Remove "Update" in 0.7.0. Update pushed down to task groups
// in 0.6.0
// See agent.ApiJobToStructJob Update is a default for TaskGroups
diff := &JobDiff{Type: DiffTypeNone}
var oldPrimitiveFlat, newPrimitiveFlat map[string]string
filter := []string{"ID", "Status", "StatusDescription", "Version", "Stable", "CreateIndex",
Expand Down
3 changes: 2 additions & 1 deletion nomad/structs/structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -3231,7 +3231,8 @@ type Job struct {
// to run. Each task group is an atomic unit of scheduling and placement.
TaskGroups []*TaskGroup

// COMPAT: Remove in 0.7.0. Stagger is deprecated in 0.6.0.
// See agent.ApiJobToStructJob
// Update provides defaults for the TaskGroup Update stanzas
Update UpdateStrategy

// Periodic is used to define the interval the job is run at.
Expand Down

0 comments on commit 8b3ab79

Please sign in to comment.