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:50 UTC

(camel) branch camel-3.x 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 camel-3.x
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/camel-3.x by this push:
     new 74d6bd81a51 CAMEL-20054: camel-kubernetes - Fix ENV variable for mount-path to be correct.
74d6bd81a51 is described below

commit 74d6bd81a51e4b10cb8d097d48a73871321eb4b3
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 d2a313354e1..ac55e24cd81 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
@@ -56,8 +56,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();
@@ -88,11 +90,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 8dd39d5132c..5149a86d64c 100644
--- a/docs/user-manual/modules/ROOT/pages/using-propertyplaceholder.adoc
+++ b/docs/user-manual/modules/ROOT/pages/using-propertyplaceholder.adoc
@@ -549,7 +549,7 @@ The configuration of the _month 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`: