This is an automated email from the ASF dual-hosted git repository.

astefanutti pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit 4465e1a8bd6fb6e036bf79b19c8d84a2db890208
Author: Pasquale Congiusti <[email protected]>
AuthorDate: Mon Jun 7 14:44:59 2021 +0200

    feat(cmd/run): warn when using path on --config
    
    Ref #2003
---
 docs/modules/ROOT/pages/cli/modeline.adoc | 4 ++--
 pkg/cmd/run_help.go                       | 4 ++++
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/docs/modules/ROOT/pages/cli/modeline.adoc 
b/docs/modules/ROOT/pages/cli/modeline.adoc
index e4daff5..ac1b734 100644
--- a/docs/modules/ROOT/pages/cli/modeline.adoc
+++ b/docs/modules/ROOT/pages/cli/modeline.adoc
@@ -70,7 +70,7 @@ The following is a partial list of useful options:
 |Add a build time property or properties file (syntax: 
_[my-key=my-value\|file:/path/to/my-conf.properties]_
 
 |config
-|Add a runtime configuration from a Configmap, a Secret or a file (syntax: 
_[configmap\|secret\|file]:name[/key])_
+|Add a runtime configuration from a Configmap, a Secret or a file (syntax: 
_[configmap\|secret\|file]:name[/key]_)
 
 |dependency
 |An external library that should be included, e.g. for Maven dependencies 
`dependency=mvn:org.my:app:1.0`
@@ -94,7 +94,7 @@ The following is a partial list of useful options:
 |Add a runtime property or properties file (syntax: 
_[my-key=my-value\|file:/path/to/my-conf.properties]_)
 
 |resource
-|Add a runtime resource from a Configmap, a Secret or a file (syntax: 
_[configmap\|secret\|file]:name[/key][@path])_
+|Add a runtime resource from a Configmap, a Secret or a file (syntax: 
_[configmap\|secret\|file]:name[/key][@path]_)
 
 |trait
 |Configure a trait, e.g. `trait=service.enabled=false`
diff --git a/pkg/cmd/run_help.go b/pkg/cmd/run_help.go
index d117bf8..0fe8ee1 100644
--- a/pkg/cmd/run_help.go
+++ b/pkg/cmd/run_help.go
@@ -220,6 +220,10 @@ func applyOption(config *RunConfigOption, integrationSpec 
*v1.IntegrationSpec,
 
 // ApplyConfigOption will set the proper --config option behavior to the 
IntegrationSpec
 func ApplyConfigOption(config *RunConfigOption, integrationSpec 
*v1.IntegrationSpec, c client.Client, namespace string, enableCompression bool) 
error {
+       // A config option cannot specify destination path
+       if config.DestinationPath() != "" {
+               return fmt.Errorf("cannot specify a destination path for this 
option type")
+       }
        return applyOption(config, integrationSpec, c, namespace, 
enableCompression, v1.ResourceTypeConfig)
 }
 

Reply via email to