issuers: Skip triggering API update if status has not changed

This commit is contained in:
James Munnelly
2018-06-18 01:55:45 +01:00
parent 094f5465eb
commit 592bfc7edc
2 changed files with 10 additions and 0 deletions
+5
View File
@@ -2,6 +2,7 @@ package clusterissuers
import (
"context"
"reflect"
"github.com/golang/glog"
"k8s.io/api/core/v1"
@@ -26,6 +27,10 @@ func (c *Controller) Sync(ctx context.Context, iss *v1alpha1.ClusterIssuer) (err
err = i.Setup(ctx)
defer func() {
// TODO: replace this with more efficient comparison?
if reflect.DeepEqual(issuerCopy.Status, iss.Status) {
return
}
if saveErr := c.updateIssuerStatus(issuerCopy); saveErr != nil {
errs := []error{saveErr}
if err != nil {
+5
View File
@@ -2,6 +2,7 @@ package issuers
import (
"context"
"reflect"
"github.com/golang/glog"
"k8s.io/api/core/v1"
@@ -26,6 +27,10 @@ func (c *Controller) Sync(ctx context.Context, iss *v1alpha1.Issuer) (err error)
err = i.Setup(ctx)
defer func() {
// TODO: replace this with more efficient comparison?
if reflect.DeepEqual(issuerCopy.Status, iss.Status) {
return
}
if saveErr := c.updateIssuerStatus(issuerCopy); saveErr != nil {
errs := []error{saveErr}
if err != nil {