Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(kube): ignore errors.IsConflict on update call #237

Merged
merged 1 commit into from
Aug 4, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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