From 5b6b9685e9205c52873398bab537494661330d65 Mon Sep 17 00:00:00 2001 From: Brad Davidson Date: Wed, 18 Oct 2023 16:16:47 +0000 Subject: [PATCH] Manually requeue configmap reconcile when no nodes have reconciled snapshots Silences error message from lasso - this is a normal startup condition when no snapshots exist so we shouldn't log nasty looking errors. Signed-off-by: Brad Davidson --- pkg/etcd/snapshot_controller.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pkg/etcd/snapshot_controller.go b/pkg/etcd/snapshot_controller.go index 7da376741b40..6c04d3569b2c 100644 --- a/pkg/etcd/snapshot_controller.go +++ b/pkg/etcd/snapshot_controller.go @@ -32,6 +32,7 @@ const ( var ( snapshotConfigMapName = version.Program + "-etcd-snapshots" + errNotReconciled = errors.New("no nodes have reconciled ETCDSnapshotFile resources") ) type etcdSnapshotHandler struct { @@ -58,7 +59,13 @@ func registerSnapshotHandlers(ctx context.Context, etcd *ETCD) { func (e *etcdSnapshotHandler) sync(key string, esf *apisv1.ETCDSnapshotFile) (*apisv1.ETCDSnapshotFile, error) { if key == reconcileKey { - return nil, e.reconcile() + err := e.reconcile() + if err == errNotReconciled { + logrus.Debugf("Failed to reconcile snapshot ConfigMap: %v, requeuing", err) + e.snapshots.Enqueue(key) + return nil, nil + } + return nil, err } if esf == nil || !esf.DeletionTimestamp.IsZero() { return nil, nil @@ -190,7 +197,7 @@ func (e *etcdSnapshotHandler) reconcile() error { } if len(syncedNodes) == 0 { - return errors.New("no nodes have reconciled ETCDSnapshotFile resources") + return errNotReconciled } // Get a list of existing snapshots