This is an automated email from the ASF dual-hosted git repository.
claudio4j pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push:
new 57636af921c camel-jbang: Add more tests for run and kubernetes run
commands (#19312)
57636af921c is described below
commit 57636af921c2934ec9080d5352890b18aceb6190
Author: Claudio Miranda <[email protected]>
AuthorDate: Wed Sep 24 16:27:08 2025 +0100
camel-jbang: Add more tests for run and kubernetes run commands (#19312)
Fix kubernetes run --config as the it was overwriting previous keys
---
.../modules/ROOT/pages/camel-jbang.adoc | 11 ++++
.../camel/dsl/jbang/it/RunCommandITCase.java | 10 ++++
.../dsl/jbang/it/support/JBangTestSupport.java | 18 ++++++
.../test/resources/jbang/it/route-props.properties | 17 ++++++
.../src/test/resources/jbang/it/route-props.yaml | 25 ++++++++
.../core/commands/kubernetes/KubernetesRun.java | 44 ++++++---------
.../commands/kubernetes/traits/MountTrait.java | 12 ++--
.../kubernetes/KubernetesRunCustomTest.java | 66 ++++++++++++++++++++++
.../src/test/resources/test-configmap.yaml | 25 ++++++++
.../src/test/resources/test-multiple-config.yaml | 37 ++++++++++++
.../src/test/resources/test-secret.yaml | 24 ++++++++
.../cli/services/CliLocalContainerService.java | 8 ++-
12 files changed, 265 insertions(+), 32 deletions(-)
diff --git a/docs/user-manual/modules/ROOT/pages/camel-jbang.adoc
b/docs/user-manual/modules/ROOT/pages/camel-jbang.adoc
index 4872054a14c..1133512df94 100644
--- a/docs/user-manual/modules/ROOT/pages/camel-jbang.adoc
+++ b/docs/user-manual/modules/ROOT/pages/camel-jbang.adoc
@@ -561,6 +561,17 @@ And if you have `jq` installed which can format and output
the JSON data in colo
curl -s -H "Accept: application/json" http://0.0.0.0:8080/q/dev/top/ | jq
----
+=== Using properties
+
+To set properties when running a route, you can use the `--property` or
`--properties` parameter from `camel run` command:
+
+* `--property`: sets individual parameters, example:
`--property=my-key=my-value`, you have to add more `--property` in case you
need more parameters.
+* `--properties`: loads a properties file from the local filesystem, example:
`--properties=/var/my-app/config.properties`.
+
+NOTE: You have to use the `=` sign right after the `--property`, as in the
examples above.
+
+If both parameters are used, the properties will be merged in a single
`application.properties` file.
+
[#_using_profiles]
=== Using profiles
diff --git
a/dsl/camel-jbang/camel-jbang-it/src/test/java/org/apache/camel/dsl/jbang/it/RunCommandITCase.java
b/dsl/camel-jbang/camel-jbang-it/src/test/java/org/apache/camel/dsl/jbang/it/RunCommandITCase.java
index fe1bc5d6eb9..95ce86bb7f8 100644
---
a/dsl/camel-jbang/camel-jbang-it/src/test/java/org/apache/camel/dsl/jbang/it/RunCommandITCase.java
+++
b/dsl/camel-jbang/camel-jbang-it/src/test/java/org/apache/camel/dsl/jbang/it/RunCommandITCase.java
@@ -69,6 +69,16 @@ public class RunCommandITCase extends JBangTestSupport {
checkLogContains("Hello Camel from custom integration");
}
+ @Test
+ public void runWithProperties() throws IOException {
+ copyResourceInDataFolder("route-props.yaml");
+ copyResourceInDataFolder("route-props.properties");
+ executeBackground(String.format(
+ "run %s/route-props.yaml --property=a=a --property=b=b
--properties=%s/route-props.properties",
+ mountPoint(), mountPoint()));
+ checkLogContains("Hello Camel with properties a=a b=b my-key=my-val",
5);
+ }
+
@Test
public void runRoutesFromMultipleFilesUsingWildcardTest() {
execute("init one.yaml --directory=/tmp/one");
diff --git
a/dsl/camel-jbang/camel-jbang-it/src/test/java/org/apache/camel/dsl/jbang/it/support/JBangTestSupport.java
b/dsl/camel-jbang/camel-jbang-it/src/test/java/org/apache/camel/dsl/jbang/it/support/JBangTestSupport.java
index c6ad9814660..647763ccfc7 100644
---
a/dsl/camel-jbang/camel-jbang-it/src/test/java/org/apache/camel/dsl/jbang/it/support/JBangTestSupport.java
+++
b/dsl/camel-jbang/camel-jbang-it/src/test/java/org/apache/camel/dsl/jbang/it/support/JBangTestSupport.java
@@ -218,6 +218,13 @@ public abstract class JBangTestSupport {
.contains(contains)));
}
+ protected void checkContainerLogContainsAllOf(int waitForSeconds,
String... contains) {
+ Assertions.assertThatNoException().isThrownBy(() -> Awaitility.await()
+ .atMost(waitForSeconds, TimeUnit.SECONDS)
+ .untilAsserted(() -> Assertions.assertThat(getContainerLogs())
+ .contains(contains)));
+ }
+
protected void checkLogContains(String contains) {
checkLogContains(contains, ASSERTION_WAIT_SECONDS);
}
@@ -282,6 +289,10 @@ public abstract class JBangTestSupport {
return getLogs(null);
}
+ protected String getContainerLogs() {
+ return containerService.getContainerLogs();
+ }
+
protected String getLogs(String route) {
return execute(Optional.ofNullable(route)
.map(r -> String.format("log %s --follow=false", r))
@@ -303,6 +314,13 @@ public abstract class JBangTestSupport {
assertFileInDataFolderExists(resource.getName());
}
+ protected void copyResourceInDataFolder(String filename) throws
IOException {
+ try (InputStream is =
JBangTestSupport.class.getResourceAsStream("/jbang/it/" + filename)) {
+ Files.copy(is, Path.of(containerDataFolder, filename),
StandardCopyOption.REPLACE_EXISTING);
+ }
+ assertFileInDataFolderExists(filename);
+ }
+
protected void newFileInDataFolder(String fileName, String content) {
try (ByteArrayInputStream in = new
ByteArrayInputStream(content.getBytes(StandardCharsets.UTF_8))) {
Files.copy(in, Path.of(containerDataFolder, fileName),
StandardCopyOption.REPLACE_EXISTING);
diff --git
a/dsl/camel-jbang/camel-jbang-it/src/test/resources/jbang/it/route-props.properties
b/dsl/camel-jbang/camel-jbang-it/src/test/resources/jbang/it/route-props.properties
new file mode 100644
index 00000000000..530fec13359
--- /dev/null
+++
b/dsl/camel-jbang/camel-jbang-it/src/test/resources/jbang/it/route-props.properties
@@ -0,0 +1,17 @@
+## ---------------------------------------------------------------------------
+## Licensed to the Apache Software Foundation (ASF) under one or more
+## contributor license agreements. See the NOTICE file distributed with
+## this work for additional information regarding copyright ownership.
+## The ASF licenses this file to You under the Apache License, Version 2.0
+## (the "License"); you may not use this file except in compliance with
+## the License. You may obtain a copy of the License at
+##
+## http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+## ---------------------------------------------------------------------------
+my-key=my-val
diff --git
a/dsl/camel-jbang/camel-jbang-it/src/test/resources/jbang/it/route-props.yaml
b/dsl/camel-jbang/camel-jbang-it/src/test/resources/jbang/it/route-props.yaml
new file mode 100644
index 00000000000..ed6d7c39fbd
--- /dev/null
+++
b/dsl/camel-jbang/camel-jbang-it/src/test/resources/jbang/it/route-props.yaml
@@ -0,0 +1,25 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+- from:
+ uri: "timer:yaml"
+ parameters:
+ period: "1000"
+ steps:
+ - setBody:
+ constant: "Hello Camel with properties a={{a:default}}
b={{b:default}} my-key={{my-key:default}}"
+ - log: "${body}"
diff --git
a/dsl/camel-jbang/camel-jbang-plugin-kubernetes/src/main/java/org/apache/camel/dsl/jbang/core/commands/kubernetes/KubernetesRun.java
b/dsl/camel-jbang/camel-jbang-plugin-kubernetes/src/main/java/org/apache/camel/dsl/jbang/core/commands/kubernetes/KubernetesRun.java
index 7fcd4dcfb46..aaa69433047 100644
---
a/dsl/camel-jbang/camel-jbang-plugin-kubernetes/src/main/java/org/apache/camel/dsl/jbang/core/commands/kubernetes/KubernetesRun.java
+++
b/dsl/camel-jbang/camel-jbang-plugin-kubernetes/src/main/java/org/apache/camel/dsl/jbang/core/commands/kubernetes/KubernetesRun.java
@@ -30,6 +30,7 @@ import java.util.Map;
import java.util.Properties;
import java.util.Set;
import java.util.Stack;
+import java.util.StringJoiner;
import java.util.concurrent.TimeUnit;
import io.fabric8.kubernetes.api.model.Pod;
@@ -44,6 +45,7 @@ import
org.apache.camel.dsl.jbang.core.commands.CamelJBangMain;
import org.apache.camel.dsl.jbang.core.commands.CommandHelper;
import org.apache.camel.dsl.jbang.core.commands.RunHelper;
import org.apache.camel.dsl.jbang.core.commands.kubernetes.traits.BaseTrait;
+import org.apache.camel.dsl.jbang.core.commands.kubernetes.traits.MountTrait;
import org.apache.camel.dsl.jbang.core.commands.kubernetes.traits.TraitHelper;
import org.apache.camel.dsl.jbang.core.commands.kubernetes.traits.model.Traits;
import org.apache.camel.dsl.jbang.core.common.Printer;
@@ -798,52 +800,42 @@ public class KubernetesRun extends KubernetesBaseCommand {
*/
private void setPropertiesLocation() {
if (configs != null) {
- List<String> propertiesLocation = new ArrayList<>();
+ StringJoiner propertiesLocation = new StringJoiner(",");
for (String c : configs) {
if (c.startsWith("configmap:")) {
String name = c.substring("configmap:".length());
// in case the user has set a property to filter from the
configmap, the "name" var is
// the configmap name and the projected file.
if (name.contains("/")) {
- String rtProperty = String
-
.format("camel.component.properties.location=file:/etc/camel/conf.d/_configmaps/%s",
name);
- propertiesLocation.add(rtProperty);
+ propertiesLocation.add("file:" + MountTrait.CONF_DIR +
MountTrait.CONFIGMAPS + "/" + name);
} else {
// we have to inspect the configmap and retrieve the
key names, as they are
// mapped to the mounted file names.
Set<String> configmapKeys =
retrieveConfigmapKeys(name);
- configmapKeys.forEach(key -> {
- String rtProperty = String.format(
-
"camel.component.properties.location=file:/etc/camel/conf.d/_configmaps/%s/%s",
name, key);
- propertiesLocation.add(rtProperty);
- });
+ configmapKeys.forEach(key -> propertiesLocation
+ .add("file:" + MountTrait.CONF_DIR +
MountTrait.CONFIGMAPS + "/" + name + "/" + key));
}
} else if (c.startsWith("secret:")) {
String name = c.substring("secret:".length());
if (name.contains("/")) {
- String rtProperty
- =
String.format("camel.component.properties.location=file:/etc/camel/conf.d/_secrets/%s",
name);
- propertiesLocation.add(rtProperty);
+ propertiesLocation.add("file:" + MountTrait.CONF_DIR +
MountTrait.SECRETS + "/" + name);
} else {
Set<String> secretKeys = retrieveSecretKeys(name);
- secretKeys.forEach(key -> {
- String rtProperty = String.format(
-
"camel.component.properties.location=file:/etc/camel/conf.d/_secrets/%s/%s",
name, key);
- propertiesLocation.add(rtProperty);
- });
+ secretKeys.forEach(key -> propertiesLocation
+ .add("file:" + MountTrait.CONF_DIR +
MountTrait.SECRETS + "/" + name + "/" + key));
}
}
}
- if (propertiesLocation.size() > 0) {
-
propertiesLocation.add("camel.component.properties.ignore-missing-location=true");
- }
- if (properties == null) {
- properties = propertiesLocation.toArray(new
String[propertiesLocation.size()]);
- } else {
- for (String s : properties) {
- propertiesLocation.add(s);
+ if (propertiesLocation.length() > 0) {
+ List<String> definiteProperties = new ArrayList<>();
+
definiteProperties.add("camel.component.properties.ignore-missing-location=true");
+ definiteProperties.add("camel.component.properties.location="
+ propertiesLocation);
+ if (properties != null && properties.length > 0) {
+ for (String s : properties) {
+ definiteProperties.add(s);
+ }
}
- properties = propertiesLocation.toArray(new
String[propertiesLocation.size()]);
+ properties = definiteProperties.toArray(new
String[definiteProperties.size()]);
}
}
}
diff --git
a/dsl/camel-jbang/camel-jbang-plugin-kubernetes/src/main/java/org/apache/camel/dsl/jbang/core/commands/kubernetes/traits/MountTrait.java
b/dsl/camel-jbang/camel-jbang-plugin-kubernetes/src/main/java/org/apache/camel/dsl/jbang/core/commands/kubernetes/traits/MountTrait.java
index 4cd3532fae5..933afa8cb45 100644
---
a/dsl/camel-jbang/camel-jbang-plugin-kubernetes/src/main/java/org/apache/camel/dsl/jbang/core/commands/kubernetes/traits/MountTrait.java
+++
b/dsl/camel-jbang/camel-jbang-plugin-kubernetes/src/main/java/org/apache/camel/dsl/jbang/core/commands/kubernetes/traits/MountTrait.java
@@ -47,6 +47,10 @@ public class MountTrait extends BaseTrait {
=
Pattern.compile("^([\\w.\\-_:]+)(/([\\w.\\-_:]+))?(@([\\w.\\-_:/]+))?$");
public static final int MOUNT_TRAIT_ORDER =
ContainerTrait.CONTAINER_TRAIT_ORDER + 10;
+ public static final String CONF_DIR = "/etc/camel/conf.d";
+ public static final String RESOURCES_DIR = "/etc/camel/resources.d";
+ public static final String SECRETS = "/_secrets";
+ public static final String CONFIGMAPS = "/_configmaps";
public MountTrait() {
super("mount", MOUNT_TRAIT_ORDER);
@@ -206,15 +210,15 @@ public class MountTrait extends BaseTrait {
String baseMountPoint;
if (mountResource.contentType == MountResource.ContentType.DATA) {
- baseMountPoint = "/etc/camel/resources.d";
+ baseMountPoint = RESOURCES_DIR;
} else {
- baseMountPoint = "/etc/camel/conf.d";
+ baseMountPoint = CONF_DIR;
}
if (mountResource.storageType == MountResource.StorageType.SECRET) {
- baseMountPoint += "/_secrets";
+ baseMountPoint += SECRETS;
} else {
- baseMountPoint += "/_configmaps";
+ baseMountPoint += CONFIGMAPS;
}
return Path.of(baseMountPoint, mountResource.name).toString();
diff --git
a/dsl/camel-jbang/camel-jbang-plugin-kubernetes/src/test/java/org/apache/camel/dsl/jbang/core/commands/kubernetes/KubernetesRunCustomTest.java
b/dsl/camel-jbang/camel-jbang-plugin-kubernetes/src/test/java/org/apache/camel/dsl/jbang/core/commands/kubernetes/KubernetesRunCustomTest.java
index 2f99a8331cf..7056dd96df7 100644
---
a/dsl/camel-jbang/camel-jbang-plugin-kubernetes/src/test/java/org/apache/camel/dsl/jbang/core/commands/kubernetes/KubernetesRunCustomTest.java
+++
b/dsl/camel-jbang/camel-jbang-plugin-kubernetes/src/test/java/org/apache/camel/dsl/jbang/core/commands/kubernetes/KubernetesRunCustomTest.java
@@ -17,20 +17,25 @@
package org.apache.camel.dsl.jbang.core.commands.kubernetes;
+import java.io.File;
+import java.io.FileInputStream;
import java.net.HttpURLConnection;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
+import java.util.Properties;
import io.fabric8.kubernetes.api.model.APIGroup;
import io.fabric8.kubernetes.api.model.APIGroupBuilder;
+import io.fabric8.kubernetes.api.model.ConfigMap;
import io.fabric8.kubernetes.api.model.HasMetadata;
import io.fabric8.kubernetes.api.model.Node;
import io.fabric8.kubernetes.api.model.NodeBuilder;
import io.fabric8.kubernetes.api.model.NodeList;
import io.fabric8.kubernetes.api.model.NodeListBuilder;
+import io.fabric8.kubernetes.api.model.Secret;
import io.fabric8.kubernetes.api.model.Service;
import io.fabric8.kubernetes.api.model.apps.Deployment;
import io.fabric8.kubernetes.client.KubernetesClient;
@@ -107,6 +112,43 @@ class KubernetesRunCustomTest {
Assertions.assertEquals(3, resources.size());
}
+ @Test
+ public void runWithProperties() throws Exception {
+ KubernetesHelper.setKubernetesClient(client);
+ setupServerExpectsConfigmap();
+ KubernetesRun command = createCommand(List.of("classpath:route.yaml"),
+ "--runtime=quarkus", "--output=yaml", "--verbose",
"--name=my-route-props", "--disable-auto=true",
+ "--property=a=val-A", "--property=b=val-B",
"--property=file:src/test/resources/my-route-props1.properties",
+ "--config=configmap:multiple-config",
"--config=configmap:test-config", "--config=secret:test-secret");
+ int exit = command.doCall();
+
+ Assertions.assertEquals(0, exit, printer.getOutput());
+
+ Properties materializedProps = new Properties();
+ String propsFilepath =
".camel-jbang-run/my-route-props/src/main/resources/application.properties";
+ Assertions.assertTrue(new File(propsFilepath).exists());
+ try (FileInputStream input = new FileInputStream(new
File(propsFilepath))) {
+ materializedProps.load(input);
+ }
+
+ Assertions.assertTrue(materializedProps.size() > 0, "materialized
properties file is empty");
+ String camelPropLocation =
materializedProps.getProperty("camel.component.properties.location");
+ Assertions.assertNotNull(camelPropLocation,
+ "camel.component.properties.location property not found in
application.properties");
+
Assertions.assertTrue(camelPropLocation.contains("file:/etc/camel/conf.d/_configmaps/multiple-config/game.properties"),
+ "camel.component.properties.location property doesn't contain
expected value
file:/etc/camel/conf.d/_configmaps/multiple-config/game.properties");
+
Assertions.assertTrue(camelPropLocation.contains("file:/etc/camel/conf.d/_configmaps/multiple-config/ui.properties"),
+ "camel.component.properties.location property doesn't contain
expected value
file:/etc/camel/conf.d/_configmaps/multiple-config/ui.properties");
+
Assertions.assertTrue(camelPropLocation.contains("file:/etc/camel/conf.d/_secrets/test-secret/secret.properties"),
+ "camel.component.properties.location property doesn't contain
expected value
file:/etc/camel/conf.d/_configmaps/multiple-config/ui.properties");
+ Assertions.assertEquals("true",
materializedProps.get("camel.component.properties.ignore-missing-location"));
+ // from my-route-props1.properties
+ Assertions.assertEquals("v1", materializedProps.get("k1"));
+ // from the --property parameter
+ Assertions.assertEquals("val-A", materializedProps.get("a"));
+ Assertions.assertEquals("val-B", materializedProps.get("b"));
+ }
+
@Test
@SetEnvironmentVariable(key = "MINIKUBE_ACTIVE_DOCKERD", value = "foo")
@SetEnvironmentVariable(key = "DOCKER_TLS_VERIFY", value = "foo")
@@ -221,6 +263,30 @@ class KubernetesRunCustomTest {
.always();
}
+ private void setupServerExpectsConfigmap() {
+ ConfigMap cm =
client.configMaps().load(getClass().getResourceAsStream("/test-configmap.yaml")).item();
+ Assertions.assertNotNull(cm);
+ Assertions.assertEquals("test-config", cm.getMetadata().getName());
+
server.expect().get().withPath("/api/v1/namespaces/test/configmaps/test-config")
+ .andReturn(HttpURLConnection.HTTP_OK, cm)
+ .always();
+
+ ConfigMap cm2 =
client.configMaps().load(getClass().getResourceAsStream("/test-multiple-config.yaml")).item();
+ Assertions.assertNotNull(cm2);
+ Assertions.assertEquals("multiple-config",
cm2.getMetadata().getName());
+ Assertions.assertNotNull(cm2.getData().get("ui.properties"));
+
server.expect().get().withPath("/api/v1/namespaces/test/configmaps/multiple-config")
+ .andReturn(HttpURLConnection.HTTP_OK, cm2)
+ .always();
+
+ Secret secret =
client.secrets().load(getClass().getResourceAsStream("/test-secret.yaml")).item();
+ Assertions.assertNotNull(secret);
+ Assertions.assertEquals("test-secret", secret.getMetadata().getName());
+
server.expect().get().withPath("/api/v1/namespaces/test/secrets/test-secret")
+ .andReturn(HttpURLConnection.HTTP_OK, secret)
+ .always();
+ }
+
private KubernetesRun createCommand(List<String> files, String... args) {
var argsArr = Optional.ofNullable(args).orElse(new String[0]);
var argsLst = new ArrayList<>(Arrays.asList(argsArr));
diff --git
a/dsl/camel-jbang/camel-jbang-plugin-kubernetes/src/test/resources/test-configmap.yaml
b/dsl/camel-jbang/camel-jbang-plugin-kubernetes/src/test/resources/test-configmap.yaml
new file mode 100644
index 00000000000..d86ccf1dbf7
--- /dev/null
+++
b/dsl/camel-jbang/camel-jbang-plugin-kubernetes/src/test/resources/test-configmap.yaml
@@ -0,0 +1,25 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+kind: ConfigMap
+apiVersion: v1
+metadata:
+ name: test-config
+data:
+ test-route.properties: |
+ foo.application.custom = my-custom-value
+ foo.myroute.endpoint = http://my-site.com
diff --git
a/dsl/camel-jbang/camel-jbang-plugin-kubernetes/src/test/resources/test-multiple-config.yaml
b/dsl/camel-jbang/camel-jbang-plugin-kubernetes/src/test/resources/test-multiple-config.yaml
new file mode 100644
index 00000000000..a63e58037e9
--- /dev/null
+++
b/dsl/camel-jbang/camel-jbang-plugin-kubernetes/src/test/resources/test-multiple-config.yaml
@@ -0,0 +1,37 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+kind: ConfigMap
+apiVersion: v1
+metadata:
+ name: multiple-config
+data:
+ game.properties: |
+ enemies=aliens
+ lives=3
+ my-key=property from game.properties
+ enemies.cheat=true
+ enemies.cheat.level=noGoodRotten
+ secret.code.passphrase=UUDDLRLRBABAS
+ secret.code.allowed=true
+ secret.code.lives=30
+ ui.properties: |
+ color.good=purple
+ color.bad=yellow
+ allow.textmode=true
+ how.nice.to.look=fairlyNice
+ my-key=property from ui.properties
diff --git
a/dsl/camel-jbang/camel-jbang-plugin-kubernetes/src/test/resources/test-secret.yaml
b/dsl/camel-jbang/camel-jbang-plugin-kubernetes/src/test/resources/test-secret.yaml
new file mode 100644
index 00000000000..85193c59cdc
--- /dev/null
+++
b/dsl/camel-jbang/camel-jbang-plugin-kubernetes/src/test/resources/test-secret.yaml
@@ -0,0 +1,24 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+apiVersion: v1
+kind: Secret
+metadata:
+ name: test-secret
+type: Opaque
+data:
+ secret.properties:
bXkta2V5PWEgc2ltcGxlIHBhc3N3b3JkIGZyb20gc2VjcmV0LnByb3BlcnRpZXMK
\ No newline at end of file
diff --git
a/test-infra/camel-test-infra-cli/src/test/java/org/apache/camel/test/infra/cli/services/CliLocalContainerService.java
b/test-infra/camel-test-infra-cli/src/test/java/org/apache/camel/test/infra/cli/services/CliLocalContainerService.java
index 06f171a6048..5c342d06dc0 100644
---
a/test-infra/camel-test-infra-cli/src/test/java/org/apache/camel/test/infra/cli/services/CliLocalContainerService.java
+++
b/test-infra/camel-test-infra-cli/src/test/java/org/apache/camel/test/infra/cli/services/CliLocalContainerService.java
@@ -131,8 +131,12 @@ public class CliLocalContainerService implements
CliService, ContainerService<Cl
execResult.getStderr()));
}
if (LOG.isDebugEnabled()) {
- LOG.debug("result out {}", execResult.getStdout());
- LOG.debug("result error {}", execResult.getStderr());
+ if (StringUtils.isNotBlank(execResult.getStdout())) {
+ LOG.debug("result out {}", execResult.getStdout());
+ }
+ if (StringUtils.isNotBlank(execResult.getStderr())) {
+ LOG.debug("result error {}", execResult.getStderr());
+ }
}
return execResult.getStdout();
} catch (Exception e) {