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

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


The following commit(s) were added to refs/heads/master by this push:
     new d412e9b  Unable to run the polyglot sample #1300
d412e9b is described below

commit d412e9b4b156d14929202b747a2d640695209fdd
Author: lburgazzoli <lburgazz...@gmail.com>
AuthorDate: Wed Feb 26 11:34:29 2020 +0100

    Unable to run the polyglot sample #1300
---
 pkg/cmd/run.go | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/pkg/cmd/run.go b/pkg/cmd/run.go
index 3755b6c..918c694 100644
--- a/pkg/cmd/run.go
+++ b/pkg/cmd/run.go
@@ -131,6 +131,10 @@ func (o *runCmdOptions) decode(cmd *cobra.Command, args 
[]string) error {
                return err
        }
 
+       if err := o.validate(); err != nil {
+               return err
+       }
+
        name := o.GetIntegrationName(args)
        if name != "" {
                secondaryPath := pathToRoot + ".integration." + name
@@ -139,16 +143,13 @@ func (o *runCmdOptions) decode(cmd *cobra.Command, args 
[]string) error {
                }
        }
 
-       return nil
+       return o.validate()
 }
 
 func (o *runCmdOptions) validateArgs(_ *cobra.Command, args []string) error {
        if len(args) < 1 {
                return errors.New("run expects at least 1 argument, received 0")
        }
-       if len(args) > 1 && o.IntegrationName == "" {
-               return errors.New("integration name is mandatory when using 
multiple sources")
-       }
 
        for _, fileName := range args {
                if !isRemoteHTTPFile(fileName) {
@@ -172,6 +173,11 @@ func (o *runCmdOptions) validateArgs(_ *cobra.Command, 
args []string) error {
                }
        }
 
+       return nil
+}
+
+func (o *runCmdOptions) validate() error {
+
        for _, volume := range o.Volumes {
                volumeConfig := strings.Split(volume, ":")
                if len(volumeConfig) != 2 || 
len(strings.TrimSpace(volumeConfig[0])) == 0 || 
len(strings.TrimSpace(volumeConfig[1])) == 0 {

Reply via email to