From 5a9ccffa564667a8959c2f60593aa89d448a116d Mon Sep 17 00:00:00 2001 From: Dmitriy Kalinin Date: Tue, 17 Mar 2020 15:11:38 -0400 Subject: [PATCH] minor formatting --- pkg/kapp/clusterapply/add_or_update_change.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pkg/kapp/clusterapply/add_or_update_change.go b/pkg/kapp/clusterapply/add_or_update_change.go index bbaecd666..9685f5f99 100644 --- a/pkg/kapp/clusterapply/add_or_update_change.go +++ b/pkg/kapp/clusterapply/add_or_update_change.go @@ -49,6 +49,7 @@ func (c AddOrUpdateChange) Apply() error { case ctldiff.ChangeOpUpdate: newRes := c.change.NewResource() + strategy, found := newRes.Annotations()[updateStrategyAnnKey] if !found { strategy = c.opts.DefaultUpdateStrategy @@ -59,7 +60,7 @@ func (c AddOrUpdateChange) Apply() error { updatedRes, err := c.identifiedResources.Update(newRes) if err != nil { if errors.IsConflict(err) { - return c.tryToResolveConflict(err) + return c.tryToResolveUpdateConflict(err) } return err } @@ -121,7 +122,7 @@ func (c AddOrUpdateChange) replace() error { return c.recordAppliedResource(updatedRes) } -func (a AddOrUpdateChange) tryToResolveConflict(origErr error) error { +func (a AddOrUpdateChange) tryToResolveUpdateConflict(origErr error) error { errMsgPrefix := "Failed to update due to resource conflict " for i := 0; i < 10; i++ { @@ -130,7 +131,8 @@ func (a AddOrUpdateChange) tryToResolveConflict(origErr error) error { return err } - changeSet := a.changeSetFactory.New([]ctlres.Resource{latestExistingRes}, []ctlres.Resource{a.change.AppliedResource()}) + changeSet := a.changeSetFactory.New([]ctlres.Resource{latestExistingRes}, + []ctlres.Resource{a.change.AppliedResource()}) recalcChanges, err := changeSet.Calculate() if err != nil {