porter credentials apply outputs to stderr even when successful
Closed this issue · 4 comments
porter credentials apply
command outputs the message "Applied <namespace/credentials set name> credential set" to stderr instead of stdout. This is especially problematic when Porter is used in DevOps pipelines as they are typically set to fail if there is any output in stderr.
Tested with version porter v1.0.15 (be5c66a9)
.
Steps to reproduce the behavior
- Have a credentials file ready
- Run the command:
porter credentials apply <credentials filename>
Expected behavior
Output in stdout: "Applied <namespace/credentials set name> credential set"
Actual behavior
Message "Applied <namespace/credentials set name> credential set" in stderr stream while the stdout stream is empty.
This seems to be by design, but don't know if you want it changed @schristoff?
It completely get the problem described in the issue
porter/pkg/portercontext/context.go
Lines 216 to 230 in aa7959f
Taking a peak at this, this is not an expected behavior and would be considered a bug - @kichristensen I would say go ahead and change it!
I wanted to triple check this wouldn't break anything, but I think ultimately our users aren't expecting this to go to stderr
:)
@schristoff Just changing it in the referenced code, won't work as it also will affect warning and error messages. But I will take a look and see how it can be handled