Repository: knative-sandbox/eventing-kafka-broker
Pull request #2583 (2022-08-31 13:54:31)

nit: Reword misleading error message
Signed-off-by: Matthias Wessendorf <mwessend@redhat.com>

## Proposed Changes

- reword a misleading error message, as it lacked the context of creating the `topicConfig`

<!--
If this change has user-visible impact, follow the instructions below.
Examples include:

- :gift: Add new feature
- :bug: Fix bug
- :broom: Update or clean up current behavior
- :wastebasket: Remove feature or internal logic

Otherwise delete the rest of this template.
-->

**Release Note**

<!--
:page_facing_up: If this change has user-visible impact, write a release note in the block
below. Include the string "action required" if additional action is required of
users switching to the new release, for example in case of a breaking change.

Write as if you are speaking to users, not other Knative contributors. If this
change has no user-visible impact, no release-note is needed.
-->

```release-note

```

**Docs**

<!--
:book: If this change has user-visible impact, link to an issue or PR in
https://github.com/knative/docs.
-->


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

This pull-request has been approved by: *<a href="https://github.com/knative-sandbox/eventing-kafka-broker/pull/2583#" title="Author self-approved">matzew</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-broker).

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-broker/blob/main/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":[]} -->
knative-prow[bot]: [APPROVALNOTIFIER] This PR is **APPROVED**

This pull-request has been approved by: *<a href="https://github.com/knative-sandbox/eventing-kafka-broker/pull/2583#pullrequestreview-1091939651" title="LGTM">aavarghese</a>*, *<a href="https://github.com/knative-sandbox/eventing-kafka-broker/pull/2583#" title="Author self-approved">matzew</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-broker).

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-broker/blob/main/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":[]} -->
knative-prow[bot]: @matzew: The following tests **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
channel-reconciler-tests-sasl-ssl_eventing-kafka-broker_main | 1d895edce1bc4efa80d7816fbfc5fe9209572ffc | [link](https://prow.knative.dev/view/gs/knative-prow/pr-logs/pull/knative-sandbox_eventing-kafka-broker/2583/channel-reconciler-tests-sasl-ssl_eventing-kafka-broker_main/1564974930842357760) | true | `/test channel-reconciler-tests-sasl-ssl_eventing-kafka-broker_main`
upgrade-tests_eventing-kafka-broker_main | 1d895edce1bc4efa80d7816fbfc5fe9209572ffc | [link](https://prow.knative.dev/view/gs/knative-prow/pr-logs/pull/knative-sandbox_eventing-kafka-broker/2583/upgrade-tests_eventing-kafka-broker_main/1564974930473259008) | true | `/test upgrade-tests_eventing-kafka-broker_main`

[Your PR dashboard](https://prow.knative.dev/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 -->
knative-prow[bot]: @matzew: The following tests **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
channel-reconciler-tests-sasl-ssl_eventing-kafka-broker_main | 1d895edce1bc4efa80d7816fbfc5fe9209572ffc | [link](https://prow.knative.dev/view/gs/knative-prow/pr-logs/pull/knative-sandbox_eventing-kafka-broker/2583/channel-reconciler-tests-sasl-ssl_eventing-kafka-broker_main/1564974930842357760) | true | `/test channel-reconciler-tests-sasl-ssl_eventing-kafka-broker_main`
upgrade-tests_eventing-kafka-broker_main | 1d895edce1bc4efa80d7816fbfc5fe9209572ffc | [link](https://prow.knative.dev/view/gs/knative-prow/pr-logs/pull/knative-sandbox_eventing-kafka-broker/2583/upgrade-tests_eventing-kafka-broker_main/1564974930473259008) | true | `/test upgrade-tests_eventing-kafka-broker_main`
channel-integration-tests-sasl-plain_eventing-kafka-broker_main | 1d895edce1bc4efa80d7816fbfc5fe9209572ffc | [link](https://prow.knative.dev/view/gs/knative-prow/pr-logs/pull/knative-sandbox_eventing-kafka-broker/2583/channel-integration-tests-sasl-plain_eventing-kafka-broker_main/1564974930720722944) | true | `/test channel-integration-tests-sasl-plain_eventing-kafka-broker_main`

[Your PR dashboard](https://prow.knative.dev/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 -->
knative-prow[bot]: @matzew: The following tests **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
channel-reconciler-tests-sasl-ssl_eventing-kafka-broker_main | 1d895edce1bc4efa80d7816fbfc5fe9209572ffc | [link](https://prow.knative.dev/view/gs/knative-prow/pr-logs/pull/knative-sandbox_eventing-kafka-broker/2583/channel-reconciler-tests-sasl-ssl_eventing-kafka-broker_main/1564974930842357760) | true | `/test channel-reconciler-tests-sasl-ssl_eventing-kafka-broker_main`
upgrade-tests_eventing-kafka-broker_main | 1d895edce1bc4efa80d7816fbfc5fe9209572ffc | [link](https://prow.knative.dev/view/gs/knative-prow/pr-logs/pull/knative-sandbox_eventing-kafka-broker/2583/upgrade-tests_eventing-kafka-broker_main/1564974930473259008) | true | `/test upgrade-tests_eventing-kafka-broker_main`
channel-integration-tests-sasl-plain_eventing-kafka-broker_main | 1d895edce1bc4efa80d7816fbfc5fe9209572ffc | [link](https://prow.knative.dev/view/gs/knative-prow/pr-logs/pull/knative-sandbox_eventing-kafka-broker/2583/channel-integration-tests-sasl-plain_eventing-kafka-broker_main/1564974930720722944) | true | `/test channel-integration-tests-sasl-plain_eventing-kafka-broker_main`
channel-reconciler-tests-ssl_eventing-kafka-broker_main | 1d895edce1bc4efa80d7816fbfc5fe9209572ffc | [link](https://prow.knative.dev/view/gs/knative-prow/pr-logs/pull/knative-sandbox_eventing-kafka-broker/2583/channel-reconciler-tests-ssl_eventing-kafka-broker_main/1564974930783637504) | true | `/test channel-reconciler-tests-ssl_eventing-kafka-broker_main`

[Your PR dashboard](https://prow.knative.dev/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 -->
matzew: /retest
knative-prow[bot]: @matzew: The following tests **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
upgrade-tests_eventing-kafka-broker_main | 1d895edce1bc4efa80d7816fbfc5fe9209572ffc | [link](https://prow.knative.dev/view/gs/knative-prow/pr-logs/pull/knative-sandbox_eventing-kafka-broker/2583/upgrade-tests_eventing-kafka-broker_main/1564974930473259008) | true | `/test upgrade-tests_eventing-kafka-broker_main`
channel-integration-tests-sasl-plain_eventing-kafka-broker_main | 1d895edce1bc4efa80d7816fbfc5fe9209572ffc | [link](https://prow.knative.dev/view/gs/knative-prow/pr-logs/pull/knative-sandbox_eventing-kafka-broker/2583/channel-integration-tests-sasl-plain_eventing-kafka-broker_main/1564974930720722944) | true | `/test channel-integration-tests-sasl-plain_eventing-kafka-broker_main`
channel-reconciler-tests-ssl_eventing-kafka-broker_main | 1d895edce1bc4efa80d7816fbfc5fe9209572ffc | [link](https://prow.knative.dev/view/gs/knative-prow/pr-logs/pull/knative-sandbox_eventing-kafka-broker/2583/channel-reconciler-tests-ssl_eventing-kafka-broker_main/1564974930783637504) | true | `/test channel-reconciler-tests-ssl_eventing-kafka-broker_main`
channel-reconciler-tests-sasl-ssl_eventing-kafka-broker_main | 1d895edce1bc4efa80d7816fbfc5fe9209572ffc | [link](https://prow.knative.dev/view/gs/knative-prow/pr-logs/pull/knative-sandbox_eventing-kafka-broker/2583/channel-reconciler-tests-sasl-ssl_eventing-kafka-broker_main/1564985079170600960) | true | `/test channel-reconciler-tests-sasl-ssl_eventing-kafka-broker_main`

[Your PR dashboard](https://prow.knative.dev/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 -->
matzew: /test channel-reconciler-tests-sasl-ssl_eventing-kafka-broker_main

Patch:
diff --git a/control-plane/pkg/reconciler/broker/broker.go b/control-plane/pkg/reconciler/broker/broker.go
index 564c5d5d3..b6f957063 100644
--- a/control-plane/pkg/reconciler/broker/broker.go
+++ b/control-plane/pkg/reconciler/broker/broker.go
@@ -464,7 +464,7 @@ func (r *Reconciler) topicConfig(logger *zap.Logger, broker *eventing.Broker) (*
 	topicConfig, err := kafka.TopicConfigFromConfigMap(logger, cm)
 	if err != nil {
 		if isRebuilt {
-			return nil, cm, fmt.Errorf("failed to get configmap %s/%s: %w", r.brokerNamespace(broker), broker.Spec.Config.Name, getCmError)
+			return nil, cm, fmt.Errorf("unable to build topic config, failed to get configmap %s/%s: %w", r.brokerNamespace(broker), broker.Spec.Config.Name, getCmError)
 		}
 		return nil, cm, fmt.Errorf("unable to build topic config from configmap: %w - ConfigMap data: %v", err, cm.Data)
 	}


Test patch:
diff --git a/control-plane/pkg/reconciler/broker/broker_test.go b/control-plane/pkg/reconciler/broker/broker_test.go
index 239f090e8..8b76f88df 100644
--- a/control-plane/pkg/reconciler/broker/broker_test.go
+++ b/control-plane/pkg/reconciler/broker/broker_test.go
@@ -1303,7 +1303,7 @@ func brokerReconciliation(t *testing.T, format string, env config.Env) {
 				Eventf(
 					corev1.EventTypeWarning,
 					"InternalError",
-					fmt.Sprintf(`failed to get contract configuration: failed to get configmap %s/%s: configmap %q not found`, ConfigMapNamespace, ConfigMapName, ConfigMapName),
+					fmt.Sprintf(`failed to get contract configuration: unable to build topic config, failed to get configmap %s/%s: configmap %q not found`, ConfigMapNamespace, ConfigMapName, ConfigMapName),
 				),
 			},
 			SkipNamespaceValidation: true, // WantCreates compare the broker namespace with configmap namespace, so skip it
@@ -1321,7 +1321,7 @@ func brokerReconciliation(t *testing.T, format string, env config.Env) {
 						),
 						reconcilertesting.WithInitBrokerConditions,
 						StatusBrokerDataPlaneAvailable,
-						StatusBrokerConfigNotParsed(fmt.Sprintf(`failed to get configmap %s/%s: configmap %q not found`, ConfigMapNamespace, ConfigMapName, ConfigMapName)),
+						StatusBrokerConfigNotParsed(fmt.Sprintf(`unable to build topic config, failed to get configmap %s/%s: configmap %q not found`, ConfigMapNamespace, ConfigMapName, ConfigMapName)),
 					),
 				},
 			},