Skip to content

Commit

Permalink
[ST] Add check for passing the ConfigMap field to env variable using …
Browse files Browse the repository at this point in the history
…Connect Container template (#10909)

Signed-off-by: Lukas Kral <[email protected]>
  • Loading branch information
im-konge authored Dec 4, 2024
1 parent 2b810bb commit 0c0ef02
Showing 1 changed file with 15 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,22 @@ void testConnectWithConnectorUsingConfigAndEnvProvider() {
.addToConfig("config.providers.env.class", "org.apache.kafka.common.config.provider.EnvVarConfigProvider")
.editOrNewExternalConfiguration()
.addNewEnv()
.withName("FILE_SINK_FILE")
.withNewValueFrom()
.withNewConfigMapKeyRef("file", cmName, false)
.endValueFrom()
.withName("FILE_SINK_FILE")
.withNewValueFrom()
.withNewConfigMapKeyRef("file", cmName, false)
.endValueFrom()
.endEnv()
.endExternalConfiguration()
.editOrNewTemplate()
.editOrNewConnectContainer()
.addNewEnv()
.withName("FILE_SINK_TOPICS")
.withNewValueFrom()
.withNewConfigMapKeyRef("topics", cmName, false)
.endValueFrom()
.endEnv()
.endConnectContainer()
.endTemplate()
.endSpec()
.build());

Expand Down Expand Up @@ -174,7 +184,7 @@ void testConnectWithConnectorUsingConfigAndEnvProvider() {
.addToConfig("file", "${env:FILE_SINK_FILE}")
.addToConfig("key.converter", "${" + configPrefix + "key}")
.addToConfig("value.converter", "${" + configPrefix + "value}")
.addToConfig("topics", "${" + configPrefix + "topics}")
.addToConfig("topics", "${env:FILE_SINK_TOPICS}")
.endSpec()
.build());

Expand Down

0 comments on commit 0c0ef02

Please sign in to comment.