diff --git a/utils/reconciler.go b/utils/reconciler.go index 8fef3114..9565db01 100644 --- a/utils/reconciler.go +++ b/utils/reconciler.go @@ -168,7 +168,7 @@ func (r *ReconcilerBase) DeleteResources(resources []client.Object) error { // GetOpConfigMap ... func (r *ReconcilerBase) GetOpConfigMap(name string, ns string) (*corev1.ConfigMap, error) { configMap := &corev1.ConfigMap{} - err := r.GetClient().Get(context.TODO(), types.NamespacedName{Name: name, Namespace: ns}, configMap) + err := r.GetAPIReader().Get(context.TODO(), types.NamespacedName{Name: name, Namespace: ns}, configMap) if err != nil { return nil, err } diff --git a/utils/reconciler_test.go b/utils/reconciler_test.go index 5237ac22..5a69ab62 100644 --- a/utils/reconciler_test.go +++ b/utils/reconciler_test.go @@ -264,7 +264,7 @@ func TestGetOpConfigMap(t *testing.T) { objs, s := []runtime.Object{runtimecomponent}, scheme.Scheme s.AddKnownTypes(appstacksv1.GroupVersion, runtimecomponent) cl := fakeclient.NewFakeClient(objs...) - rcl := fakeclient.NewFakeClient(objs...) + rcl := cl r := NewReconcilerBase(rcl, cl, s, &rest.Config{}, record.NewFakeRecorder(10))