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

kamel cli output redirection doesn't work for some commands #2495

Closed
vsokolovskii opened this issue Jul 12, 2021 · 7 comments · Fixed by #2656
Closed

kamel cli output redirection doesn't work for some commands #2495

vsokolovskii opened this issue Jul 12, 2021 · 7 comments · Fixed by #2656
Labels
area/cli Kamel CLI good first issue Does not require full understanding of the codebase
Milestone

Comments

@vsokolovskii
Copy link
Contributor

vsokolovskii commented Jul 12, 2021

Cobra function cmd.SetOut() does not redirect output for some commands.

for command output redirection this function is used

func GetOutputString(command *cobra.Command) string {

redirection works fine for kamel get kamel kit but the output of commands kamel describe kamel help kamel dump kamel version is not being redirected to the given io.Writer

Redirection works for all commands if you set the external kamel binary to e.g 1.4.0

issue

_Problem was found here #2176 _

@nicolaferraro nicolaferraro added this to the 1.6.0 milestone Jul 16, 2021
@nicolaferraro nicolaferraro added the area/cli Kamel CLI label Jul 16, 2021
@squakez
Copy link
Contributor

squakez commented Aug 30, 2021

Yeah, unfortunately I've noticed this as well. A simple strategy is to look for fmt.Print... used along the cmd package and replace with the cmd.OutOrStdout() related usage.

@squakez squakez added the good first issue Does not require full understanding of the codebase label Aug 30, 2021
@rajibmitra
Copy link

I would like to work on it. @squakez

@squakez
Copy link
Contributor

squakez commented Sep 6, 2021

I would like to work on it. @squakez

Noted, you can go ahead and let me know if you need any help.

@nicolaferraro nicolaferraro modified the milestones: 1.6.0, 1.7.0 Sep 7, 2021
@squakez
Copy link
Contributor

squakez commented Sep 16, 2021

@rajibmitra any progress on this? I'd like to pick it up for 1.7.0 release.

@rajibmitra
Copy link

@squakez sorry, based on my current load it will take at least a few days to start. if its urgent please pick it up. thank you!

@squakez
Copy link
Contributor

squakez commented Sep 16, 2021

@squakez sorry, based on my current load it will take at least a few days to start. if its urgent please pick it up. thank you!

No problem. We may need to start working on it in a few days. Thanks for your interest and feel free to pick up any other issue that you can contribute to.

@vsokolovskii
Copy link
Contributor Author

I'm working on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cli Kamel CLI good first issue Does not require full understanding of the codebase
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants