Skip to content

Commit 8d3224d

Browse files
authored
Read Object from k8s API directly instead of cache to avoid getting outdated object (#1017)
Signed-off-by: Daniel Fan <[email protected]>
1 parent 0ff537d commit 8d3224d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

controllers/operator/manager.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -689,7 +689,7 @@ func (m *ODLMOperator) GetValueRefFromObject(ctx context.Context, instanceType,
689689
var obj unstructured.Unstructured
690690
obj.SetAPIVersion(objAPIVersion)
691691
obj.SetKind(objKind)
692-
if err := m.Client.Get(ctx, types.NamespacedName{Name: objName, Namespace: objNs}, &obj); err != nil {
692+
if err := m.Reader.Get(ctx, types.NamespacedName{Name: objName, Namespace: objNs}, &obj); err != nil {
693693
if apierrors.IsNotFound(err) {
694694
klog.V(3).Infof("%s %s/%s is not found", objKind, objNs, objName)
695695
return "", nil

0 commit comments

Comments
 (0)