Repository: redhat-developer/service-binding-operator
Pull request #298 (2020-01-20 08:35:38)

Use GroupVersionResource in ApplicationSelector
Fixes https://issues.redhat.com/browse/APPSVC-324


### Motivation

Be consistent with Kubernetes APIs

### Changes

Use GroupVersionResource from Kubernetes.

### Testing

WIP

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 **baijum**
You can assign the PR to them by writing `/assign @baijum` 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":["baijum"]} -->
openshift-ci-robot: @baijum: The following test **failed**, say `/retest` to rerun all failed tests:

Test name | Commit | Details | Rerun command
--- | --- | --- | ---
ci/prow/e2e | 92e93d8bf11cc707c8bc7abc2226b8f768743613 | [link](https://prow.svc.ci.openshift.org/view/gcs/origin-ci-test/pr-logs/pull/redhat-developer_service-binding-operator/298/pull-ci-redhat-developer-service-binding-operator-master-e2e/1048) | `/test e2e`

[Full PR test history](https://prow.svc.ci.openshift.org/pr-history?org=redhat-developer&repo=service-binding-operator&pr=298). [Your PR dashboard](https://prow.svc.ci.openshift.org/pr?query=is:pr+state:open+author:baijum). Please help us cut down on flakes by [linking to](https://github.com/kubernetes/community/blob/master/contributors/devel/flaky-tests.md#filing-issues-for-flaky-tests) an [open issue](https://github.com/redhat-developer/service-binding-operator/issues?q=is:issue+is:open) when you hit one in your PR.

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
codecov[bot]: # [Codecov](https://codecov.io/gh/redhat-developer/service-binding-operator/pull/298?src=pr&el=h1) Report
> Merging [#298](https://codecov.io/gh/redhat-developer/service-binding-operator/pull/298?src=pr&el=desc) into [master](https://codecov.io/gh/redhat-developer/service-binding-operator/commit/bcef0363107fb23774cd338abb81e1dbbf0ed014?src=pr&el=desc) will **not change** coverage.
> The diff coverage is `75%`.

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

```diff
@@           Coverage Diff           @@
##           master     #298   +/-   ##
=======================================
  Coverage   59.81%   59.81%           
=======================================
  Files          17       17           
  Lines        1294     1294           
=======================================
  Hits          774      774           
  Misses        388      388           
  Partials      132      132
```


| [Impacted Files](https://codecov.io/gh/redhat-developer/service-binding-operator/pull/298?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pkg/controller/servicebindingrequest/binder.go](https://codecov.io/gh/redhat-developer/service-binding-operator/pull/298/diff?src=pr&el=tree#diff-cGtnL2NvbnRyb2xsZXIvc2VydmljZWJpbmRpbmdyZXF1ZXN0L2JpbmRlci5nbw==) | `56.59% <75%> (ø)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/redhat-developer/service-binding-operator/pull/298?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/298?src=pr&el=footer). Last update [bcef036...fa0ad95](https://codecov.io/gh/redhat-developer/service-binding-operator/pull/298?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

openshift-ci-robot: @baijum: The following test **failed**, say `/retest` to rerun all failed tests:

Test name | Commit | Details | Rerun command
--- | --- | --- | ---
ci/prow/e2e | fa0ad959a224f0d5ceefe906cb3d4317767d0ffd | [link](https://prow.svc.ci.openshift.org/view/gcs/origin-ci-test/pr-logs/pull/redhat-developer_service-binding-operator/298/pull-ci-redhat-developer-service-binding-operator-master-e2e/1049) | `/test e2e`

[Full PR test history](https://prow.svc.ci.openshift.org/pr-history?org=redhat-developer&repo=service-binding-operator&pr=298). [Your PR dashboard](https://prow.svc.ci.openshift.org/pr?query=is:pr+state:open+author:baijum). Please help us cut down on flakes by [linking to](https://github.com/kubernetes/community/blob/master/contributors/devel/flaky-tests.md#filing-issues-for-flaky-tests) an [open issue](https://github.com/redhat-developer/service-binding-operator/issues?q=is:issue+is:open) when you hit one in your PR.

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
openshift-ci-robot: @baijum: The following test **failed**, say `/retest` to rerun all failed tests:

Test name | Commit | Details | Rerun command
--- | --- | --- | ---
ci/prow/e2e | d665b1c156aae08e07337776bfd68e6b0592044d | [link](https://prow.svc.ci.openshift.org/view/gcs/origin-ci-test/pr-logs/pull/redhat-developer_service-binding-operator/298/pull-ci-redhat-developer-service-binding-operator-master-e2e/1050) | `/test e2e`

[Full PR test history](https://prow.svc.ci.openshift.org/pr-history?org=redhat-developer&repo=service-binding-operator&pr=298). [Your PR dashboard](https://prow.svc.ci.openshift.org/pr?query=is:pr+state:open+author:baijum). Please help us cut down on flakes by [linking to](https://github.com/kubernetes/community/blob/master/contributors/devel/flaky-tests.md#filing-issues-for-flaky-tests) an [open issue](https://github.com/redhat-developer/service-binding-operator/issues?q=is:issue+is:open) when you hit one in your PR.

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
baijum: /test e2e
openshift-ci-robot: @baijum: The following test **failed**, say `/retest` to rerun all failed tests:

Test name | Commit | Details | Rerun command
--- | --- | --- | ---
ci/prow/e2e | d665b1c156aae08e07337776bfd68e6b0592044d | [link](https://prow.svc.ci.openshift.org/view/gcs/origin-ci-test/pr-logs/pull/redhat-developer_service-binding-operator/298/pull-ci-redhat-developer-service-binding-operator-master-e2e/1052) | `/test e2e`

[Full PR test history](https://prow.svc.ci.openshift.org/pr-history?org=redhat-developer&repo=service-binding-operator&pr=298). [Your PR dashboard](https://prow.svc.ci.openshift.org/pr?query=is:pr+state:open+author:baijum). Please help us cut down on flakes by [linking to](https://github.com/kubernetes/community/blob/master/contributors/devel/flaky-tests.md#filing-issues-for-flaky-tests) an [open issue](https://github.com/redhat-developer/service-binding-operator/issues?q=is:issue+is:open) when you hit one in your PR.

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
DhritiShikhar: @baijum Can you update the README and CR as well according to this change?
DhritiShikhar: PR looks okay. 

e2e tests are failing which need to be updated:

```
--- FAIL: TestAddSchemesToFramework (131.88s)
    servicebindingrequest_test.go:69: Adding ServiceBindingRequestList scheme to cluster...
    servicebindingrequest_test.go:73: Adding ClusterServiceVersionList scheme to cluster...
    servicebindingrequest_test.go:77: Adding DatabaseList scheme to cluster...
    servicebindingrequest_test.go:81: Adding EtcdCluster scheme to cluster...
    --- FAIL: TestAddSchemesToFramework/end-to-end (127.09s)
        --- FAIL: TestAddSchemesToFramework/end-to-end/scenario-etcd-unannotated-app-db-sbr (20.41s)
            servicebindingrequest_test.go:147: Creating a new test context...
            servicebindingrequest_test.go:128: Initializing cluster resources...
            servicebindingrequest_test.go:138: Using namespace 'test-namespace-d38f427e-4cd3-4c15-8bf6-90a3b015ffdf' for testing...
            servicebindingrequest_test.go:504: Starting end-to-end tests for operator, using suffix '6129484611666145821'!
            servicebindingrequest_test.go:324: Creating Deployment mock object 'types.NamespacedName{Namespace:"test-namespace-d38f427e-4cd3-4c15-8bf6-90a3b015ffdf", Name:"e2e-application-6129484611666145821"}'...
skipped 17 lines unfold_more
                	            	ServiceBindingRequest.apps.openshift.io "e2e-service-binding-request-6129484611666145821" is invalid: [spec.applicationSelector.group: Required value, spec.applicationSelector.resource: Required value, spec.applicationSelector.version: Required value]
```

openshift-ci-robot: @baijum: The following tests **failed**, say `/retest` to rerun all failed tests:

Test name | Commit | Details | Rerun command
--- | --- | --- | ---
ci/prow/e2e | d665b1c156aae08e07337776bfd68e6b0592044d | [link](https://prow.svc.ci.openshift.org/view/gcs/origin-ci-test/pr-logs/pull/redhat-developer_service-binding-operator/298/pull-ci-redhat-developer-service-binding-operator-master-e2e/1052) | `/test e2e`
ci/prow/lint | 770dcf88ff6b75d7a38cc4bbf060914669bc9901 | [link](https://prow.svc.ci.openshift.org/view/gcs/origin-ci-test/pr-logs/pull/redhat-developer_service-binding-operator/298/pull-ci-redhat-developer-service-binding-operator-master-lint/998) | `/test lint`

[Full PR test history](https://prow.svc.ci.openshift.org/pr-history?org=redhat-developer&repo=service-binding-operator&pr=298). [Your PR dashboard](https://prow.svc.ci.openshift.org/pr?query=is:pr+state:open+author:baijum). Please help us cut down on flakes by [linking to](https://github.com/kubernetes/community/blob/master/contributors/devel/flaky-tests.md#filing-issues-for-flaky-tests) an [open issue](https://github.com/redhat-developer/service-binding-operator/issues?q=is:issue+is:open) when you hit one in your PR.

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
baijum: /test lint
openshift-ci-robot: @baijum: The following tests **failed**, say `/retest` to rerun all failed tests:

Test name | Commit | Details | Rerun command
--- | --- | --- | ---
ci/prow/e2e | d665b1c156aae08e07337776bfd68e6b0592044d | [link](https://prow.svc.ci.openshift.org/view/gcs/origin-ci-test/pr-logs/pull/redhat-developer_service-binding-operator/298/pull-ci-redhat-developer-service-binding-operator-master-e2e/1052) | `/test e2e`
ci/prow/lint | 770dcf88ff6b75d7a38cc4bbf060914669bc9901 | [link](https://prow.svc.ci.openshift.org/view/gcs/origin-ci-test/pr-logs/pull/redhat-developer_service-binding-operator/298/pull-ci-redhat-developer-service-binding-operator-master-lint/999) | `/test lint`

[Full PR test history](https://prow.svc.ci.openshift.org/pr-history?org=redhat-developer&repo=service-binding-operator&pr=298). [Your PR dashboard](https://prow.svc.ci.openshift.org/pr?query=is:pr+state:open+author:baijum). Please help us cut down on flakes by [linking to](https://github.com/kubernetes/community/blob/master/contributors/devel/flaky-tests.md#filing-issues-for-flaky-tests) an [open issue](https://github.com/redhat-developer/service-binding-operator/issues?q=is:issue+is:open) when you hit one in your PR.

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
baijum: Not sure why lint fails.

Found something related: https://github.com/pypa/pip/issues/7217
openshift-ci-robot: @baijum: The following tests **failed**, say `/retest` to rerun all failed tests:

Test name | Commit | Details | Rerun command
--- | --- | --- | ---
ci/prow/lint | 770dcf88ff6b75d7a38cc4bbf060914669bc9901 | [link](https://prow.svc.ci.openshift.org/view/gcs/origin-ci-test/pr-logs/pull/redhat-developer_service-binding-operator/298/pull-ci-redhat-developer-service-binding-operator-master-lint/999) | `/test lint`
ci/prow/e2e | 770dcf88ff6b75d7a38cc4bbf060914669bc9901 | [link](https://prow.svc.ci.openshift.org/view/gcs/origin-ci-test/pr-logs/pull/redhat-developer_service-binding-operator/298/pull-ci-redhat-developer-service-binding-operator-master-e2e/1053) | `/test e2e`

[Full PR test history](https://prow.svc.ci.openshift.org/pr-history?org=redhat-developer&repo=service-binding-operator&pr=298). [Your PR dashboard](https://prow.svc.ci.openshift.org/pr?query=is:pr+state:open+author:baijum). Please help us cut down on flakes by [linking to](https://github.com/kubernetes/community/blob/master/contributors/devel/flaky-tests.md#filing-issues-for-flaky-tests) an [open issue](https://github.com/redhat-developer/service-binding-operator/issues?q=is:issue+is:open) when you hit one in your PR.

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
openshift-ci-robot: @baijum: The following test **failed**, say `/retest` to rerun all failed tests:

Test name | Commit | Details | Rerun command
--- | --- | --- | ---
ci/prow/e2e | 83750c1b4731363693d85af45ad30ffb89027f78 | [link](https://prow.svc.ci.openshift.org/view/gcs/origin-ci-test/pr-logs/pull/redhat-developer_service-binding-operator/298/pull-ci-redhat-developer-service-binding-operator-master-e2e/1054) | `/test e2e`

[Full PR test history](https://prow.svc.ci.openshift.org/pr-history?org=redhat-developer&repo=service-binding-operator&pr=298). [Your PR dashboard](https://prow.svc.ci.openshift.org/pr?query=is:pr+state:open+author:baijum). Please help us cut down on flakes by [linking to](https://github.com/kubernetes/community/blob/master/contributors/devel/flaky-tests.md#filing-issues-for-flaky-tests) an [open issue](https://github.com/redhat-developer/service-binding-operator/issues?q=is:issue+is:open) when you hit one in your PR.

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
openshift-ci-robot: @baijum: The following test **failed**, say `/retest` to rerun all failed tests:

Test name | Commit | Details | Rerun command
--- | --- | --- | ---
ci/prow/e2e | 16bb9bdda9048c652d8922952c540d72fd0add22 | [link](https://prow.svc.ci.openshift.org/view/gcs/origin-ci-test/pr-logs/pull/redhat-developer_service-binding-operator/298/pull-ci-redhat-developer-service-binding-operator-master-e2e/1055) | `/test e2e`

[Full PR test history](https://prow.svc.ci.openshift.org/pr-history?org=redhat-developer&repo=service-binding-operator&pr=298). [Your PR dashboard](https://prow.svc.ci.openshift.org/pr?query=is:pr+state:open+author:baijum). Please help us cut down on flakes by [linking to](https://github.com/kubernetes/community/blob/master/contributors/devel/flaky-tests.md#filing-issues-for-flaky-tests) an [open issue](https://github.com/redhat-developer/service-binding-operator/issues?q=is:issue+is:open) when you hit one in your PR.

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->

Patch:
diff --git a/Makefile b/Makefile
index f78af9e0..27186476 100644
--- a/Makefile
+++ b/Makefile
@@ -435,7 +435,7 @@ push-to-manifest-repo:
 	cp -vrf $(OLM_CATALOG_DIR)/$(GO_PACKAGE_REPO_NAME)/$(BUNDLE_VERSION)/* $(MANIFESTS_TMP)/$(BUNDLE_VERSION)/
 	cp -vrf $(OLM_CATALOG_DIR)/$(GO_PACKAGE_REPO_NAME)/*package.yaml $(MANIFESTS_TMP)/
 	cp -vrf $(CRDS_DIR)/*_crd.yaml $(MANIFESTS_TMP)/${BUNDLE_VERSION}/
-	sed -i -e 's,REPLACE_IMAGE,$(OPERATOR_IMAGE_REL)-$(GIT_COMMIT_ID),g' $(MANIFESTS_TMP)/${BUNDLE_VERSION}/*.clusterserviceversion.yaml
+	sed -i -e 's,REPLACE_IMAGE,$(OPERATOR_IMAGE_REL):$(GIT_COMMIT_ID),g' $(MANIFESTS_TMP)/${BUNDLE_VERSION}/*.clusterserviceversion.yaml
 	sed -i -e 's,BUNDLE_VERSION,$(BUNDLE_VERSION),g' $(MANIFESTS_TMP)/*.yaml
 
 ## -- Target for pushing manifest bundle to quay application --
diff --git a/deploy/crds/apps.openshift.io_servicebindingrequests_crd.yaml b/deploy/crds/apps.openshift.io_servicebindingrequests_crd.yaml
index cb76832a..99a7b0c2 100644
--- a/deploy/crds/apps.openshift.io_servicebindingrequests_crd.yaml
+++ b/deploy/crds/apps.openshift.io_servicebindingrequests_crd.yaml
@@ -94,6 +94,7 @@ spec:
                 version:
                   type: string
               required:
+              - group
               - resource
               - resourceRef
               - version
diff --git a/pkg/apis/apps/v1alpha1/servicebindingrequest_types.go b/pkg/apis/apps/v1alpha1/servicebindingrequest_types.go
index 10918fc9..1edc387c 100644
--- a/pkg/apis/apps/v1alpha1/servicebindingrequest_types.go
+++ b/pkg/apis/apps/v1alpha1/servicebindingrequest_types.go
@@ -63,11 +63,9 @@ type BackingServiceSelector struct {
 // +k8s:openapi-gen=true
 type ApplicationSelector struct {
 	// +optional
-	LabelSelector *metav1.LabelSelector `json:"labelSelector,omitempty"`
-	Group         string                `json:"group,omitempty"`
-	Version       string                `json:"version"`
-	Resource      string                `json:"resource"`
-	ResourceRef   string                `json:"resourceRef"`
+	LabelSelector               *metav1.LabelSelector `json:"labelSelector,omitempty"`
+	metav1.GroupVersionResource `json:",inline" yaml:",inline"`
+	ResourceRef                 string `json:"resourceRef"`
 }
 
 // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
diff --git a/pkg/apis/apps/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/apps/v1alpha1/zz_generated.deepcopy.go
index 6ba6df14..c6f68995 100644
--- a/pkg/apis/apps/v1alpha1/zz_generated.deepcopy.go
+++ b/pkg/apis/apps/v1alpha1/zz_generated.deepcopy.go
@@ -18,6 +18,7 @@ func (in *ApplicationSelector) DeepCopyInto(out *ApplicationSelector) {
 		*out = new(v1.LabelSelector)
 		(*in).DeepCopyInto(*out)
 	}
+	out.GroupVersionResource = in.GroupVersionResource
 	return
 }
 
diff --git a/pkg/apis/apps/v1alpha1/zz_generated.openapi.go b/pkg/apis/apps/v1alpha1/zz_generated.openapi.go
index 4080e439..47e39735 100644
--- a/pkg/apis/apps/v1alpha1/zz_generated.openapi.go
+++ b/pkg/apis/apps/v1alpha1/zz_generated.openapi.go
@@ -56,7 +56,7 @@ func schema_pkg_apis_apps_v1alpha1_ApplicationSelector(ref common.ReferenceCallb
 						},
 					},
 				},
-				Required: []string{"version", "resource", "resourceRef"},
+				Required: []string{"group", "version", "resource", "resourceRef"},
 			},
 		},
 		Dependencies: []string{
diff --git a/pkg/controller/servicebindingrequest/binder.go b/pkg/controller/servicebindingrequest/binder.go
index efc0cff9..8004a8f8 100644
--- a/pkg/controller/servicebindingrequest/binder.go
+++ b/pkg/controller/servicebindingrequest/binder.go
@@ -47,9 +47,9 @@ type Binder struct {
 func (b *Binder) search() (*unstructured.UnstructuredList, error) {
 	ns := b.sbr.GetNamespace()
 	gvr := schema.GroupVersionResource{
-		Group:    b.sbr.Spec.ApplicationSelector.Group,
-		Version:  b.sbr.Spec.ApplicationSelector.Version,
-		Resource: b.sbr.Spec.ApplicationSelector.Resource,
+		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
@@ -79,7 +79,7 @@ func (b *Binder) search() (*unstructured.UnstructuredList, error) {
 	if len(objList.Items) == 0 {
 		return nil, errors.NewNotFound(
 			gvr.GroupResource(),
-			b.sbr.Spec.ApplicationSelector.Resource,
+			b.sbr.Spec.ApplicationSelector.GroupVersionResource.Resource,
 		)
 	}
 	return objList, err


Test patch:
diff --git a/test/mocks/mocks.go b/test/mocks/mocks.go
index 086f2c91..3201bbff 100644
--- a/test/mocks/mocks.go
+++ b/test/mocks/mocks.go
@@ -397,11 +397,9 @@ func ServiceBindingRequestMock(
 				},
 			},
 			ApplicationSelector: v1alpha1.ApplicationSelector{
-				Group:         applicationGVR.Group,
-				Version:       applicationGVR.Version,
-				Resource:      applicationGVR.Resource,
-				ResourceRef:   applicationResourceRef,
-				LabelSelector: &metav1.LabelSelector{MatchLabels: matchLabels},
+				GroupVersionResource: metav1.GroupVersionResource{Group: applicationGVR.Group, Version: applicationGVR.Version, Resource: applicationGVR.Resource},
+				ResourceRef:          applicationResourceRef,
+				LabelSelector:        &metav1.LabelSelector{MatchLabels: matchLabels},
 			},
 			DetectBindingResources: false,
 		},