Skip to content

Commit 6511b20

Browse files
authored
fix: do not emit unexpectedError when getting objs with dynamic client (#382)
1 parent 6f3e972 commit 6511b20

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

pkg/controllers/workapplier/preprocess.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ func (r *Reconciler) removeOneLeftOverManifest(
489489
return nil
490490
case err != nil:
491491
// Failed to retrieve the object from the member cluster.
492-
wrappedErr := controller.NewAPIServerError(true, err)
492+
wrappedErr := controller.NewAPIServerError(false, err) // false as dynamic client is non-caching.
493493
return fmt.Errorf("failed to retrieve the object from the member cluster (gvr=%+v, manifestObj=%+v): %w", gvr, klog.KRef(manifestNamespace, manifestName), wrappedErr)
494494
case inMemberClusterObj.GetDeletionTimestamp() != nil:
495495
// The object has been marked for deletion; no further action is needed.

pkg/controllers/workapplier/process.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ func (r *Reconciler) findInMemberClusterObjectFor(
229229
return false
230230
default:
231231
// An unexpected error has occurred.
232-
wrappedErr := controller.NewAPIServerError(true, err)
232+
wrappedErr := controller.NewAPIServerError(false, err) // false as dynamic client is non-caching.
233233
bundle.applyOrReportDiffErr = fmt.Errorf("failed to find the corresponding object for the manifest object in the member cluster: %w", wrappedErr)
234234
bundle.applyOrReportDiffResTyp = ApplyOrReportDiffResTypeFailedToFindObjInMemberCluster
235235
klog.ErrorS(wrappedErr,

0 commit comments

Comments
 (0)