werf / kubedog

Library to watch and follow kubernetes resources in CI/CD deploy pipelines
Apache License 2.0
649 stars 43 forks source link

Option to change the display prefix #108

Closed josegonzalez closed 5 years ago

josegonzalez commented 5 years ago

Rather than have the output be prefixed with #, I would like to indent the output by some arbitrary number of characters. This would make the output look much better when used as a step within a build pipeline in my case.

Would you take a PR to modify the display prefix when tracking rollouts?

distorhead commented 5 years ago

Hi, @josegonzalez !

Firstly, check out new release https://github.com/flant/kubedog/releases/tag/v0.3.0. It introduces so called multitracker. Multitracker is a rollout type tracker (it means it tracks resources till ready condition), it is capable of tracking multiple resources at the same time.

IMPORTANT:

Demo.

Option to indent output

As of option to add display prefix spaces: it is certainly acceptable to add such an option for kubedog multitrack cli.

Multitrack uses our another library called logboek: https://github.com/flant/logboek. I think we may add some ability to indent output into this library. Need some more time to think about this.

josegonzalez commented 5 years ago

The multi-track stuff seems interesting, though it would be nice to also have the old "event-based" update output for it as well, as that is a bit more compact and useful to show to users in an event stream.

For reference, I'm using kubedog to track kubernetes resource updates inside of Dokku, which is a sort of Heroku-like experience around docker container orchestration.

distorhead commented 5 years ago

Multitracker shows logs as rollout tracker does. And kubernetes-events will be shown only for resource that failed to give user more detailed info for debug.

distorhead commented 5 years ago

@josegonzalez https://github.com/flant/kubedog/releases/tag/v0.3.1

kubedog multitrack --output-prefix="                "
distorhead commented 5 years ago

By the way, in the new release https://github.com/flant/kubedog/releases/tag/v0.3.2 there is an option called ShowServiceMessages: true to enable verbose output of resource kubernetes events and other service messages, which by default will only be shown in the case when resource has failed.