Repository: knative-sandbox/eventing-kafka
Pull request #244 (2020-12-01 10:55:46)

[Backport] fix label consistency
Backport of #242 

knative-prow-robot: [APPROVALNOTIFIER] This PR is **NOT APPROVED**

This pull-request has been approved by: *<a href="https://github.com/knative-sandbox/eventing-kafka/pull/244#" title="Author self-approved">skonto</a>*
To complete the [pull request process](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process), please assign **phamilton** after the PR has been reviewed.
You can assign the PR to them by writing `/assign @phamilton` 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=knative-sandbox%2Feventing-kafka).

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

- **[OWNERS](https://github.com/knative-sandbox/eventing-kafka/blob/release-0.19/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":["phamilton"]} -->
knative-prow-robot: Hi @skonto. Thanks for your PR.

I'm waiting for a [knative-sandbox](https://github.com/orgs/knative-sandbox/people) member to verify that this patch is reasonable to test. If it is, they should reply with `/ok-to-test` on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should [join the org](https://github.com/orgs/knative-sandbox/people) to skip this step.

Once the patch is verified, the new status will be reflected by the `ok-to-test` label.

I understand the commands that are listed [here](https://go.k8s.io/bot-commands?repo=knative-sandbox%2Feventing-kafka).

<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.
</details>

codecov[bot]: # [Codecov](https://codecov.io/gh/knative-sandbox/eventing-kafka/pull/244?src=pr&el=h1) Report
> :exclamation: No coverage uploaded for pull request base (`release-0.19@3844a7e`). [Click here to learn what that means](https://docs.codecov.io/docs/error-reference#section-missing-base-commit).
> The diff coverage is `n/a`.

[![Impacted file tree graph](https://codecov.io/gh/knative-sandbox/eventing-kafka/pull/244/graphs/tree.svg?width=650&height=150&src=pr&token=W765CT93QC)](https://codecov.io/gh/knative-sandbox/eventing-kafka/pull/244?src=pr&el=tree)

```diff
@@               Coverage Diff               @@
##             release-0.19     #244   +/-   ##
===============================================
  Coverage                ?   75.95%           
===============================================
  Files                   ?      112           
  Lines                   ?     4258           
  Branches                ?        0           
===============================================
  Hits                    ?     3234           
  Misses                  ?      829           
  Partials                ?      195           
```



------

[Continue to review full report at Codecov](https://codecov.io/gh/knative-sandbox/eventing-kafka/pull/244?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/knative-sandbox/eventing-kafka/pull/244?src=pr&el=footer). Last update [3844a7e...cc6102f](https://codecov.io/gh/knative-sandbox/eventing-kafka/pull/244?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

knative-prow-robot: [APPROVALNOTIFIER] This PR is **APPROVED**

This pull-request has been approved by: *<a href="https://github.com/knative-sandbox/eventing-kafka/pull/244#pullrequestreview-541784117" title="Approved">matzew</a>*, *<a href="https://github.com/knative-sandbox/eventing-kafka/pull/244#" title="Author self-approved">skonto</a>*

The full list of commands accepted by this bot can be found [here](https://go.k8s.io/bot-commands?repo=knative-sandbox%2Feventing-kafka).

The pull request process is described [here](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process)

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

- ~~[OWNERS](https://github.com/knative-sandbox/eventing-kafka/blob/release-0.19/OWNERS)~~ [matzew]

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

Patch:
diff --git a/pkg/source/reconciler/source/resources/labels.go b/pkg/source/reconciler/source/resources/labels.go
index b0658d674..048b91850 100644
--- a/pkg/source/reconciler/source/resources/labels.go
+++ b/pkg/source/reconciler/source/resources/labels.go
@@ -25,6 +25,6 @@ const (
 func GetLabels(name string) map[string]string {
 	return map[string]string{
 		"eventing.knative.dev/source":     controllerAgentName,
-		"eventing.knative.dev/SourceName": name,
+		"eventing.knative.dev/sourceName": name,
 	}
 }


Test patch:
diff --git a/pkg/source/reconciler/source/resources/labels_test.go b/pkg/source/reconciler/source/resources/labels_test.go
index 0f7b4bc21..d2d302878 100644
--- a/pkg/source/reconciler/source/resources/labels_test.go
+++ b/pkg/source/reconciler/source/resources/labels_test.go
@@ -28,7 +28,7 @@ func TestGetLabels(t *testing.T) {
 
 	wantLabels := map[string]string{
 		"eventing.knative.dev/source":     "kafka-source-controller",
-		"eventing.knative.dev/SourceName": "testSourceName",
+		"eventing.knative.dev/sourceName": "testSourceName",
 	}
 
 	eq := cmp.Equal(testLabels, wantLabels)
diff --git a/test/e2e/helpers/kafka_helper.go b/test/e2e/helpers/kafka_helper.go
index 2d36acf1b..012eaa01b 100644
--- a/test/e2e/helpers/kafka_helper.go
+++ b/test/e2e/helpers/kafka_helper.go
@@ -269,7 +269,7 @@ func CheckKafkaSourceState(ctx context.Context, c *testlib.Client, name string,
 //On timeout reports error
 func CheckRADeployment(ctx context.Context, c *testlib.Client, name string, inState func(deps *appsv1.DeploymentList) (bool, error)) error {
 	listOptions := metav1.ListOptions{
-		LabelSelector: fmt.Sprintf("%s=%s", "eventing.knative.dev/SourceName", name),
+		LabelSelector: fmt.Sprintf("%s=%s", "eventing.knative.dev/sourceName", name),
 	}
 	kDeps := c.Kube.AppsV1().Deployments(c.Namespace)
 	var lastState *appsv1.DeploymentList