Skip to content

Commit

Permalink
api/jobs keep the nils in Copy and Merge for api UpdateStrategy
Browse files Browse the repository at this point in the history
  • Loading branch information
langmartin committed May 22, 2019
1 parent 6664e63 commit 0ee7235
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions api/jobs.go
Original file line number Diff line number Diff line change
Expand Up @@ -435,9 +435,8 @@ func (u *UpdateStrategy) Copy() *UpdateStrategy {
copy.Canary = intToPtr(*u.Canary)
}

if u.AutoPromote != nil {
copy.AutoPromote = boolToPtr(*u.AutoPromote)
}
// boolPtrs need to preserve nil unset value
copy.AutoPromote = u.AutoPromote

return copy
}
Expand Down Expand Up @@ -479,9 +478,8 @@ func (u *UpdateStrategy) Merge(o *UpdateStrategy) {
u.Canary = intToPtr(*o.Canary)
}

if o.AutoPromote != nil {
u.AutoPromote = boolToPtr(*o.AutoPromote)
}
// boolPtrs need to preserve nil unset value
u.AutoPromote = o.AutoPromote
}

func (u *UpdateStrategy) Canonicalize() {
Expand Down

0 comments on commit 0ee7235

Please sign in to comment.