Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cli) Duplicated trait set as modeline and kamel run parameters causes error #2467

Merged
merged 1 commit into from
Jul 9, 2021

Conversation

claudio4j
Copy link
Contributor

Fix #2466

Release Note

NONE

@claudio4j
Copy link
Contributor Author

/cc @astefanutti

Copy link
Member

@astefanutti astefanutti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I've left a couple of comments/questions.

e2e/common/files/JavaTraits.java Outdated Show resolved Hide resolved
pkg/cmd/run.go Outdated Show resolved Hide resolved
@astefanutti astefanutti added the area/cli Kamel CLI label Jun 30, 2021
@claudio4j claudio4j force-pushed the fix_duplicated_traits branch 4 times, most recently from c8f733e to 6ef892b Compare July 1, 2021 00:37
@claudio4j
Copy link
Contributor Author

@oscerd or @nicolaferraro can you review and merge ?

@claudio4j
Copy link
Contributor Author

claudio4j commented Jul 1, 2021

/retest

@nicolaferraro
Copy link
Member

@claudio4j have you checled if it affect traits having multiple values.

E.g. if I want to set knative.sink-channels to chan1 and chan2, can I run -t knative.sink-channels=chan1 -t knative.sink-channels=chan2 ? Does it only apply to modeline vs command line params?

@claudio4j
Copy link
Contributor Author

The precedence applies only to trait/property keys from modeline and cli and in the case you mentioned, the values are correctly applied as []string, example

kamel run -o yaml files/JavaDuplicateParams.java -t knative.enabled=true -t knative.channel-sinks=chan1 -t knative.channel-sinks=chan2

The output

  traits:
    knative:
      configuration:
        channelSinks:
        - chan1
        - chan2
        enabled: true

@nicolaferraro
Copy link
Member

There are test errors related to this PR

@claudio4j
Copy link
Contributor Author

@nicolaferraro I fixed the e2e tests, can you review ? Thanks.

@claudio4j
Copy link
Contributor Author

@nicolaferraro can you check if it's ok to merge this one ?

@nicolaferraro nicolaferraro merged commit 17e0913 into apache:main Jul 9, 2021
@claudio4j claudio4j deleted the fix_duplicated_traits branch July 9, 2021 11:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cli Kamel CLI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Duplicated trait set as modeline and kamel run parameters causes error
4 participants