davsclaus commented on code in PR #30024:
URL: https://github.com/apache/camel/pull/30024#discussion_r4578942519


##########
dsl/camel-jbang/camel-jbang-plugin-kubernetes/src/main/java/org/apache/camel/dsl/jbang/core/commands/kubernetes/KubernetesRun.java:
##########
@@ -904,6 +888,38 @@ void detectCluster() {
         }
     }
 
+    /**
+     * The properties of --property: a key=value, or the properties of a file 
(file:path, or a path). A key=value is a
+     * property also when its value is a path, such as camel.server.path=/api, 
which was taken for a file that does not
+     * exist and silently left out (CAMEL-26934).
+     *
+     * @throws CliException with exit code 66 for a properties file that does 
not exist
+     */
+    static String[] mergeProperties(String[] properties) throws IOException {
+        List<String> definiteProperties = new ArrayList<>();
+        for (String p : properties) {
+            int eq = p.indexOf('=');
+            String key = eq > 0 ? p.substring(0, eq) : null;
+            boolean keyValue = key != null && !key.contains("/") && 
!key.contains(File.separator);
+            if (p.startsWith("file:") || !keyValue) {
+                String filename = p.startsWith("file:") ? 
p.substring("file:".length()) : p;
+                File f = new File(filename);
+                if (!f.isFile()) {
+                    throw CliException.fileNotFound(
+                            "Properties file does not exist: " + filename + " 
(a property is given as key=value)");

Review Comment:
   Fixed in 312a97809313: the key=value hint is only added when the value is 
not file:path.
   
   _Claude Code on behalf of davsclaus_



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to