Skip to content

Commit 5c4d905

Browse files
fix: handle IsNoMatchError for remediator startWatch (#1734) (#1736)
This error can occur when the RESTMapper fails to look up the object type, and has been observed to happen semi-frequently for the e2e TestCRDDeleteBeforeRemoveCustomResourceV1. The e2e test is flaky because depending on the ordering of events, the conflict metric may not be recorded. This should fix the metric flakiness for this edge case. Co-authored-by: Sam Dowell <[email protected]>
1 parent 5fa0361 commit 5c4d905

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/remediator/watch/filteredwatcher.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ func (w *filteredWatcher) start(ctx context.Context, resourceVersion string) (bo
344344
if err != nil {
345345
if errors.Is(err, context.Canceled) || errors.Is(err, context.DeadlineExceeded) {
346346
return false, status.InternalWrapf(err, "failed to start remediator watch for %s", w.gvk)
347-
} else if apierrors.IsNotFound(err) {
347+
} else if apierrors.IsNotFound(err) || meta.IsNoMatchError(err) {
348348
statusErr := syncerclient.ConflictWatchResourceDoesNotExist(err, w.gvk)
349349
klog.Warningf("Remediator encountered a resource conflict: "+
350350
"%v. To resolve the conflict, the remediator will enqueue a resync "+

0 commit comments

Comments
 (0)