You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2023/10/27 08:57:18 UTC

(camel) branch main updated: CAMEL-20054: camel-kubernetes - Fix ENV variable for mount-path to be correct.

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 bdc737e7af0 CAMEL-20054: camel-kubernetes - Fix ENV variable for mount-path to be correct.
bdc737e7af0 is described below

commit bdc737e7af0ce80211948918840b359e144f18aa
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Fri Oct 27 10:57:04 2023 +0200

    CAMEL-20054: camel-kubernetes - Fix ENV variable for mount-path to be correct.
---
 .../kubernetes/properties/BasePropertiesFunction.java         | 11 +++++++----
 .../modules/ROOT/pages/using-propertyplaceholder.adoc         |  2 +-
 2 files changed, 8 insertions(+), 5 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 2399d0a0643..9c003005031 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
@@ -55,8 +55,10 @@ abstract class BasePropertiesFunction extends ServiceSupport implements Properti
     public static final String MOUNT_PATH_SECRETS = "camel.kubernetes-config.mount-path-secrets";
 
     // use camel-k ENV for mount paths
-    public static final String ENV_MOUNT_PATH_CONFIGMAPS = "camel.k.mount-path.configmaps";
-    public static final String ENV_MOUNT_PATH_SECRETS = "camel.k.mount-path.secrets";
+    public static final String JVM_PROP_MOUNT_PATH_CONFIGMAPS = "camel.k.mount-path.configmaps";
+    public static final String ENV_MOUNT_PATH_CONFIGMAPS = "CAMEL_K_MOUNT_PATH_CONFIGMAPS";
+    public static final String JVM_PROP_MOUNT_PATH_SECRETS = "camel.k.mount-path.secrets";
+    public static final String ENV_MOUNT_PATH_SECRETS = "CAMEL_K_MOUNT_PATH_SECRETS";
     private static final Logger LOG = LoggerFactory.getLogger(BasePropertiesFunction.class);
 
     private static final AtomicBoolean LOGGED = new AtomicBoolean();
@@ -87,11 +89,12 @@ abstract class BasePropertiesFunction extends ServiceSupport implements Properti
         }
         if (mountPathConfigMaps == null) {
             mountPathConfigMaps = camelContext.getPropertiesComponent().resolveProperty(MOUNT_PATH_CONFIGMAPS)
-                    .orElseGet(() -> System.getProperty(ENV_MOUNT_PATH_CONFIGMAPS, System.getenv(ENV_MOUNT_PATH_CONFIGMAPS)));
+                    .orElseGet(
+                            () -> System.getProperty(JVM_PROP_MOUNT_PATH_CONFIGMAPS, System.getenv(ENV_MOUNT_PATH_CONFIGMAPS)));
         }
         if (mountPathSecrets == null) {
             mountPathSecrets = camelContext.getPropertiesComponent().resolveProperty(MOUNT_PATH_SECRETS)
-                    .orElseGet(() -> System.getProperty(ENV_MOUNT_PATH_SECRETS, System.getenv(ENV_MOUNT_PATH_SECRETS)));
+                    .orElseGet(() -> System.getProperty(JVM_PROP_MOUNT_PATH_SECRETS, System.getenv(ENV_MOUNT_PATH_SECRETS)));
         }
         if (clientEnabled && client == null) {
             client = CamelContextHelper.findSingleByType(camelContext, KubernetesClient.class);
diff --git a/docs/user-manual/modules/ROOT/pages/using-propertyplaceholder.adoc b/docs/user-manual/modules/ROOT/pages/using-propertyplaceholder.adoc
index d8bc0bda9ac..baae2a53925 100644
--- a/docs/user-manual/modules/ROOT/pages/using-propertyplaceholder.adoc
+++ b/docs/user-manual/modules/ROOT/pages/using-propertyplaceholder.adoc
@@ -566,7 +566,7 @@ The configuration of the _mount path_ are used by the given order:
 1. Reading configuration property with keys `camel.kubernetes-config.mount-path-configmaps`
 and `camel.kubernetes-config.mount-path-secrets`.
 2. Use JVM system property with key `camel.k.mount-path.configmaps` and `camel.k.mount-path.secrets` (Camel K compatible).
-3. Use OS ENV variable with key `camel.k.mount-path.configmaps` and `camel.k.mount-path.secrets` (Camel K compatible).
+3. Use OS ENV variable with key `CAMEL_K_MOUNT_PATH_CONFIGMAPS` and `CAMEL_K_MOUNT_PATH_SECRETS` (Camel K compatible).
 
 For example to use `/etc/camel/resources/` as mount path, you can configure this in the `application.properties`: