diff --git a/pkg/cmd/run.go b/pkg/cmd/run.go index 9c83fdaa51..9f3126ec8e 100644 --- a/pkg/cmd/run.go +++ b/pkg/cmd/run.go @@ -471,7 +471,17 @@ func (*runCmdOptions) configureTrait(integration *v1alpha1.Integration, config s } } - spec.Configuration[prop] = val + if len(spec.Configuration[prop]) > 0 { + // Aggregate multiple occurences of the same option into a comma-separated string, + // attempting to follow POSIX conventions. + // This enables to execute: + // $ kamel run -t .= ... -t .= + // Or: + // $ kamel run --trait .=,..., + spec.Configuration[prop] = spec.Configuration[prop] + "," + val + } else { + spec.Configuration[prop] = val + } integration.Spec.Traits[traitID] = spec return nil }