Skip to content

Commit

Permalink
Fix function deployment failure when deploying with more than 1 contr…
Browse files Browse the repository at this point in the history
…oller pod (#1642)
  • Loading branch information
sahare92 committed Apr 29, 2020
1 parent e99d5e8 commit ad2f7b1
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion pkg/platform/kube/functionres/lazy.go
Original file line number Diff line number Diff line change
Expand Up @@ -420,9 +420,18 @@ func (lc *lazyClient) createOrUpdateResource(resourceName string,
resource, err = createResource()

if err != nil {
return nil, errors.Wrap(err, "Failed to create resource")
if !apierrors.IsAlreadyExists(err) {
return nil, errors.Wrap(err, "Failed to create resource")
}

// this case could happen if several controllers are running in parallel. (may happen on rolling upgrade of the controller)
lc.logger.WarnWith("Got \"resource already exists\" error on creation. Retrying (Perhaps more than 1 controller is running?)",
"name", resourceName,
"err", err.Error())
continue
}

lc.logger.DebugWith("Resource created", "name", resourceName)
return resource, nil
}

Expand Down

0 comments on commit ad2f7b1

Please sign in to comment.