Skip to content

Commit

Permalink
feat(cmd/run): warn when using path on --config
Browse files Browse the repository at this point in the history
Ref #2003
  • Loading branch information
squakez authored and astefanutti committed Jun 16, 2021
1 parent 18f34ac commit 4465e1a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/modules/ROOT/pages/cli/modeline.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand All @@ -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`
Expand Down
4 changes: 4 additions & 0 deletions pkg/cmd/run_help.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down

0 comments on commit 4465e1a

Please sign in to comment.