Skip to content

Commit

Permalink
Merge pull request #237 from Cryptophobia/master
Browse files Browse the repository at this point in the history
fix(kube): ignore errors.IsConflict on update call
  • Loading branch information
Cryptophobia authored Aug 4, 2021
2 parents 0ce8af8 + f7731df commit 886326e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion config-reloader/datasource/kube_informer.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"sort"
"time"

"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"

"github.com/sirupsen/logrus"
Expand Down Expand Up @@ -122,7 +123,9 @@ func (d *kubeInformerConnection) UpdateStatus(namespace string, status string) {
_, err = d.client.CoreV1().Namespaces().Update(ns)

logrus.Debugf("Saving status annotation to namespace %s: %+v", namespace, err)
if err != nil {
// errors.IsConflict is safe to ignore since multiple log-routers try update at same time
// (only 1 router can update this unique ResourceVersion, no need to retry, each router is a retry process):
if err != nil && !errors.IsConflict(err) {
logrus.Infof("Cannot set error status on namespace %s: %+v", namespace, err)
}
}
Expand Down

0 comments on commit 886326e

Please sign in to comment.