From 0ee72357120a86090eff0ec9529d666c148c2112 Mon Sep 17 00:00:00 2001 From: Lang Martin Date: Tue, 21 May 2019 21:43:35 -0400 Subject: [PATCH] api/jobs keep the nils in Copy and Merge for api UpdateStrategy --- api/jobs.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/api/jobs.go b/api/jobs.go index 4f73da10c6eb..6632eef2caf2 100644 --- a/api/jobs.go +++ b/api/jobs.go @@ -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 } @@ -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() {