Repository: redhat-developer/service-binding-operator
Pull request #177 (2019-09-19 14:52:29)

Comb examples
This PR:
* Renames examples directories to shorter names.
* Removes optional `mountPathPrefix` from service binding requests, where not necessary.

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"]} -->

Patch:
diff --git a/README.md b/README.md
index 9ab7d40e..052e69ca 100644
--- a/README.md
+++ b/README.md
@@ -82,21 +82,21 @@ EOS
 
 ## Getting Started
 
-The best way to get started with the Service Binding Operator is to see it in action. 
+The best way to get started with the Service Binding Operator is to see it in action.
 
-We've included a number of examples scenarios for using the operator in this repo. The examples are found in the "/examples" directory. Each of these examples illustrates a usage scenario for the operator. Each example also includes a README file with step-by-step instructions for how to run the example. 
+We've included a number of examples scenarios for using the operator in this repo. The examples are found in the "/examples" directory. Each of these examples illustrates a usage scenario for the operator. Each example also includes a README file with step-by-step instructions for how to run the example.
 
-We'll add more examples in the future. The following section in this README file includes links to the current set of examples. 
+We'll add more examples in the future. The following section in this README file includes links to the current set of examples.
 
 ## Example Scenarios
 
 The following example scenarios are available:
 
-[Binding an Imported app to an In-cluster Operator Managed PostgreSQL Database](examples/app_to_incluster_operator_managed_PostgreSQL_db/README.md)
+[Binding an Imported app to an In-cluster Operator Managed PostgreSQL Database](examples/nodejs_postgresql/README.md)
 
-[Binding an Imported app to an Off-cluster Operator Managed AWS RDS Database](examples/app_to_offcluster_operator_managed_AWS_RDS_db/README.md)
+[Binding an Imported app to an Off-cluster Operator Managed AWS RDS Database](examples/nodejs_awsrds_varprefix/README.md)
 
-[Binding an Imported Java Spring Boot app to an In-cluster Operator Managed PostgreSQL Database](examples/java_app_to_incluster_operator_managed_PostgreSQL_db/README.md)
+[Binding an Imported Java Spring Boot app to an In-cluster Operator Managed PostgreSQL Database](examples/java_postgresql_customvar/README.md)
 
 
 
diff --git a/deploy/crds/apps_v1alpha1_servicebindingrequest_crd.yaml b/deploy/crds/apps_v1alpha1_servicebindingrequest_crd.yaml
index 1101d79d..88d97e1a 100644
--- a/deploy/crds/apps_v1alpha1_servicebindingrequest_crd.yaml
+++ b/deploy/crds/apps_v1alpha1_servicebindingrequest_crd.yaml
@@ -38,6 +38,8 @@ spec:
               properties:
                 group:
                   type: string
+                name:
+                  type: string
                 matchLabels:
                   additionalProperties:
                     type: string
@@ -47,7 +49,6 @@ spec:
                 version:
                   type: string
               required:
-              - matchLabels
               - version
               - resource
               type: object
diff --git a/examples/java_app_to_incluster_operator_managed_PostgreSQL_db/Makefile b/examples/java_postgresql_customvar/Makefile
similarity index 100%
rename from examples/java_app_to_incluster_operator_managed_PostgreSQL_db/Makefile
rename to examples/java_postgresql_customvar/Makefile
diff --git a/examples/java_app_to_incluster_operator_managed_PostgreSQL_db/README.md b/examples/java_postgresql_customvar/README.md
similarity index 99%
rename from examples/java_app_to_incluster_operator_managed_PostgreSQL_db/README.md
rename to examples/java_postgresql_customvar/README.md
index 13f6eb12..4bf9318a 100644
--- a/examples/java_app_to_incluster_operator_managed_PostgreSQL_db/README.md
+++ b/examples/java_postgresql_customvar/README.md
@@ -202,7 +202,6 @@ spec:
     version: v1alpha1
     kind: Database
     resourceRef: db-demo
-  mountPathPrefix: “”
   customEnvVar:
     - name: JDBC_URL
       value: 'jdbc:postgresql://{{ .status.dbConnectionIP }}:{{ .status.dbConnectionPort }}/{{ .status.dbName }}'
diff --git a/examples/app_to_incluster_operator_managed_PostgreSQL_db/backing-db-operator-source.yaml b/examples/java_postgresql_customvar/backing-db-operator-source.yaml
similarity index 100%
rename from examples/app_to_incluster_operator_managed_PostgreSQL_db/backing-db-operator-source.yaml
rename to examples/java_postgresql_customvar/backing-db-operator-source.yaml
diff --git a/examples/app_to_incluster_operator_managed_PostgreSQL_db/create-db-instance.yaml b/examples/java_postgresql_customvar/create-db-instance.yaml
similarity index 100%
rename from examples/app_to_incluster_operator_managed_PostgreSQL_db/create-db-instance.yaml
rename to examples/java_postgresql_customvar/create-db-instance.yaml
diff --git a/examples/app_to_incluster_operator_managed_PostgreSQL_db/namespace.yaml b/examples/java_postgresql_customvar/namespace.yaml
similarity index 100%
rename from examples/app_to_incluster_operator_managed_PostgreSQL_db/namespace.yaml
rename to examples/java_postgresql_customvar/namespace.yaml
diff --git a/examples/app_to_incluster_operator_managed_PostgreSQL_db/service-binding-operator-source.yaml b/examples/java_postgresql_customvar/service-binding-operator-source.yaml
similarity index 100%
rename from examples/app_to_incluster_operator_managed_PostgreSQL_db/service-binding-operator-source.yaml
rename to examples/java_postgresql_customvar/service-binding-operator-source.yaml
diff --git a/examples/java_app_to_incluster_operator_managed_PostgreSQL_db/service-binding-request.yaml b/examples/java_postgresql_customvar/service-binding-request.yaml
similarity index 96%
rename from examples/java_app_to_incluster_operator_managed_PostgreSQL_db/service-binding-request.yaml
rename to examples/java_postgresql_customvar/service-binding-request.yaml
index d46feb0c..72010731 100644
--- a/examples/java_app_to_incluster_operator_managed_PostgreSQL_db/service-binding-request.yaml
+++ b/examples/java_postgresql_customvar/service-binding-request.yaml
@@ -17,7 +17,6 @@ spec:
     version: v1alpha1
     kind: Database
     resourceRef: db-demo
-  mountPathPrefix: “”
   customEnvVar:
     - name: JDBC_URL
       value: 'jdbc:postgresql://{{ .status.dbConnectionIP }}:{{ .status.dbConnectionPort }}/{{ .status.dbName }}'   # yamllint disable-line rule:line-length
diff --git a/examples/app_to_offcluster_operator_managed_AWS_RDS_db/Makefile b/examples/nodejs_awsrds_varprefix/Makefile
similarity index 100%
rename from examples/app_to_offcluster_operator_managed_AWS_RDS_db/Makefile
rename to examples/nodejs_awsrds_varprefix/Makefile
diff --git a/examples/app_to_offcluster_operator_managed_AWS_RDS_db/README.md b/examples/nodejs_awsrds_varprefix/README.md
similarity index 99%
rename from examples/app_to_offcluster_operator_managed_AWS_RDS_db/README.md
rename to examples/nodejs_awsrds_varprefix/README.md
index 62936eab..952b69bf 100644
--- a/examples/app_to_offcluster_operator_managed_AWS_RDS_db/README.md
+++ b/examples/nodejs_awsrds_varprefix/README.md
@@ -187,7 +187,6 @@ metadata:
   name: mydb.to.shell-app
   namespace: service-binding-demo
 spec:
-  mountPathPrefix: "/var/credentials"
   envVarPrefix: "MYDB"
   backingServiceSelector:
     group: aws.pmacik.dev
@@ -278,7 +277,6 @@ metadata:
   name: mydb.to.nodejs-app
   namespace: service-binding-demo
 spec:
-  mountPathPrefix: "/var/credentials"
   envVarPrefix: "MYDB"
   backingServiceSelector:
     group: aws.pmacik.dev
diff --git a/examples/app_to_offcluster_operator_managed_AWS_RDS_db/build-config.shell-app.yaml b/examples/nodejs_awsrds_varprefix/build-config.shell-app.yaml
similarity index 100%
rename from examples/app_to_offcluster_operator_managed_AWS_RDS_db/build-config.shell-app.yaml
rename to examples/nodejs_awsrds_varprefix/build-config.shell-app.yaml
diff --git a/examples/app_to_offcluster_operator_managed_AWS_RDS_db/deployment-config.shell-app.yaml b/examples/nodejs_awsrds_varprefix/deployment-config.shell-app.yaml
similarity index 100%
rename from examples/app_to_offcluster_operator_managed_AWS_RDS_db/deployment-config.shell-app.yaml
rename to examples/nodejs_awsrds_varprefix/deployment-config.shell-app.yaml
diff --git a/examples/app_to_offcluster_operator_managed_AWS_RDS_db/image-stream.shell-app.yaml b/examples/nodejs_awsrds_varprefix/image-stream.shell-app.yaml
similarity index 100%
rename from examples/app_to_offcluster_operator_managed_AWS_RDS_db/image-stream.shell-app.yaml
rename to examples/nodejs_awsrds_varprefix/image-stream.shell-app.yaml
diff --git a/examples/app_to_offcluster_operator_managed_AWS_RDS_db/operator-source.aws-rds-operator.yaml b/examples/nodejs_awsrds_varprefix/operator-source.aws-rds-operator.yaml
similarity index 100%
rename from examples/app_to_offcluster_operator_managed_AWS_RDS_db/operator-source.aws-rds-operator.yaml
rename to examples/nodejs_awsrds_varprefix/operator-source.aws-rds-operator.yaml
diff --git a/examples/app_to_offcluster_operator_managed_AWS_RDS_db/operator-source.service-binding-operator.yaml b/examples/nodejs_awsrds_varprefix/operator-source.service-binding-operator.yaml
similarity index 100%
rename from examples/app_to_offcluster_operator_managed_AWS_RDS_db/operator-source.service-binding-operator.yaml
rename to examples/nodejs_awsrds_varprefix/operator-source.service-binding-operator.yaml
diff --git a/examples/app_to_offcluster_operator_managed_AWS_RDS_db/rds.mydb.yaml b/examples/nodejs_awsrds_varprefix/rds.mydb.yaml
similarity index 100%
rename from examples/app_to_offcluster_operator_managed_AWS_RDS_db/rds.mydb.yaml
rename to examples/nodejs_awsrds_varprefix/rds.mydb.yaml
diff --git a/examples/app_to_offcluster_operator_managed_AWS_RDS_db/secret.aws-rds-operator.yaml b/examples/nodejs_awsrds_varprefix/secret.aws-rds-operator.yaml
similarity index 100%
rename from examples/app_to_offcluster_operator_managed_AWS_RDS_db/secret.aws-rds-operator.yaml
rename to examples/nodejs_awsrds_varprefix/secret.aws-rds-operator.yaml
diff --git a/examples/app_to_offcluster_operator_managed_AWS_RDS_db/secret.mydb.yaml b/examples/nodejs_awsrds_varprefix/secret.mydb.yaml
similarity index 100%
rename from examples/app_to_offcluster_operator_managed_AWS_RDS_db/secret.mydb.yaml
rename to examples/nodejs_awsrds_varprefix/secret.mydb.yaml
diff --git a/examples/app_to_offcluster_operator_managed_AWS_RDS_db/service-binding-request.nodejs-app.yaml b/examples/nodejs_awsrds_varprefix/service-binding-request.nodejs-app.yaml
similarity index 92%
rename from examples/app_to_offcluster_operator_managed_AWS_RDS_db/service-binding-request.nodejs-app.yaml
rename to examples/nodejs_awsrds_varprefix/service-binding-request.nodejs-app.yaml
index 091778cc..dc58ec3b 100644
--- a/examples/app_to_offcluster_operator_managed_AWS_RDS_db/service-binding-request.nodejs-app.yaml
+++ b/examples/nodejs_awsrds_varprefix/service-binding-request.nodejs-app.yaml
@@ -5,7 +5,6 @@ metadata:
   name: mydb.to.nodejs-app
   namespace: service-binding-demo
 spec:
-  mountPathPrefix: "/var/credentials"
   envVarPrefix: "MYDB"
   backingServiceSelector:
     group: aws.pmacik.dev
diff --git a/examples/app_to_offcluster_operator_managed_AWS_RDS_db/service-binding-request.shell-app.yaml b/examples/nodejs_awsrds_varprefix/service-binding-request.shell-app.yaml
similarity index 92%
rename from examples/app_to_offcluster_operator_managed_AWS_RDS_db/service-binding-request.shell-app.yaml
rename to examples/nodejs_awsrds_varprefix/service-binding-request.shell-app.yaml
index 83dc51ca..b5c191e5 100644
--- a/examples/app_to_offcluster_operator_managed_AWS_RDS_db/service-binding-request.shell-app.yaml
+++ b/examples/nodejs_awsrds_varprefix/service-binding-request.shell-app.yaml
@@ -5,7 +5,6 @@ metadata:
   name: mydb.to.shell-app
   namespace: service-binding-demo
 spec:
-  mountPathPrefix: "/var/credentials"
   envVarPrefix: "MYDB"
   backingServiceSelector:
     group: aws.pmacik.dev
diff --git a/examples/app_to_incluster_operator_managed_PostgreSQL_db/Makefile b/examples/nodejs_postgresql/Makefile
similarity index 100%
rename from examples/app_to_incluster_operator_managed_PostgreSQL_db/Makefile
rename to examples/nodejs_postgresql/Makefile
diff --git a/examples/app_to_incluster_operator_managed_PostgreSQL_db/README.md b/examples/nodejs_postgresql/README.md
similarity index 99%
rename from examples/app_to_incluster_operator_managed_PostgreSQL_db/README.md
rename to examples/nodejs_postgresql/README.md
index ed8a0554..2f7b4691 100644
--- a/examples/app_to_incluster_operator_managed_PostgreSQL_db/README.md
+++ b/examples/nodejs_postgresql/README.md
@@ -197,7 +197,6 @@ spec:
     version: v1alpha1
     kind: Database
     resourceRef: db-demo
-  mountPathPrefix: “”
 EOS
 ```
 
diff --git a/examples/java_app_to_incluster_operator_managed_PostgreSQL_db/backing-db-operator-source.yaml b/examples/nodejs_postgresql/backing-db-operator-source.yaml
similarity index 100%
rename from examples/java_app_to_incluster_operator_managed_PostgreSQL_db/backing-db-operator-source.yaml
rename to examples/nodejs_postgresql/backing-db-operator-source.yaml
diff --git a/examples/java_app_to_incluster_operator_managed_PostgreSQL_db/create-db-instance.yaml b/examples/nodejs_postgresql/create-db-instance.yaml
similarity index 100%
rename from examples/java_app_to_incluster_operator_managed_PostgreSQL_db/create-db-instance.yaml
rename to examples/nodejs_postgresql/create-db-instance.yaml
diff --git a/examples/java_app_to_incluster_operator_managed_PostgreSQL_db/namespace.yaml b/examples/nodejs_postgresql/namespace.yaml
similarity index 100%
rename from examples/java_app_to_incluster_operator_managed_PostgreSQL_db/namespace.yaml
rename to examples/nodejs_postgresql/namespace.yaml
diff --git a/examples/java_app_to_incluster_operator_managed_PostgreSQL_db/service-binding-operator-source.yaml b/examples/nodejs_postgresql/service-binding-operator-source.yaml
similarity index 100%
rename from examples/java_app_to_incluster_operator_managed_PostgreSQL_db/service-binding-operator-source.yaml
rename to examples/nodejs_postgresql/service-binding-operator-source.yaml
diff --git a/examples/app_to_incluster_operator_managed_PostgreSQL_db/service-binding-request.yaml b/examples/nodejs_postgresql/service-binding-request.yaml
similarity index 94%
rename from examples/app_to_incluster_operator_managed_PostgreSQL_db/service-binding-request.yaml
rename to examples/nodejs_postgresql/service-binding-request.yaml
index 8f944765..caff1dec 100644
--- a/examples/app_to_incluster_operator_managed_PostgreSQL_db/service-binding-request.yaml
+++ b/examples/nodejs_postgresql/service-binding-request.yaml
@@ -17,4 +17,3 @@ spec:
     version: v1alpha1
     kind: Database
     resourceRef: db-demo
-  mountPathPrefix: “”
diff --git a/go.sum b/go.sum
index 13c7f632..ce1d1ffc 100644
--- a/go.sum
+++ b/go.sum
@@ -49,6 +49,7 @@ github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDk
 github.com/coreos/bbolt v1.3.0/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk=
 github.com/coreos/bbolt v1.3.3/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk=
 github.com/coreos/etcd v3.3.9+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
+github.com/coreos/etcd v3.3.10+incompatible h1:jFneRYjIvLMLhDLCzuTuU4rSJUjRplcJQ7pD7MnhC04=
 github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
 github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk=
 github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
@@ -201,6 +202,7 @@ github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ
 github.com/hashicorp/golang-lru v0.5.1 h1:0hERBMJE1eitiLkihrMvRVBYAkpHzc/J3QdDN+dAcgU=
 github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
 github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
+github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI=
 github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
 github.com/huandu/xstrings v1.2.0/go.mod h1:DvyZB1rfVYsBIigL8HwpZgxHwXozlTgGqn63UyNX5k4=
 github.com/iancoleman/strcase v0.0.0-20180726023541-3605ed457bf7/go.mod h1:SK73tn/9oHe+/Y0h39VT4UCxmurVJkR5NA7kMEAOgSE=
@@ -259,9 +261,11 @@ github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRW
 github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw=
 github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
 github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
+github.com/onsi/ginkgo v1.8.0 h1:VkHVNpR4iVnU8XQR6DBm8BqYjN7CRzw+xKUbVVbbW9w=
 github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
 github.com/onsi/gomega v1.4.2-0.20180831124310-ae19f1b56d53/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA=
 github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
+github.com/onsi/gomega v1.5.0 h1:izbySO9zDPmjJ8rDjLvkA2zJHIo+HkYXHnf7eN7SSyo=
 github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
 github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s=
 github.com/openshift/api v3.9.0+incompatible h1:fJ/KsefYuZAjmrr3+5U9yZIZbTOpVkDDLDLFresAeYs=
@@ -498,6 +502,7 @@ gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLks
 gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
 gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
 gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
+gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4=
 gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
 gopkg.in/inf.v0 v0.9.0/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
 gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=
@@ -506,6 +511,7 @@ gopkg.in/natefinch/lumberjack.v2 v2.0.0-20170531160350-a96e63847dc3/go.mod h1:l0
 gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k=
 gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo=
 gopkg.in/square/go-jose.v2 v2.3.0/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI=
+gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
 gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
 gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74=
 gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
@@ -555,6 +561,7 @@ sigs.k8s.io/controller-runtime v0.1.10/go.mod h1:HFAYoOh6XMV+jKF1UjFwrknPbowfyHE
 sigs.k8s.io/controller-tools v0.1.11-0.20190411181648-9d55346c2bde h1:ZkaHf5rNYzIB6CB82keKMQNv7xxkqT0ylOBdfJPfi+k=
 sigs.k8s.io/controller-tools v0.1.11-0.20190411181648-9d55346c2bde/go.mod h1:ATWLRP3WGxuAN9HcT2LaKHReXIH+EZGzRuMHuxjXfhQ=
 sigs.k8s.io/testing_frameworks v0.1.0/go.mod h1:VVBKrHmJ6Ekkfz284YKhQePcdycOzNH9qL6ht1zEr/U=
+sigs.k8s.io/testing_frameworks v0.1.1 h1:cP2l8fkA3O9vekpy5Ks8mmA0NW/F7yBdXf8brkWhVrs=
 sigs.k8s.io/testing_frameworks v0.1.1/go.mod h1:VVBKrHmJ6Ekkfz284YKhQePcdycOzNH9qL6ht1zEr/U=
 sigs.k8s.io/yaml v1.1.0 h1:4A07+ZFc2wgJwo8YNlQpr1rVlgUDlxXHhPJciaPY5gs=
 sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o=
diff --git a/manifests/service-binding-operator.servicebindingrequests.crd.yaml b/manifests/service-binding-operator.servicebindingrequests.crd.yaml
index bacabaae..4ac387a3 100644
--- a/manifests/service-binding-operator.servicebindingrequests.crd.yaml
+++ b/manifests/service-binding-operator.servicebindingrequests.crd.yaml
@@ -41,6 +41,8 @@ spec:
               properties:
                 group:
                   type: string
+                name:
+                  type: string
                 matchLabels:
                   additionalProperties:
                     type: string
diff --git a/pkg/apis/apps/v1alpha1/servicebindingrequest_types.go b/pkg/apis/apps/v1alpha1/servicebindingrequest_types.go
index 4e303722..1be64e9f 100644
--- a/pkg/apis/apps/v1alpha1/servicebindingrequest_types.go
+++ b/pkg/apis/apps/v1alpha1/servicebindingrequest_types.go
@@ -69,6 +69,7 @@ type ApplicationSelector struct {
 	Group       string            `json:"group,omitempty"`
 	Version     string            `json:"version"`
 	Resource    string            `json:"resource"`
+	ResourceRef string            `json:"resourceRef"`
 }
 
 // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
diff --git a/pkg/controller/servicebindingrequest/binder.go b/pkg/controller/servicebindingrequest/binder.go
index 1276d126..c3d5df59 100644
--- a/pkg/controller/servicebindingrequest/binder.go
+++ b/pkg/controller/servicebindingrequest/binder.go
@@ -10,6 +10,7 @@ import (
 	"k8s.io/apimachinery/pkg/api/errors"
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
 	"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
+	"k8s.io/apimachinery/pkg/fields"
 	"k8s.io/apimachinery/pkg/labels"
 	"k8s.io/apimachinery/pkg/runtime"
 	"k8s.io/apimachinery/pkg/runtime/schema"
@@ -44,15 +45,28 @@ func (b *Binder) search() (*unstructured.UnstructuredList, error) {
 		Version:  b.sbr.Spec.ApplicationSelector.Version,
 		Resource: b.sbr.Spec.ApplicationSelector.Resource,
 	}
-	matchLabels := b.sbr.Spec.ApplicationSelector.MatchLabels
-	opts := metav1.ListOptions{
-		LabelSelector: labels.Set(matchLabels).String(),
+
+	var opts metav1.ListOptions
+
+	// If Application name is present
+	if b.sbr.Spec.ApplicationSelector.ResourceRef != "" {
+		fieldName := make(map[string]string)
+		fieldName["name"] = b.sbr.Spec.ApplicationSelector.ResourceRef
+		opts = metav1.ListOptions{
+			FieldSelector: fields.Set(fieldName).String(),
+		}
+	} else {
+		matchLabels := b.sbr.Spec.ApplicationSelector.MatchLabels
+		opts = metav1.ListOptions{
+			LabelSelector: labels.Set(matchLabels).String(),
+		}
 	}
 
 	objList, err := b.dynClient.Resource(gvr).Namespace(ns).List(opts)
 	if err != nil {
 		return nil, err
 	}
+
 	// Return fake NotFound error explicitly to ensure requeue when objList(^) is empty.
 	if len(objList.Items) == 0 {
 		return nil, errors.NewNotFound(
diff --git a/pkg/controller/servicebindingrequest/reconciler.go b/pkg/controller/servicebindingrequest/reconciler.go
index 76cf791b..a9f7f298 100644
--- a/pkg/controller/servicebindingrequest/reconciler.go
+++ b/pkg/controller/servicebindingrequest/reconciler.go
@@ -2,6 +2,7 @@ package servicebindingrequest
 
 import (
 	"context"
+	"errors"
 	"fmt"
 
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -13,6 +14,7 @@ import (
 	"sigs.k8s.io/controller-runtime/pkg/reconcile"
 	logf "sigs.k8s.io/controller-runtime/pkg/runtime/log"
 
+	"github.com/go-logr/logr"
 	"github.com/redhat-developer/service-binding-operator/pkg/apis/apps/v1alpha1"
 )
 
@@ -119,6 +121,23 @@ func (r *Reconciler) onError(
 	return RequeueOnNotFound(err, requeueAfter)
 }
 
+// checkSBR checks the Service Binding Request
+func checkSBR(sbr *v1alpha1.ServiceBindingRequest, logger logr.Logger) error {
+	// Check if application ResourceRef is present
+	if sbr.Spec.ApplicationSelector.ResourceRef == "" {
+		logger.Info("Spec.ApplicationSelector.ResourceRef not found")
+
+		// Check if MatchLabels is present
+		if sbr.Spec.ApplicationSelector.MatchLabels == nil {
+
+			err := errors.New("NotFoundError")
+			logger.Error(err, "Spec.ApplicationSelector.MatchLabels not found")
+			return err
+		}
+	}
+	return nil
+}
+
 // Reconcile a ServiceBindingRequest by the following steps:
 // 1. Inspecting SBR in order to identify backend service. The service is composed by a CRD name and
 //    kind, and by inspecting "connects-to" label identify the name of service instance;
@@ -145,11 +164,18 @@ func (r *Reconciler) Reconcile(request reconcile.Request) (reconcile.Result, err
 		return RequeueError(err)
 	}
 
+	logger = logger.WithValues("ServiceBindingRequest.Name", sbr.Name)
+	logger.Info("Found service binding request to inspect")
+
 	// splitting instance from it's status
 	sbrStatus := sbr.Status
 
-	logger = logger.WithValues("ServiceBindingRequest.Name", sbr.Name)
-	logger.Info("Found service binding request to inspect")
+	// Check Service Binding Request
+	err = checkSBR(sbr, logger)
+	if err != nil {
+		logger.Error(err, "")
+		return RequeueError(err)
+	}
 
 	//
 	// Planing changes


Test patch:
diff --git a/pkg/controller/servicebindingrequest/binder_test.go b/pkg/controller/servicebindingrequest/binder_test.go
index ae5bb79a..da7d2905 100644
--- a/pkg/controller/servicebindingrequest/binder_test.go
+++ b/pkg/controller/servicebindingrequest/binder_test.go
@@ -28,7 +28,7 @@ func TestBinderNew(t *testing.T) {
 	}
 
 	f := mocks.NewFake(t, ns)
-	sbr := f.AddMockedServiceBindingRequest(name, "ref", matchLabels)
+	sbr := f.AddMockedServiceBindingRequest(name, "ref", "", matchLabels)
 	f.AddMockedUnstructuredDeployment("ref", matchLabels)
 
 	binder := NewBinder(
@@ -90,3 +90,29 @@ func TestBinderNew(t *testing.T) {
 		assert.True(t, parsedTime.Before(time.Now()))
 	})
 }
+
+func TestBinderApplicationName(t *testing.T) {
+	ns := "binder"
+	name := "service-binding-request"
+
+	f := mocks.NewFake(t, ns)
+	sbr := f.AddMockedServiceBindingRequest(name, "backingServiceResourceRef", "applicationResourceRef", nil)
+	f.AddMockedUnstructuredDeployment("ref", nil)
+
+	binder := NewBinder(
+		context.TODO(),
+		f.FakeClient(),
+		f.FakeDynClient(),
+		sbr,
+		[]string{},
+	)
+
+	require.NotNil(t, binder)
+
+	t.Run("search by application name", func(t *testing.T) {
+		list, err := binder.search()
+		assert.Nil(t, err)
+		assert.Equal(t, 1, len(list.Items))
+	})
+
+}
diff --git a/pkg/controller/servicebindingrequest/planner_test.go b/pkg/controller/servicebindingrequest/planner_test.go
index 29a2ee88..c62c2941 100644
--- a/pkg/controller/servicebindingrequest/planner_test.go
+++ b/pkg/controller/servicebindingrequest/planner_test.go
@@ -27,7 +27,7 @@ func TestPlannerNew(t *testing.T) {
 	}
 
 	f := mocks.NewFake(t, ns)
-	sbr := f.AddMockedServiceBindingRequest(name, resourceRef, matchLabels)
+	sbr := f.AddMockedServiceBindingRequest(name, resourceRef, "", matchLabels)
 	f.AddMockedUnstructuredCSV("cluster-service-version")
 	f.AddMockedDatabaseCR(resourceRef)
 
diff --git a/pkg/controller/servicebindingrequest/reconciler_test.go b/pkg/controller/servicebindingrequest/reconciler_test.go
index 35bc05f1..6ab6f907 100644
--- a/pkg/controller/servicebindingrequest/reconciler_test.go
+++ b/pkg/controller/servicebindingrequest/reconciler_test.go
@@ -35,14 +35,14 @@ func reconcileRequest() reconcile.Request {
 }
 
 func TestReconcilerReconcileError(t *testing.T) {
-	resourceRef := "test-using-secret"
+	backingServiceResourceRef := "test-using-secret"
 	matchLabels := map[string]string{
 		"connects-to": "database",
 		"environment": "reconciler",
 	}
 
 	f := mocks.NewFake(t, reconcilerNs)
-	f.AddMockedUnstructuredServiceBindingRequest(reconcilerName, resourceRef, matchLabels)
+	f.AddMockedUnstructuredServiceBindingRequest(reconcilerName, backingServiceResourceRef, "", matchLabels)
 
 	fakeClient := f.FakeClient()
 	fakeDynClient := f.FakeDynClient()
@@ -53,20 +53,52 @@ func TestReconcilerReconcileError(t *testing.T) {
 	assert.True(t, res.Requeue)
 }
 
+// TestApplicationSelectorByName tests discovery of application by name
+func TestApplicationSelectorByName(t *testing.T) {
+	backingServiceResourceRef := "backingServiceRef"
+	applicationResourceRef := "applicationRef"
+	f := mocks.NewFake(t, reconcilerNs)
+	f.AddMockedUnstructuredServiceBindingRequest(reconcilerName, backingServiceResourceRef, applicationResourceRef, nil)
+	f.AddMockedUnstructuredCSV("cluster-service-version-list")
+	f.AddMockedUnstructuredDatabaseCR(backingServiceResourceRef)
+	f.AddMockedUnstructuredDeployment(reconcilerName, nil)
+	f.AddMockedSecret("db-credentials")
+
+	fakeClient := f.FakeClient()
+	fakeDynClient := f.FakeDynClient()
+	reconciler := &Reconciler{client: fakeClient, dynClient: fakeDynClient, scheme: f.S}
+
+	t.Run("test-application-selector-by-name", func(t *testing.T) {
+
+		res, err := reconciler.Reconcile(reconcileRequest())
+		assert.NoError(t, err)
+		assert.False(t, res.Requeue)
+
+		namespacedName := types.NamespacedName{Namespace: reconcilerNs, Name: reconcilerName}
+		sbrOutput, err := reconciler.getServiceBindingRequest(namespacedName)
+		require.NoError(t, err)
+
+		require.Equal(t, "Success", sbrOutput.Status.BindingStatus)
+		require.Equal(t, 1, len(sbrOutput.Status.ApplicationObjects))
+		expectedStatus := fmt.Sprintf("%s/%s", reconcilerNs, reconcilerName)
+		assert.Equal(t, expectedStatus, sbrOutput.Status.ApplicationObjects[0])
+	})
+}
+
 // TestReconcilerReconcileUsingSecret test the reconciliation process using a secret, expected to be
 // the regular approach.
 func TestReconcilerReconcileUsingSecret(t *testing.T) {
 	ctx := context.TODO()
-	resourceRef := "test-using-secret"
+	backingServiceResourceRef := "test-using-secret"
 	matchLabels := map[string]string{
 		"connects-to": "database",
 		"environment": "reconciler",
 	}
 
 	f := mocks.NewFake(t, reconcilerNs)
-	f.AddMockedUnstructuredServiceBindingRequest(reconcilerName, resourceRef, matchLabels)
+	f.AddMockedUnstructuredServiceBindingRequest(reconcilerName, backingServiceResourceRef, "", matchLabels)
 	f.AddMockedUnstructuredCSV("cluster-service-version-list")
-	f.AddMockedUnstructuredDatabaseCR(resourceRef)
+	f.AddMockedUnstructuredDatabaseCR(backingServiceResourceRef)
 	f.AddMockedUnstructuredDeployment(reconcilerName, matchLabels)
 	f.AddMockedSecret("db-credentials")
 
@@ -104,16 +136,16 @@ func TestReconcilerReconcileUsingSecret(t *testing.T) {
 
 func TestReconcilerReconcileUsingVolumes(t *testing.T) {
 	ctx := context.TODO()
-	resourceRef := "test-using-volumes"
+	backingServiceResourceRef := "test-using-volumes"
 	matchLabels := map[string]string{
 		"connects-to": "database",
 		"environment": "reconciler",
 	}
 
 	f := mocks.NewFake(t, reconcilerNs)
-	f.AddMockedUnstructuredServiceBindingRequest(reconcilerName, resourceRef, matchLabels)
+	f.AddMockedUnstructuredServiceBindingRequest(reconcilerName, backingServiceResourceRef, "", matchLabels)
 	f.AddMockedUnstructuredCSVWithVolumeMount("cluster-service-version-list")
-	f.AddMockedUnstructuredDatabaseCR(resourceRef)
+	f.AddMockedUnstructuredDatabaseCR(backingServiceResourceRef)
 	f.AddMockedUnstructuredDeployment(reconcilerName, matchLabels)
 	f.AddMockedSecret("db-credentials")
 
diff --git a/test/e2e/servicebindingrequest_test.go b/test/e2e/servicebindingrequest_test.go
index 9299cc55..71d65b77 100644
--- a/test/e2e/servicebindingrequest_test.go
+++ b/test/e2e/servicebindingrequest_test.go
@@ -249,7 +249,7 @@ func serviceBindingRequestTest(t *testing.T, ctx *framework.TestCtx, f *framewor
 
 	// creating service-binding-request, which will trigger actions in the controller
 	t.Log("Creating ServiceBindingRequest mock object...")
-	sbr := mocks.ServiceBindingRequestMock(ns, name, resourceRef, matchLabels)
+	sbr := mocks.ServiceBindingRequestMock(ns, name, resourceRef, "", matchLabels)
 	// making sure object does not exist before testing
 	_ = f.Client.Delete(todoCtx, sbr)
 	require.Nil(t, f.Client.Create(todoCtx, sbr, cleanUpOptions(ctx)))
@@ -328,7 +328,7 @@ func preCreateServiceBindingRequestTest(t *testing.T, ctx *framework.TestCtx, f
 
 	// creating service-binding-request, which will trigger actions in the controller
 	t.Log("Creating ServiceBindingRequest mock object...")
-	sbr := mocks.ServiceBindingRequestMock(ns, name, resourceRef, matchLabels)
+	sbr := mocks.ServiceBindingRequestMock(ns, name, resourceRef, "", matchLabels)
 	// making sure object does not exist before testing
 	_ = f.Client.Delete(todoCtx, sbr)
 	require.Nil(t, f.Client.Create(todoCtx, sbr, cleanUpOptions(ctx)))
diff --git a/test/mocks/fake.go b/test/mocks/fake.go
index 4feac59d..a3f8b3f3 100644
--- a/test/mocks/fake.go
+++ b/test/mocks/fake.go
@@ -30,22 +30,24 @@ type Fake struct {
 // AddMockedServiceBindingRequest add mocked object from ServiceBindingRequestMock.
 func (f *Fake) AddMockedServiceBindingRequest(
 	name string,
-	ref string,
+	backingServiceResourceRef string,
+	applicationResourceRef string,
 	matchLabels map[string]string,
 ) *v1alpha1.ServiceBindingRequest {
 	f.S.AddKnownTypes(v1alpha1.SchemeGroupVersion, &v1alpha1.ServiceBindingRequest{})
-	sbr := ServiceBindingRequestMock(f.ns, name, ref, matchLabels)
+	sbr := ServiceBindingRequestMock(f.ns, name, backingServiceResourceRef, applicationResourceRef, matchLabels)
 	f.objs = append(f.objs, sbr)
 	return sbr
 }
 
 func (f *Fake) AddMockedUnstructuredServiceBindingRequest(
 	name string,
-	ref string,
+	backingServiceResourceRef string,
+	applicationResourceRef string,
 	matchLabels map[string]string,
 ) *unstructured.Unstructured {
 	f.S.AddKnownTypes(v1alpha1.SchemeGroupVersion, &v1alpha1.ServiceBindingRequest{})
-	sbr, err := UnstructuredServiceBindingRequestMock(f.ns, name, ref, matchLabels)
+	sbr, err := UnstructuredServiceBindingRequestMock(f.ns, name, backingServiceResourceRef, applicationResourceRef, matchLabels)
 	require.Nil(f.t, err)
 	f.objs = append(f.objs, sbr)
 	return sbr
diff --git a/test/mocks/mocks.go b/test/mocks/mocks.go
index f513a6d2..f6ea5cf1 100644
--- a/test/mocks/mocks.go
+++ b/test/mocks/mocks.go
@@ -284,7 +284,8 @@ func ConfigMapMock(ns, name string) *corev1.ConfigMap {
 func ServiceBindingRequestMock(
 	ns string,
 	name string,
-	resourceRef string,
+	backingServiceResourceRef string,
+	applicationResourceRef string,
 	matchLabels map[string]string,
 ) *v1alpha1.ServiceBindingRequest {
 	return &v1alpha1.ServiceBindingRequest{
@@ -298,12 +299,13 @@ func ServiceBindingRequestMock(
 				Group:       CRDName,
 				Version:     CRDVersion,
 				Kind:        CRDKind,
-				ResourceRef: resourceRef,
+				ResourceRef: backingServiceResourceRef,
 			},
 			ApplicationSelector: v1alpha1.ApplicationSelector{
 				Group:       "apps",
 				Version:     "v1",
 				Resource:    "deployments",
+				ResourceRef: applicationResourceRef,
 				MatchLabels: matchLabels,
 			},
 			CustomEnvVar: []v1alpha1.CustomEnvMap{
@@ -320,10 +322,11 @@ func ServiceBindingRequestMock(
 func UnstructuredServiceBindingRequestMock(
 	ns string,
 	name string,
-	resourceRef string,
+	backingServiceResourceRef string,
+	applicationResourceRef string,
 	matchLabels map[string]string,
 ) (*unstructured.Unstructured, error) {
-	sbr := ServiceBindingRequestMock(ns, name, resourceRef, matchLabels)
+	sbr := ServiceBindingRequestMock(ns, name, backingServiceResourceRef, applicationResourceRef, matchLabels)
 	data, err := runtime.DefaultUnstructuredConverter.ToUnstructured(&sbr)
 	if err != nil {
 		return nil, err