Skip to content

Commit

Permalink
minor formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
cppforlife committed Mar 17, 2020
1 parent 30f88f5 commit 5a9ccff
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pkg/kapp/clusterapply/add_or_update_change.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
}
Expand Down Expand Up @@ -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++ {
Expand All @@ -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 {
Expand Down

0 comments on commit 5a9ccff

Please sign in to comment.