Repository: redhat-developer/service-binding-operator
Pull request #496 (2020-05-27 14:00:20)

Updates ServiceBindingRequestStatus.Applications documentation comment
### Motivation

Updates ServiceBindingRequestStatus.Applications documentation comment to:
[1] remove the word `ApplicationObjects`
[2] specify the `name` filter criteria of applications

openshift-ci-robot: [APPROVALNOTIFIER] This PR is **NOT APPROVED**

This pull-request has been approved by:
To complete the [pull request process](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process), please assign **dhritishikhar**
You can assign the PR to them by writing `/assign @dhritishikhar` in a comment when ready.

The full list of commands accepted by this bot can be found [here](https://go.k8s.io/bot-commands?repo=redhat-developer%2Fservice-binding-operator).

<details open>
Needs approval from an approver in each of these files:

- **[OWNERS](https://github.com/redhat-developer/service-binding-operator/blob/master/OWNERS)**

Approvers can indicate their approval by writing `/approve` in a comment
Approvers can cancel approval by writing `/approve cancel` in a comment
</details>
<!-- META={"approvers":["dhritishikhar"]} -->
DhritiShikhar: @pedjak Sure will update my PR commit message.
codecov[bot]: # [Codecov](https://codecov.io/gh/redhat-developer/service-binding-operator/pull/496?src=pr&el=h1) Report
> Merging [#496](https://codecov.io/gh/redhat-developer/service-binding-operator/pull/496?src=pr&el=desc) into [master](https://codecov.io/gh/redhat-developer/service-binding-operator/commit/790ba8c9adcb4c82aa82effd4ce10da6524b21eb&el=desc) will **not change** coverage.
> The diff coverage is `n/a`.

[![Impacted file tree graph](https://codecov.io/gh/redhat-developer/service-binding-operator/pull/496/graphs/tree.svg?width=650&height=150&src=pr&token=CICBeVWlrC)](https://codecov.io/gh/redhat-developer/service-binding-operator/pull/496?src=pr&el=tree)

```diff
@@           Coverage Diff           @@
##           master     #496   +/-   ##
=======================================
  Coverage   63.07%   63.07%           
=======================================
  Files          27       27           
  Lines        1774     1774           
=======================================
  Hits         1119     1119           
  Misses        489      489           
  Partials      166      166           
```



------

[Continue to review full report at Codecov](https://codecov.io/gh/redhat-developer/service-binding-operator/pull/496?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/redhat-developer/service-binding-operator/pull/496?src=pr&el=footer). Last update [5e46a62...2d4df04](https://codecov.io/gh/redhat-developer/service-binding-operator/pull/496?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

DhritiShikhar: > Please make PR summary and commit 2d4df04 message as concrete as possible. the current message is "update comment" - a reader cannot really know what comment (btw. physically this "code comment", but semantically it is the field description"). The proper message should contain all necessary details.

I updated the PR title, description and commit message -> https://github.com/redhat-developer/service-binding-operator/pull/496/commits

Patch:
diff --git a/pkg/apis/apps/v1alpha1/servicebindingrequest_types.go b/pkg/apis/apps/v1alpha1/servicebindingrequest_types.go
index ce268965..f6887015 100644
--- a/pkg/apis/apps/v1alpha1/servicebindingrequest_types.go
+++ b/pkg/apis/apps/v1alpha1/servicebindingrequest_types.go
@@ -53,7 +53,7 @@ type ServiceBindingRequestStatus struct {
 	Conditions []conditionsv1.Condition `json:"conditions"`
 	// Secret is the name of the intermediate secret
 	Secret string `json:"secret"`
-	// ApplicationObjects contains all the application objects filtered by label
+	// Applications contain all the applications filtered by name or label
 	// +optional
 	Applications []BoundApplication `json:"applications,omitempty"`
 }
diff --git a/pkg/controller/servicebindingrequest/binder.go b/pkg/controller/servicebindingrequest/binder.go
index ae2654ff..3243ac7f 100644
--- a/pkg/controller/servicebindingrequest/binder.go
+++ b/pkg/controller/servicebindingrequest/binder.go
@@ -7,7 +7,7 @@ import (
 	"strings"
 	"time"
 
-	"k8s.io/apimachinery/pkg/fields"
+	"k8s.io/apimachinery/pkg/api/meta"
 	"k8s.io/apimachinery/pkg/labels"
 	"k8s.io/apimachinery/pkg/runtime/schema"
 
@@ -17,9 +17,7 @@ import (
 
 	"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
 	"k8s.io/apimachinery/pkg/runtime"
-	"k8s.io/apimachinery/pkg/types"
 	"k8s.io/client-go/dynamic"
-	"sigs.k8s.io/controller-runtime/pkg/client"
 
 	"github.com/redhat-developer/service-binding-operator/pkg/apis/apps/v1alpha1"
 	"github.com/redhat-developer/service-binding-operator/pkg/log"
@@ -40,11 +38,11 @@ const ChangeTriggerEnv = "ServiceBindingOperatorChangeTriggerEnvVar"
 // secret. Those secrets should be offered as environment variables.
 type Binder struct {
 	ctx        context.Context                 // request context
-	client     client.Client                   // kubernetes API client
 	dynClient  dynamic.Interface               // kubernetes dynamic api client
 	sbr        *v1alpha1.ServiceBindingRequest // instantiated service binding request
 	volumeKeys []string                        // list of key names used in volume mounts
 	modifier   ExtraFieldsModifier             // extra modifier for CRDs before updating
+	restMapper meta.RESTMapper                 // RESTMapper to convert GVR from GVK
 	logger     *log.Log                        // logger instance
 }
 
@@ -68,38 +66,45 @@ var ApplicationNotFound = errors.New("Application is already deleted")
 
 // search objects based in Kind/APIVersion, which contain the labels defined in ApplicationSelector.
 func (b *Binder) search() (*unstructured.UnstructuredList, error) {
-	ns := b.sbr.GetNamespace()
-	gvr := schema.GroupVersionResource{
-		Group:    b.sbr.Spec.ApplicationSelector.GroupVersionResource.Group,
-		Version:  b.sbr.Spec.ApplicationSelector.GroupVersionResource.Version,
-		Resource: b.sbr.Spec.ApplicationSelector.GroupVersionResource.Resource,
-	}
-
-	var opts metav1.ListOptions
-
 	// If Application name is present
 	if b.sbr.Spec.ApplicationSelector.ResourceRef != "" {
-		fieldName := make(map[string]string)
-		fieldName["metadata.name"] = b.sbr.Spec.ApplicationSelector.ResourceRef
-		opts = metav1.ListOptions{
-			FieldSelector: fields.Set(fieldName).String(),
-		}
+		return b.getApplicationByName()
 	} else if b.sbr.Spec.ApplicationSelector.LabelSelector != nil {
-		matchLabels := b.sbr.Spec.ApplicationSelector.LabelSelector.MatchLabels
-		opts = metav1.ListOptions{
-			LabelSelector: labels.Set(matchLabels).String(),
-		}
+		return b.getApplicationByLabelSelector()
 	} else {
 		return nil, EmptyApplicationSelectorErr
 	}
+}
 
-	objList, err := b.dynClient.Resource(gvr).Namespace(ns).List(opts)
+func (b *Binder) getApplicationByName() (*unstructured.UnstructuredList, error) {
+	ns := b.sbr.GetNamespace()
+	gvr := schema.GroupVersionResource{
+		Group:    b.sbr.Spec.ApplicationSelector.GroupVersionResource.Group,
+		Version:  b.sbr.Spec.ApplicationSelector.GroupVersionResource.Version,
+		Resource: b.sbr.Spec.ApplicationSelector.GroupVersionResource.Resource,
+	}
+	object, err := b.dynClient.Resource(gvr).Namespace(ns).
+		Get(b.sbr.Spec.ApplicationSelector.ResourceRef, metav1.GetOptions{})
 	if err != nil {
-		return nil, ApplicationNotFound
-
+		return nil, err
 	}
 
-	return objList, err
+	objList := &unstructured.UnstructuredList{Items: []unstructured.Unstructured{*object}}
+	return objList, nil
+}
+
+func (b *Binder) getApplicationByLabelSelector() (*unstructured.UnstructuredList, error) {
+	ns := b.sbr.GetNamespace()
+	gvr := schema.GroupVersionResource{
+		Group:    b.sbr.Spec.ApplicationSelector.GroupVersionResource.Group,
+		Version:  b.sbr.Spec.ApplicationSelector.GroupVersionResource.Version,
+		Resource: b.sbr.Spec.ApplicationSelector.GroupVersionResource.Resource,
+	}
+	matchLabels := b.sbr.Spec.ApplicationSelector.LabelSelector.MatchLabels
+	opts := metav1.ListOptions{
+		LabelSelector: labels.Set(matchLabels).String(),
+	}
+	return b.dynClient.Resource(gvr).Namespace(ns).List(opts)
 }
 
 // extractSpecVolumes based on volume path, extract it unstructured. It can return error on trying
@@ -469,24 +474,24 @@ func (b *Binder) update(objs *unstructured.UnstructuredList) ([]*unstructured.Un
 	updatedObjs := []*unstructured.Unstructured{}
 
 	for _, obj := range objs.Items {
-		// store a copy of the original object to later be used in a comparison
-		originalObj := obj.DeepCopy()
+		// modify the copy of the original object and use the original one later for comparison
+		updatedObj := obj.DeepCopy()
 		name := obj.GetName()
 		log := b.logger.WithValues("Obj.Name", name, "Obj.Kind", obj.GetKind())
 		log.Debug("Inspecting object...")
 
-		updatedObj, err := b.updateSpecContainers(&obj)
+		updatedObj, err := b.updateSpecContainers(updatedObj)
 		if err != nil {
 			return nil, err
 		}
 
 		if len(b.volumeKeys) > 0 {
-			if updatedObj, err = b.updateSpecVolumes(&obj); err != nil {
+			if updatedObj, err = b.updateSpecVolumes(updatedObj); err != nil {
 				return nil, err
 			}
 		}
 
-		if specsAreEqual, err := nestedMapComparison(originalObj, updatedObj, "spec"); err != nil {
+		if specsAreEqual, err := nestedMapComparison(&obj, updatedObj, "spec"); err != nil {
 			log.Error(err, "")
 			continue
 		} else if specsAreEqual {
@@ -501,21 +506,20 @@ func (b *Binder) update(objs *unstructured.UnstructuredList) ([]*unstructured.Un
 		}
 
 		log.Debug("Updating object...")
-		if err := b.client.Update(b.ctx, updatedObj); err != nil {
+		gk := updatedObj.GroupVersionKind().GroupKind()
+		version := updatedObj.GroupVersionKind().Version
+		mapping, err := b.restMapper.RESTMapping(gk, version)
+		if err != nil {
 			return nil, err
 		}
+		updated, err := b.dynClient.Resource(mapping.Resource).
+			Namespace(updatedObj.GetNamespace()).
+			Update(updatedObj, metav1.UpdateOptions{})
 
-		log.Debug("Reading back updated object...")
-		// reading object back again, to comply with possible modifications
-		namespacedName := types.NamespacedName{
-			Namespace: updatedObj.GetNamespace(),
-			Name:      updatedObj.GetName(),
-		}
-		if err = b.client.Get(b.ctx, namespacedName, updatedObj); err != nil {
+		if err != nil {
 			return nil, err
 		}
-
-		updatedObjs = append(updatedObjs, updatedObj)
+		updatedObjs = append(updatedObjs, updated)
 	}
 
 	return updatedObjs, nil
@@ -527,22 +531,31 @@ func (b *Binder) remove(objs *unstructured.UnstructuredList) error {
 		name := obj.GetName()
 		logger := b.logger.WithValues("Obj.Name", name, "Obj.Kind", obj.GetKind())
 		logger.Debug("Inspecting object...")
-
 		updatedObj, err := b.removeSpecContainers(&obj)
 		if err != nil {
 			return err
 		}
-
 		if len(b.volumeKeys) > 0 {
-			if updatedObj, err = b.removeSpecVolumes(&obj); err != nil {
+			if updatedObj, err = b.removeSpecVolumes(updatedObj); err != nil {
 				return err
 			}
 		}
 
-		logger.Debug("Updating object...")
-		if err = b.client.Update(b.ctx, updatedObj); err != nil {
+		gk := updatedObj.GroupVersionKind().GroupKind()
+		version := updatedObj.GroupVersionKind().Version
+		mapping, err := b.restMapper.RESTMapping(gk, version)
+		if err != nil {
+			return err
+		}
+
+		_, err = b.dynClient.Resource(mapping.Resource).
+			Namespace(updatedObj.GetNamespace()).
+			Update(updatedObj, metav1.UpdateOptions{})
+
+		if err != nil {
 			return err
 		}
+
 	}
 	return nil
 }
@@ -575,10 +588,10 @@ func (b *Binder) Bind() ([]*unstructured.Unstructured, error) {
 // NewBinder returns a new Binder instance.
 func NewBinder(
 	ctx context.Context,
-	client client.Client,
 	dynClient dynamic.Interface,
 	sbr *v1alpha1.ServiceBindingRequest,
 	volumeKeys []string,
+	restMapper meta.RESTMapper,
 ) *Binder {
 
 	logger := log.NewLog("binder")
@@ -586,11 +599,11 @@ func NewBinder(
 
 	return &Binder{
 		ctx:        ctx,
-		client:     client,
 		dynClient:  dynClient,
 		sbr:        sbr,
 		volumeKeys: volumeKeys,
 		modifier:   modifier,
+		restMapper: restMapper,
 		logger:     logger,
 	}
 }
diff --git a/pkg/controller/servicebindingrequest/controller.go b/pkg/controller/servicebindingrequest/controller.go
index bd5217f1..f3f9f6b5 100644
--- a/pkg/controller/servicebindingrequest/controller.go
+++ b/pkg/controller/servicebindingrequest/controller.go
@@ -24,7 +24,6 @@ func Add(mgr manager.Manager) error {
 // newReconciler returns a new reconcile.Reconciler
 func newReconciler(mgr manager.Manager, client dynamic.Interface) (reconcile.Reconciler, error) {
 	return &Reconciler{
-		client:     mgr.GetClient(),
 		dynClient:  client,
 		scheme:     mgr.GetScheme(),
 		RestMapper: mgr.GetRESTMapper(),
diff --git a/pkg/controller/servicebindingrequest/reconciler.go b/pkg/controller/servicebindingrequest/reconciler.go
index 2467b261..3e3ced7a 100644
--- a/pkg/controller/servicebindingrequest/reconciler.go
+++ b/pkg/controller/servicebindingrequest/reconciler.go
@@ -11,7 +11,6 @@ import (
 	"k8s.io/apimachinery/pkg/runtime"
 	"k8s.io/apimachinery/pkg/types"
 	"k8s.io/client-go/dynamic"
-	"sigs.k8s.io/controller-runtime/pkg/client"
 	"sigs.k8s.io/controller-runtime/pkg/reconcile"
 
 	"github.com/redhat-developer/service-binding-operator/pkg/apis/apps/v1alpha1"
@@ -28,7 +27,6 @@ const (
 
 // Reconciler reconciles a ServiceBindingRequest object
 type Reconciler struct {
-	client     client.Client     // kubernetes api client
 	dynClient  dynamic.Interface // kubernetes dynamic api client
 	scheme     *runtime.Scheme   // api scheme
 	RestMapper meta.RESTMapper   // restMapper to convert GVK and GVR
@@ -171,13 +169,13 @@ func (r *Reconciler) Reconcile(request reconcile.Request) (reconcile.Result, err
 	}
 
 	options := &ServiceBinderOptions{
-		Client:                 r.client,
 		DynClient:              r.dynClient,
 		DetectBindingResources: sbr.Spec.DetectBindingResources,
 		SBR:                    sbr,
 		Logger:                 logger,
 		Objects:                serviceCtxs.GetServices(),
 		Binding:                binding,
+		RESTMapper:             r.RestMapper,
 	}
 
 	sb, err := BuildServiceBinder(ctx, options)
diff --git a/pkg/controller/servicebindingrequest/servicebinder.go b/pkg/controller/servicebindingrequest/servicebinder.go
index 5c07a2fd..694072d3 100644
--- a/pkg/controller/servicebindingrequest/servicebinder.go
+++ b/pkg/controller/servicebindingrequest/servicebinder.go
@@ -7,12 +7,12 @@ import (
 	conditionsv1 "github.com/openshift/custom-resource-status/conditions/v1"
 	"gotest.tools/assert/cmp"
 	corev1 "k8s.io/api/core/v1"
+	"k8s.io/apimachinery/pkg/api/meta"
 	v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
 	"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
 	"k8s.io/apimachinery/pkg/runtime"
 	"k8s.io/apimachinery/pkg/types"
 	"k8s.io/client-go/dynamic"
-	"sigs.k8s.io/controller-runtime/pkg/client"
 	"sigs.k8s.io/controller-runtime/pkg/reconcile"
 
 	"github.com/redhat-developer/service-binding-operator/pkg/apis/apps/v1alpha1"
@@ -45,11 +45,11 @@ type ServiceBinderOptions struct {
 	DynClient              dynamic.Interface
 	DetectBindingResources bool
 	SBR                    *v1alpha1.ServiceBindingRequest
-	Client                 client.Client
 	Objects                []*unstructured.Unstructured
 	EnvVars                map[string][]byte
 	EnvVarPrefix           string
 	Binding                *Binding
+	RESTMapper             meta.RESTMapper
 }
 
 // ErrInvalidServiceBinderOptions is returned when ServiceBinderOptions contains an invalid value.
@@ -69,14 +69,14 @@ func (o *ServiceBinderOptions) Valid() error {
 		return ErrInvalidServiceBinderOptions("DynClient")
 	}
 
-	if o.Client == nil {
-		return ErrInvalidServiceBinderOptions("Client")
-	}
-
 	if o.Binding == nil {
 		return ErrInvalidServiceBinderOptions("Binding")
 	}
 
+	if o.RESTMapper == nil {
+		return ErrInvalidServiceBinderOptions("RESTMapper")
+	}
+
 	return nil
 }
 
@@ -339,10 +339,10 @@ func BuildServiceBinder(
 	// consider renaming to ResourceBinder
 	binder := NewBinder(
 		ctx,
-		options.Client,
 		options.DynClient,
 		options.SBR,
 		options.Binding.VolumeKeys,
+		options.RESTMapper,
 	)
 
 	return &ServiceBinder{


Test patch:
diff --git a/pkg/controller/servicebindingrequest/binder_test.go b/pkg/controller/servicebindingrequest/binder_test.go
index 4b0fa6d5..19bc7ca1 100644
--- a/pkg/controller/servicebindingrequest/binder_test.go
+++ b/pkg/controller/servicebindingrequest/binder_test.go
@@ -15,6 +15,7 @@ import (
 	logf "sigs.k8s.io/controller-runtime/pkg/runtime/log"
 
 	"github.com/redhat-developer/service-binding-operator/pkg/converter"
+	"github.com/redhat-developer/service-binding-operator/pkg/testutils"
 	"github.com/redhat-developer/service-binding-operator/test/mocks"
 )
 
@@ -43,16 +44,6 @@ func TestBinderNew(t *testing.T) {
 	sbr := f.AddMockedServiceBindingRequest(name, nil, "ref", "", deploymentsGVR, matchLabels)
 	f.AddMockedUnstructuredDeployment("ref", matchLabels)
 
-	binder := NewBinder(
-		context.TODO(),
-		f.FakeClient(),
-		f.FakeDynClient(),
-		sbr,
-		[]string{},
-	)
-
-	require.NotNil(t, binder)
-
 	sbrWithResourceRef := f.AddMockedServiceBindingRequest(
 		"service-binding-request-with-ref",
 		nil,
@@ -62,29 +53,46 @@ func TestBinderNew(t *testing.T) {
 		map[string]string{},
 	)
 
-	binderForSBRWithResourceRef := NewBinder(
-		context.TODO(),
-		f.FakeClient(),
-		f.FakeDynClient(),
-		sbrWithResourceRef,
-		[]string{},
-	)
-
-	require.NotNil(t, binderForSBRWithResourceRef)
-
 	t.Run("search-using-resourceref", func(t *testing.T) {
+		binderForSBRWithResourceRef := NewBinder(
+			context.TODO(),
+			f.FakeDynClient(),
+			sbrWithResourceRef,
+			[]string{},
+			testutils.BuildTestRESTMapper(),
+		)
+
+		require.NotNil(t, binderForSBRWithResourceRef)
 		list, err := binderForSBRWithResourceRef.search()
 		require.NoError(t, err)
 		require.Equal(t, 1, len(list.Items))
 	})
 
 	t.Run("search", func(t *testing.T) {
+		binder := NewBinder(
+			context.TODO(),
+			f.FakeDynClient(),
+			sbr,
+			[]string{},
+			testutils.BuildTestRESTMapper(),
+		)
+
+		require.NotNil(t, binder)
 		list, err := binder.search()
 		require.NoError(t, err)
 		require.Equal(t, 1, len(list.Items))
 	})
 
 	t.Run("appendEnvFrom-removeEnvFrom", func(t *testing.T) {
+		binder := NewBinder(
+			context.TODO(),
+			f.FakeDynClient(),
+			sbr,
+			[]string{},
+			testutils.BuildTestRESTMapper(),
+		)
+
+		require.NotNil(t, binder)
 		secretName := "secret"
 		d := mocks.DeploymentMock("binder", "binder", map[string]string{})
 		envFrom := d.Spec.Template.Spec.Containers[0].EnvFrom
@@ -98,6 +106,16 @@ func TestBinderNew(t *testing.T) {
 	})
 
 	t.Run("appendEnv", func(t *testing.T) {
+
+		binder := NewBinder(
+			context.TODO(),
+			f.FakeDynClient(),
+			sbr,
+			[]string{},
+			testutils.BuildTestRESTMapper(),
+		)
+
+		require.NotNil(t, binder)
 		d := mocks.DeploymentMock("binder", "binder", map[string]string{})
 		list := binder.appendEnvVar(d.Spec.Template.Spec.Containers[0].Env, "name", "value")
 		require.Equal(t, 1, len(list))
@@ -106,6 +124,16 @@ func TestBinderNew(t *testing.T) {
 	})
 
 	t.Run("update", func(t *testing.T) {
+
+		binder := NewBinder(
+			context.TODO(),
+			f.FakeDynClient(),
+			sbr,
+			[]string{},
+			testutils.BuildTestRESTMapper(),
+		)
+
+		require.NotNil(t, binder)
 		list, err := binder.search()
 		require.NoError(t, err)
 		require.Equal(t, 1, len(list.Items))
@@ -114,7 +142,7 @@ func TestBinderNew(t *testing.T) {
 		require.NoError(t, err)
 		require.Len(t, updatedObjects, 1)
 
-		containers, found, err := unstructured.NestedSlice(list.Items[0].Object, containersPath...)
+		containers, found, err := unstructured.NestedSlice(updatedObjects[0].Object, containersPath...)
 		require.NoError(t, err)
 		require.True(t, found)
 		require.Len(t, containers, 1)
@@ -134,6 +162,16 @@ func TestBinderNew(t *testing.T) {
 		require.NoError(t, err)
 		require.True(t, parsedTime.Before(time.Now()))
 
+	})
+
+	t.Run("update with extra modifier present", func(t *testing.T) {
+		binder := NewBinder(
+			context.TODO(),
+			f.FakeDynClient(),
+			sbr,
+			[]string{},
+			testutils.BuildTestRESTMapper(),
+		)
 		// test binder with extra modifier present
 		ch := make(chan struct{})
 		binder.modifier = ExtraFieldsModifierFunc(func(u *unstructured.Unstructured) error {
@@ -141,23 +179,34 @@ func TestBinderNew(t *testing.T) {
 			return nil
 		})
 
-		list, err = binder.search()
+		list, err := binder.search()
 		require.NoError(t, err)
 		require.Equal(t, 1, len(list.Items))
 
-		updatedObjects, err = binder.update(list)
+		updatedObjects, err := binder.update(list)
 		require.NoError(t, err)
 		require.Len(t, updatedObjects, 1)
 		<-ch
 
+		list, err = binder.search()
+		require.NoError(t, err)
 		// call another update as object is already updated, modifier func should not be called
 		updatedObjects, err = binder.update(list)
 		require.NoError(t, err)
 		require.Len(t, updatedObjects, 0)
-		binder.modifier = nil
 	})
 
 	t.Run("remove", func(t *testing.T) {
+
+		binder := NewBinder(
+			context.TODO(),
+			f.FakeDynClient(),
+			sbr,
+			[]string{},
+			testutils.BuildTestRESTMapper(),
+		)
+
+		require.NotNil(t, binder)
 		list, err := binder.search()
 		require.NoError(t, err)
 		require.Equal(t, 1, len(list.Items))
@@ -169,6 +218,8 @@ func TestBinderNew(t *testing.T) {
 		err = binder.remove(list)
 		require.NoError(t, err)
 
+		list, err = binder.search()
+		require.NoError(t, err)
 		containers, found, err := unstructured.NestedSlice(list.Items[0].Object, containersPath...)
 		require.NoError(t, err)
 		require.True(t, found)
@@ -210,14 +261,14 @@ func TestBinderApplicationName(t *testing.T) {
 	name := "service-binding-request"
 	f := mocks.NewFake(t, ns)
 	sbr := f.AddMockedServiceBindingRequest(name, nil, "backingServiceResourceRef", "applicationResourceRef", deploymentsGVR, nil)
-	f.AddMockedUnstructuredDeployment("ref", nil)
+	f.AddMockedUnstructuredDeployment("applicationResourceRef", nil)
 
 	binder := NewBinder(
 		context.TODO(),
-		f.FakeClient(),
 		f.FakeDynClient(),
 		sbr,
 		[]string{},
+		testutils.BuildTestRESTMapper(),
 	)
 
 	require.NotNil(t, binder)
@@ -234,14 +285,14 @@ func TestBindingWithDeploymentConfig(t *testing.T) {
 	name := "service-binding-request"
 	f := mocks.NewFake(t, ns)
 	sbr := f.AddMockedServiceBindingRequest(name, nil, "backingServiceResourceRef", "applicationResourceRef", deploymentConfigsGVR, nil)
-	f.AddMockedUnstructuredDeploymentConfig("ref", nil)
+	f.AddMockedUnstructuredDeploymentConfig("applicationResourceRef", nil)
 
 	binder := NewBinder(
 		context.TODO(),
-		f.FakeClient(),
 		f.FakeDynClient(),
 		sbr,
 		[]string{},
+		testutils.BuildTestRESTMapper(),
 	)
 
 	require.NotNil(t, binder)
@@ -268,10 +319,10 @@ func TestBindTwoApplications(t *testing.T) {
 	sbr1 := f.AddMockedServiceBindingRequest(name1, nil, "backingServiceResourceRef", "", deploymentsGVR, matchLabels1)
 	binder1 := NewBinder(
 		context.TODO(),
-		f.FakeClient(),
 		f.FakeDynClient(),
 		sbr1,
 		[]string{},
+		testutils.BuildTestRESTMapper(),
 	)
 	require.NotNil(t, binder1)
 
@@ -284,10 +335,10 @@ func TestBindTwoApplications(t *testing.T) {
 	sbr2 := f.AddMockedServiceBindingRequest(name2, nil, "backingServiceResourceRef", "", deploymentsGVR, matchLabels2)
 	binder2 := NewBinder(
 		context.TODO(),
-		f.FakeClient(),
 		f.FakeDynClient(),
 		sbr2,
 		[]string{},
+		testutils.BuildTestRESTMapper(),
 	)
 	require.NotNil(t, binder2)
 
@@ -317,10 +368,10 @@ func TestKnativeServicesContractWithBinder(t *testing.T) {
 
 	binder := NewBinder(
 		context.TODO(),
-		f.FakeClient(),
 		f.FakeDynClient(),
 		sbr,
 		[]string{},
+		testutils.BuildTestRESTMapper(),
 	)
 
 	require.NotNil(t, binder)
@@ -351,10 +402,10 @@ func Test_extraFieldsModifier(t *testing.T) {
 	sbr := mocks.ServiceBindingRequestMock(ns, name, nil, "", deploy.Name, deploymentsGVR, matchLabels)
 	binder := NewBinder(
 		context.TODO(),
-		f.FakeClient(),
 		f.FakeDynClient(),
 		sbr,
 		[]string{},
+		testutils.BuildTestRESTMapper(),
 	)
 
 	require.NotNil(t, binder)
@@ -366,10 +417,10 @@ func Test_extraFieldsModifier(t *testing.T) {
 
 	binder = NewBinder(
 		context.TODO(),
-		f.FakeClient(),
 		f.FakeDynClient(),
 		sbr,
 		[]string{},
+		testutils.BuildTestRESTMapper(),
 	)
 
 	require.NotNil(t, binder)
diff --git a/pkg/controller/servicebindingrequest/reconciler_test.go b/pkg/controller/servicebindingrequest/reconciler_test.go
index ba06e2cb..cfde0f09 100644
--- a/pkg/controller/servicebindingrequest/reconciler_test.go
+++ b/pkg/controller/servicebindingrequest/reconciler_test.go
@@ -1,16 +1,19 @@
 package servicebindingrequest
 
 import (
-	"context"
 	"reflect"
 	"testing"
+	"time"
 
 	"github.com/redhat-developer/service-binding-operator/pkg/apis/apps/v1alpha1"
 	"github.com/redhat-developer/service-binding-operator/pkg/testutils"
 	"github.com/stretchr/testify/require"
 	appsv1 "k8s.io/api/apps/v1"
 	corev1 "k8s.io/api/core/v1"
+	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
 	v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+	"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
+	"k8s.io/apimachinery/pkg/runtime"
 	"k8s.io/apimachinery/pkg/runtime/schema"
 	"k8s.io/apimachinery/pkg/types"
 	"sigs.k8s.io/controller-runtime/pkg/reconcile"
@@ -27,6 +30,7 @@ const (
 )
 
 var (
+	secretsGVR           = schema.GroupVersionResource{Group: "", Version: "v1", Resource: "secrets"}
 	deploymentsGVR       = schema.GroupVersionResource{Group: "apps", Version: "v1", Resource: "deployments"}
 	deploymentConfigsGVR = schema.GroupVersionResource{Group: "apps", Version: "v1", Resource: "deploymentconfigs"}
 )
@@ -54,19 +58,11 @@ func TestApplicationSelectorByName(t *testing.T) {
 	f.AddMockedUnstructuredCSV("cluster-service-version-list")
 	f.AddMockedUnstructuredDatabaseCRD()
 	f.AddMockedUnstructuredDatabaseCR(backingServiceResourceRef)
-	f.AddMockedUnstructuredDeployment(reconcilerName, nil)
+	f.AddMockedUnstructuredDeployment(applicationResourceRef, nil)
 	f.AddMockedUnstructuredSecret("db-credentials")
 
-	restMapper := testutils.BuildTestRESTMapper()
-
-	fakeClient := f.FakeClient()
 	fakeDynClient := f.FakeDynClient()
-	reconciler := &Reconciler{
-		RestMapper: restMapper,
-		client:     fakeClient,
-		dynClient:  fakeDynClient,
-		scheme:     f.S,
-	}
+	reconciler := &Reconciler{dynClient: fakeDynClient, RestMapper: testutils.BuildTestRESTMapper(), scheme: f.S}
 
 	t.Run("test-application-selector-by-name", func(t *testing.T) {
 
@@ -88,7 +84,7 @@ func TestApplicationSelectorByName(t *testing.T) {
 				Kind:    "Deployment",
 			},
 			LocalObjectReference: corev1.LocalObjectReference{
-				Name: namespacedName.Name,
+				Name: applicationResourceRef,
 			},
 		}
 		require.True(t, reflect.DeepEqual(expectedStatus, sbrOutput.Status.Applications[0]))
@@ -98,30 +94,21 @@ func TestApplicationSelectorByName(t *testing.T) {
 // TestReconcilerReconcileUsingSecret test the reconciliation process using a secret, expected to be
 // the regular approach.
 func TestReconcilerReconcileUsingSecret(t *testing.T) {
-	ctx := context.TODO()
 	backingServiceResourceRef := "test-using-secret"
 	matchLabels := map[string]string{
 		"connects-to": "database",
 		"environment": "reconciler",
 	}
 	f := mocks.NewFake(t, reconcilerNs)
-	f.AddMockedUnstructuredServiceBindingRequest(reconcilerName, backingServiceResourceRef, "", deploymentsGVR, matchLabels)
+	f.AddMockedUnstructuredServiceBindingRequest(reconcilerName, backingServiceResourceRef, reconcilerName, deploymentsGVR, matchLabels)
 	f.AddMockedUnstructuredCSV("cluster-service-version-list")
 	f.AddMockedUnstructuredDatabaseCRD()
 	f.AddMockedUnstructuredDatabaseCR(backingServiceResourceRef)
 	f.AddMockedUnstructuredDeployment(reconcilerName, matchLabels)
 	f.AddMockedUnstructuredSecret("db-credentials")
 
-	restMapper := testutils.BuildTestRESTMapper()
-
-	fakeClient := f.FakeClient()
 	fakeDynClient := f.FakeDynClient()
-	reconciler := &Reconciler{
-		RestMapper: restMapper,
-		client:     fakeClient,
-		dynClient:  fakeDynClient,
-		scheme:     f.S,
-	}
+	reconciler := &Reconciler{dynClient: fakeDynClient, RestMapper: testutils.BuildTestRESTMapper(), scheme: f.S}
 
 	t.Run("reconcile-using-secret", func(t *testing.T) {
 		res, err := reconciler.Reconcile(reconcileRequest())
@@ -129,8 +116,13 @@ func TestReconcilerReconcileUsingSecret(t *testing.T) {
 		require.False(t, res.Requeue)
 
 		namespacedName := types.NamespacedName{Namespace: reconcilerNs, Name: reconcilerName}
+
+		u, err := fakeDynClient.Resource(deploymentsGVR).Get(reconcilerName, metav1.GetOptions{})
+		require.NoError(t, err)
+
 		d := appsv1.Deployment{}
-		require.NoError(t, fakeClient.Get(ctx, namespacedName, &d))
+		err = runtime.DefaultUnstructuredConverter.FromUnstructured(u.Object, &d)
+		require.NoError(t, err)
 
 		containers := d.Spec.Template.Spec.Containers
 		require.Equal(t, 1, len(containers))
@@ -162,41 +154,35 @@ func TestReconcilerReconcileUsingSecret(t *testing.T) {
 }
 
 func TestReconcilerReconcileUsingVolumes(t *testing.T) {
-	ctx := context.TODO()
 	backingServiceResourceRef := "test-using-volumes"
 	matchLabels := map[string]string{
 		"connects-to": "database",
 		"environment": "reconciler",
 	}
 	f := mocks.NewFake(t, reconcilerNs)
-	f.AddMockedUnstructuredServiceBindingRequest(reconcilerName, backingServiceResourceRef, "", deploymentsGVR, matchLabels)
+	f.AddMockedUnstructuredServiceBindingRequest(reconcilerName, backingServiceResourceRef, reconcilerName, deploymentsGVR, matchLabels)
 	f.AddMockedUnstructuredCSVWithVolumeMount("cluster-service-version-list")
 	f.AddMockedUnstructuredDatabaseCRD()
 	f.AddMockedUnstructuredDatabaseCR(backingServiceResourceRef)
 	f.AddMockedUnstructuredDeployment(reconcilerName, matchLabels)
 	f.AddMockedUnstructuredSecret("db-credentials")
 
-	restMapper := testutils.BuildTestRESTMapper()
-
-	fakeClient := f.FakeClient()
-	reconciler := &Reconciler{
-		RestMapper: restMapper,
-		client:     fakeClient,
-		dynClient:  f.FakeDynClient(),
-		scheme:     f.S,
-	}
+	fakeDynClient := f.FakeDynClient()
+	reconciler := &Reconciler{dynClient: fakeDynClient, RestMapper: testutils.BuildTestRESTMapper(), scheme: f.S}
 
 	t.Run("reconcile-using-volume", func(t *testing.T) {
 		res, err := reconciler.Reconcile(reconcileRequest())
 		require.NoError(t, err)
 		require.False(t, res.Requeue)
 
-		namespacedName := types.NamespacedName{Namespace: reconcilerNs, Name: reconcilerName}
+		u, err := fakeDynClient.Resource(deploymentsGVR).Get(reconcilerName, metav1.GetOptions{})
+		require.NoError(t, err)
+
 		d := appsv1.Deployment{}
-		require.NoError(t, fakeClient.Get(ctx, namespacedName, &d))
+		err = runtime.DefaultUnstructuredConverter.FromUnstructured(u.Object, &d)
+		require.NoError(t, err)
 
 		containers := d.Spec.Template.Spec.Containers
-
 		require.Equal(t, 1, len(containers[0].VolumeMounts))
 		require.Equal(t, "/var/redhat", containers[0].VolumeMounts[0].MountPath)
 		require.Equal(t, reconcilerName, containers[0].VolumeMounts[0].Name)
@@ -209,7 +195,6 @@ func TestReconcilerReconcileUsingVolumes(t *testing.T) {
 }
 
 func TestReconcilerGenericBinding(t *testing.T) {
-	ctx := context.TODO()
 	backingServiceResourceRef := "backingService1"
 	matchLabels := map[string]string{
 		"connects-to": "database",
@@ -222,15 +207,8 @@ func TestReconcilerGenericBinding(t *testing.T) {
 	f.AddMockedUnstructuredDatabaseCR(backingServiceResourceRef)
 	f.AddMockedUnstructuredSecret("db-credentials")
 
-	restMapper := testutils.BuildTestRESTMapper()
-
-	fakeClient := f.FakeClient()
-	reconciler := &Reconciler{
-		RestMapper: restMapper,
-		client:     fakeClient,
-		dynClient:  f.FakeDynClient(),
-		scheme:     f.S,
-	}
+	fakeDynClient := f.FakeDynClient()
+	reconciler := &Reconciler{dynClient: fakeDynClient, RestMapper: testutils.BuildTestRESTMapper(), scheme: f.S}
 
 	// Reconcile without deployment
 	res, err := reconciler.Reconcile(reconcileRequest())
@@ -254,20 +232,18 @@ func TestReconcilerGenericBinding(t *testing.T) {
 
 	// Reconcile with deployment
 	f.AddMockedUnstructuredDeployment(reconcilerName, matchLabels)
-
-	fakeClient = f.FakeClient()
-	reconciler = &Reconciler{
-		RestMapper: restMapper,
-		client:     fakeClient,
-		dynClient:  f.FakeDynClient(),
-		scheme:     f.S,
-	}
+	fakeDynClient = f.FakeDynClient()
+	reconciler = &Reconciler{dynClient: fakeDynClient, RestMapper: testutils.BuildTestRESTMapper(), scheme: f.S}
 	res, err = reconciler.Reconcile(reconcileRequest())
 	require.NoError(t, err)
 	require.False(t, res.Requeue)
 
+	u, err := fakeDynClient.Resource(deploymentsGVR).Get(reconcilerName, metav1.GetOptions{})
+	require.NoError(t, err)
+
 	d := appsv1.Deployment{}
-	require.NoError(t, fakeClient.Get(ctx, namespacedName, &d))
+	err = runtime.DefaultUnstructuredConverter.FromUnstructured(u.Object, &d)
+	require.NoError(t, err)
 
 	sbrOutput2, err := reconciler.getServiceBindingRequest(namespacedName)
 	require.NoError(t, err)
@@ -277,30 +253,27 @@ func TestReconcilerGenericBinding(t *testing.T) {
 	require.Equal(t, reconcilerName, sbrOutput2.Status.Secret)
 	require.Equal(t, 1, len(sbrOutput2.Status.Applications))
 
-	// Update Credentials
+	u, err = fakeDynClient.Resource(secretsGVR).Get("db-credentials", metav1.GetOptions{})
+	require.NoError(t, err)
 	s := corev1.Secret{}
-	secretNamespaced := types.NamespacedName{Namespace: reconcilerNs, Name: "db-credentials"}
-	require.NoError(t, fakeClient.Get(ctx, secretNamespaced, &s))
-	s.Data["password"] = []byte("abc123")
-	require.NoError(t, fakeClient.Update(ctx, &s))
-
-	reconciler = &Reconciler{
-		RestMapper: restMapper,
-		client:     fakeClient,
-		dynClient:  f.FakeDynClient(),
-		scheme:     f.S,
-	}
+	err = runtime.DefaultUnstructuredConverter.FromUnstructured(u.Object, &s)
+	require.NoError(t, err)
 
+	// Update Credentials
+	s.Data["password"] = []byte("abc123")
+	obj, err := runtime.DefaultUnstructuredConverter.ToUnstructured(&s)
+	require.NoError(t, err)
+	updated := unstructured.Unstructured{Object: obj}
+	_, err = fakeDynClient.Resource(secretsGVR).Namespace(updated.GetNamespace()).Update(&updated, metav1.UpdateOptions{})
+	require.NoError(t, err)
+	time.Sleep(1 * time.Second)
+	reconciler = &Reconciler{dynClient: fakeDynClient, RestMapper: testutils.BuildTestRESTMapper(), scheme: f.S}
 	res, err = reconciler.Reconcile(reconcileRequest())
 	require.NoError(t, err)
 	require.False(t, res.Requeue)
 
 	sbrOutput3, err := reconciler.getServiceBindingRequest(namespacedName)
 	require.NoError(t, err)
-
-	d = appsv1.Deployment{}
-	require.NoError(t, fakeClient.Get(ctx, namespacedName, &d))
-
 	require.Equal(t, BindingReady, sbrOutput3.Status.Conditions[0].Type)
 	require.Equal(t, corev1.ConditionTrue, sbrOutput3.Status.Conditions[0].Status)
 	require.Equal(t, reconcilerName, sbrOutput3.Status.Secret)
@@ -327,13 +300,11 @@ func TestReconcilerReconcileWithConflictingAppSelc(t *testing.T) {
 	f.AddMockedUnstructuredDatabaseCR(backingServiceResourceRef)
 	f.AddMockedUnstructuredSecret("db-credentials")
 
-	fakeClient := f.FakeClient()
 	fakeDynClient := f.FakeDynClient()
 
 	restMapper := testutils.BuildTestRESTMapper()
 
 	reconciler := &Reconciler{
-		client:     fakeClient,
 		dynClient:  fakeDynClient,
 		scheme:     f.S,
 		RestMapper: restMapper,
@@ -363,6 +334,7 @@ func TestReconcilerReconcileWithConflictingAppSelc(t *testing.T) {
 		require.Equal(t, BindingReady, sbrOutput.Status.Conditions[0].Type)
 		require.Equal(t, corev1.ConditionTrue, sbrOutput.Status.Conditions[0].Status)
 		require.Equal(t, reconcilerName, sbrOutput.Status.Secret)
+		require.Len(t, sbrOutput.Status.Applications, 1)
 		require.True(t, reflect.DeepEqual(expectedStatus, sbrOutput.Status.Applications[0]))
 	})
 }
@@ -374,15 +346,7 @@ func TestEmptyApplicationSelector(t *testing.T) {
 	f.AddMockedUnstructuredServiceBindingRequestWithoutApplication(reconcilerName, backingServiceResourceRef)
 	f.AddMockedUnstructuredDatabaseCR(backingServiceResourceRef)
 
-	restMapper := testutils.BuildTestRESTMapper()
-
-	fakeClient := f.FakeClient()
-	reconciler := &Reconciler{
-		RestMapper: restMapper,
-		client:     fakeClient,
-		dynClient:  f.FakeDynClient(),
-		scheme:     f.S,
-	}
+	reconciler := &Reconciler{dynClient: f.FakeDynClient(), RestMapper: testutils.BuildTestRESTMapper(), scheme: f.S}
 
 	res, err := reconciler.Reconcile(reconcileRequest())
 	require.NoError(t, err)
diff --git a/pkg/controller/servicebindingrequest/servicebinder_test.go b/pkg/controller/servicebindingrequest/servicebinder_test.go
index edc3c2da..bf6104c9 100644
--- a/pkg/controller/servicebindingrequest/servicebinder_test.go
+++ b/pkg/controller/servicebindingrequest/servicebinder_test.go
@@ -18,6 +18,7 @@ import (
 
 	"github.com/redhat-developer/service-binding-operator/pkg/apis/apps/v1alpha1"
 	"github.com/redhat-developer/service-binding-operator/pkg/log"
+	"github.com/redhat-developer/service-binding-operator/pkg/testutils"
 	"github.com/redhat-developer/service-binding-operator/test/mocks"
 )
 
@@ -400,11 +401,11 @@ func TestServiceBinder_Bind(t *testing.T) {
 			DynClient:              f.FakeDynClient(),
 			DetectBindingResources: false,
 			SBR:                    sbrSingleService,
-			Client:                 f.FakeClient(),
 			Binding: &Binding{
 				EnvVars:    map[string][]byte{},
 				VolumeKeys: []string{},
 			},
+			RESTMapper: testutils.BuildTestRESTMapper(),
 		},
 		wantConditions: []wantedCondition{
 			{
@@ -437,13 +438,13 @@ func TestServiceBinder_Bind(t *testing.T) {
 			DynClient:              f.FakeDynClient(),
 			DetectBindingResources: false,
 			SBR:                    sbrSingleServiceWithCustomEnvVar,
-			Client:                 f.FakeClient(),
 			Binding: &Binding{
 				EnvVars: map[string][]byte{
 					"MY_DB_NAME": []byte("db1"),
 				},
 				VolumeKeys: []string{},
 			},
+			RESTMapper: testutils.BuildTestRESTMapper(),
 		},
 		wantConditions: []wantedCondition{
 			{
@@ -479,11 +480,11 @@ func TestServiceBinder_Bind(t *testing.T) {
 			DynClient:              f.FakeDynClient(),
 			DetectBindingResources: true,
 			SBR:                    sbrSingleService,
-			Client:                 f.FakeClient(),
 			Binding: &Binding{
 				EnvVars:    map[string][]byte{},
 				VolumeKeys: []string{},
 			},
+			RESTMapper: testutils.BuildTestRESTMapper(),
 		},
 		wantConditions: []wantedCondition{
 			{
@@ -499,11 +500,11 @@ func TestServiceBinder_Bind(t *testing.T) {
 			DynClient:              f.FakeDynClient(),
 			DetectBindingResources: true,
 			SBR:                    sbrEmptyAppSelector,
-			Client:                 f.FakeClient(),
 			Binding: &Binding{
 				EnvVars:    map[string][]byte{},
 				VolumeKeys: []string{},
 			},
+			RESTMapper: testutils.BuildTestRESTMapper(),
 		},
 		wantErr: EmptyApplicationSelectorErr,
 		wantConditions: []wantedCondition{
@@ -523,7 +524,7 @@ func TestServiceBinder_Bind(t *testing.T) {
 			DynClient:              f.FakeDynClient(),
 			DetectBindingResources: false,
 			SBR:                    nil,
-			Client:                 f.FakeClient(),
+			RESTMapper:             testutils.BuildTestRESTMapper(),
 		},
 		wantBuildErr: ErrInvalidServiceBinderOptions("SBR"),
 	}))
@@ -534,11 +535,11 @@ func TestServiceBinder_Bind(t *testing.T) {
 			DynClient:              f.FakeDynClient(),
 			DetectBindingResources: false,
 			SBR:                    sbrMultipleServices,
-			Client:                 f.FakeClient(),
 			Binding: &Binding{
 				EnvVars:    map[string][]byte{},
 				VolumeKeys: []string{},
 			},
+			RESTMapper: testutils.BuildTestRESTMapper(),
 		},
 		wantConditions: []wantedCondition{
 			{
diff --git a/pkg/testutils/testutils.go b/pkg/testutils/testutils.go
index 747c3f7e..2ce260c0 100644
--- a/pkg/testutils/testutils.go
+++ b/pkg/testutils/testutils.go
@@ -19,5 +19,9 @@ func BuildTestRESTMapper() meta.RESTMapper {
 		schema.GroupVersionKind{Kind: "ConfigMap", Version: "v1"},
 		meta.RESTScopeNamespace,
 	)
+	restMapper.Add(
+		schema.GroupVersionKind{Kind: "Deployment", Version: "v1", Group: "apps"},
+		meta.RESTScopeNamespace,
+	)
 	return restMapper
 }
diff --git a/test/mocks/fake.go b/test/mocks/fake.go
index 46692481..85a5de1f 100644
--- a/test/mocks/fake.go
+++ b/test/mocks/fake.go
@@ -14,8 +14,6 @@ import (
 	"k8s.io/apimachinery/pkg/runtime/schema"
 	fakedynamic "k8s.io/client-go/dynamic/fake"
 	"k8s.io/client-go/kubernetes/scheme"
-	"sigs.k8s.io/controller-runtime/pkg/client"
-	"sigs.k8s.io/controller-runtime/pkg/client/fake"
 
 	ocav1 "github.com/openshift/api/apps/v1"
 	knativev1 "knative.dev/serving/pkg/apis/serving/v1"
@@ -207,11 +205,6 @@ func (f *Fake) AddMockResource(resource runtime.Object) {
 	f.objs = append(f.objs, resource)
 }
 
-// FakeClient returns fake structured api client.
-func (f *Fake) FakeClient() client.Client {
-	return fake.NewFakeClientWithScheme(f.S, f.objs...)
-}
-
 // FakeDynClient returns fake dynamic api client.
 func (f *Fake) FakeDynClient() *fakedynamic.FakeDynamicClient {
 	return fakedynamic.NewSimpleDynamicClient(f.S, f.objs...)