Skip to content

Commit

Permalink
Fix error handling in EtcdMemberReconciler
Browse files Browse the repository at this point in the history
The watch for CRD getting ready used wrong error when checking if it is retriable. This results in bogus logging and a "busyloop":
```
time="2024-05-16 10:05:45" level=info msg="Transient error while watching etcdmember CRD, last observed version is \"\", starting over after 0s ..." component=etcdMemberReconciler error="<nil>"
time="2024-05-16 10:05:45" level=info msg="Transient error while watching etcdmember CRD, last observed version is \"\", starting over after 0s ..." component=etcdMemberReconciler error="<nil>"
time="2024-05-16 10:05:45" level=info msg="Transient error while watching etcdmember CRD, last observed version is \"\", starting over after 0s ..." component=etcdMemberReconciler error="<nil>"
...
```

It actually hides the transient errors encountered.

Signed-off-by: Jussi Nummelin <[email protected]>
  • Loading branch information
jnummelin committed May 17, 2024
1 parent 4141997 commit d67b442
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/component/controller/etcd_member_reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ func (e *EtcdMemberReconciler) waitForCRD(ctx context.Context) error {
log.Info("waiting to see EtcdMember CRD ready")
return watch.FromClient[*crdList, crd](ec.CustomResourceDefinitions()).
WithObjectName(fmt.Sprintf("%s.%s", "etcdmembers", "etcd.k0sproject.io")).
WithErrorCallback(func(cbErr error) (retryDelay time.Duration, err error) {
WithErrorCallback(func(err error) (time.Duration, error) {
if retryAfter, e := watch.IsRetryable(err); e == nil {
log.WithError(err).Infof(
"Transient error while watching etcdmember CRD"+
Expand Down

0 comments on commit d67b442

Please sign in to comment.