This is an automated email from the ASF dual-hosted git repository.
davsclaus 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 0a71b62793d CAMEL-18171: camel-kubernetes - Add secret/configmap
property placeholder function.
0a71b62793d is described below
commit 0a71b62793d9f85957e9163506b1f7e424c9b9ac
Author: Claus Ibsen <[email protected]>
AuthorDate: Mon Jun 27 17:42:03 2022 +0200
CAMEL-18171: camel-kubernetes - Add secret/configmap property placeholder
function.
---
.../kubernetes/properties/BasePropertiesFunction.java | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git
a/components/camel-kubernetes/src/main/java/org/apache/camel/component/kubernetes/properties/BasePropertiesFunction.java
b/components/camel-kubernetes/src/main/java/org/apache/camel/component/kubernetes/properties/BasePropertiesFunction.java
index f4224e92a34..46ac5af6753 100644
---
a/components/camel-kubernetes/src/main/java/org/apache/camel/component/kubernetes/properties/BasePropertiesFunction.java
+++
b/components/camel-kubernetes/src/main/java/org/apache/camel/component/kubernetes/properties/BasePropertiesFunction.java
@@ -50,7 +50,7 @@ import org.slf4j.LoggerFactory;
abstract class BasePropertiesFunction extends ServiceSupport implements
PropertiesFunction, CamelContextAware {
// keys in application.properties
- public static final String CLIENT_ENABLED =
"camel.kubernetes.client-enabled";
+ public static final String CLIENT_ENABLED =
"camel.kubernetes.client.enabled";
public static final String MOUNT_PATH_CONFIGMAPS =
"camel.kubernetes.mount-path-configmaps";
public static final String MOUNT_PATH_SECRETS =
"camel.kubernetes.mount-path-secrets";
@@ -90,8 +90,11 @@ abstract class BasePropertiesFunction extends ServiceSupport
implements Properti
// try to auto-configure via properties
PropertiesComponent pc = camelContext.getPropertiesComponent();
OrderedLocationProperties properties = (OrderedLocationProperties)
pc
- .loadProperties(k ->
k.startsWith("camel.kubernetes-client.") ||
k.startsWith("camel.kubernetesClient."),
- k -> k.replace("camel.kubernetes-client.",
"").replace("camel.kubernetesClient.", ""));
+ .loadProperties(k ->
k.startsWith("camel.kubernetes.client."),
+ k -> k.replace("camel.kubernetes.client.", ""));
+ // used for enabling this
+ properties.remove("enabled");
+
if (!properties.isEmpty()) {
ConfigBuilder config = new ConfigBuilder();
@@ -132,7 +135,7 @@ abstract class BasePropertiesFunction extends
ServiceSupport implements Properti
}
if (!copy.isEmpty()) {
for (var e : copy.entrySet()) {
- LOG.warn("Property not auto-configured:
camel.kubernetes-client.{}={}", e.getKey(), e.getValue());
+ LOG.warn("Property not auto-configured:
camel.kubernetes.client.{}={}", e.getKey(), e.getValue());
}
}
} else {