-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Add colors to describe command #3275
Conversation
933a375
to
a48ff55
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please run make update
to fix CI failure. Thank you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is really cool, thank you!
I have an additional request - can you add enabling/disabling this functionality into the Velero client config file, so folks can disable it for all runs? The file lives in $HOME/.config/velero
, and we have helper code for it that will need to read the key. We should have existing code for the feature flags that allows for using the config file and command line flags.
996995a
to
ba9aa22
Compare
Hey @nrb , When you say you want it to be enabled/disabled via the config file, do you imagine it being part of "features", like this? Or were you imagining a separate config field entirely, like this? EDIT: Please let us know if you would prefer it a different way! |
Yep! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This LGTM! 🎉
Hey @mike1808, your last commit was unsigned and so it's failing a check. |
ca605d8
to
e4660d1
Compare
51d3cbf
to
c0b4f79
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I disabled the colorized in my $HOME/.config/velero/config.json as {"colorized":"false"}
.
However, the color still existed for the command output.
@jenting please use boolean values instead of strings. |
I think the problem comes when I running If I manually edit $HOME/.config/velero/config.json to |
@jenting I see, is there a preference then for all config values to be strings then? We could change the value to a string and it could be on/off instead of true/false? Or we could do some converting in the VeleroConfig struct to allow for the bool. Do you have a preference? |
cc @nrb @carlisia @zubron any suggestion on this? Personally, I'd prefer not to break the change (keep using the
|
Thank you. Two comments left:
|
7add239
to
ea5a044
Compare
* Add colors to describe backups/restore/schedules commands * Make name in the output bold * Disable colors via `--colorized` flag or if velero isn't in TTY Co-authored-by: Clay Kauzlaric <ckauzlaric@vmware.com> Signed-off-by: Clay Kauzlaric <ckauzlaric@vmware.com> Signed-off-by: Mikael Manukyan <mmanukyan@vmware.com>
a13593c
to
c276d18
Compare
Hi @jenting , I think we resolved the conflicting files. As for the doc, we weren't sure where to put this information. We opted for |
I'm okay to put it here. I saw the last two commits had signed off, but the CI failed at DCO check, strange 🤔 |
velero client config set colorized=false | ||
``` | ||
|
||
Note, that if you specify `--colorized=true` as a CLI option it will override |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note, that if you specify `--colorized=true` as a CLI option it will override | |
Note that if you specify `--colorized=true` as a CLI option it will override |
@KauzClay Once you make the two changes asked for, please sign the commits as shown at https://github.com/vmware-tanzu/velero/pull/3275/checks?check_run_id=1809391225 |
95e1e6e
to
c0e9fbe
Compare
Ah, sorry about messing up the sign off thing. Hopefully I got it this time? |
8dc03a4
to
ea9dff6
Compare
* and run make update Co-authored-by: Mikael Manukyan <mmanukyan@vmware.com> Signed-off-by: Mikael Manukyan <mmanukyan@vmware.com> Signed-off-by: Clay Kauzlaric <ckauzlaric@vmware.com>
Co-authored-by: Mikael Manukyan <mmanukyan@vmware.com> Signed-off-by: Clay Kauzlaric <ckauzlaric@vmware.com> Co-authored-by: Mikael Manukyan <mmanukyan@vmware.com>
* the command `velero client config set colorized=false` writes a string value of "false" into the config. This change allows that string to be accepted and converted into a boolean when used in program. Signed-off-by: Clay Kauzlaric <ckauzlaric@vmware.com>
Co-authored-by: Mikael Manukyan <mmanukyan@vmware.com> Signed-off-by: Clay Kauzlaric <ckauzlaric@vmware.com>
Co-authored-by: JenTing Hsiao <jenting.hsiao@suse.com> Signed-off-by: Clay Kauzlaric <ckauzlaric@vmware.com>
* as per @carlisia 's suggestion Signed-off-by: Clay Kauzlaric <ckauzlaric@vmware.com>
ea9dff6
to
8692c2c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you.
* Add colors to describe command * Add colors to describe backups/restore/schedules commands * Make name in the output bold * Disable colors via `--colorized` flag or if velero isn't in TTY Co-authored-by: Clay Kauzlaric <ckauzlaric@vmware.com> Signed-off-by: Clay Kauzlaric <ckauzlaric@vmware.com> Signed-off-by: Mikael Manukyan <mmanukyan@vmware.com> * Add changelog * and run make update Co-authored-by: Mikael Manukyan <mmanukyan@vmware.com> Signed-off-by: Mikael Manukyan <mmanukyan@vmware.com> Signed-off-by: Clay Kauzlaric <ckauzlaric@vmware.com> * Add colorized to the client config file Co-authored-by: Mikael Manukyan <mmanukyan@vmware.com> Signed-off-by: Clay Kauzlaric <ckauzlaric@vmware.com> Co-authored-by: Mikael Manukyan <mmanukyan@vmware.com> * allow client config to use string values * the command `velero client config set colorized=false` writes a string value of "false" into the config. This change allows that string to be accepted and converted into a boolean when used in program. Signed-off-by: Clay Kauzlaric <ckauzlaric@vmware.com> * Add docs about colored CLI output Co-authored-by: Mikael Manukyan <mmanukyan@vmware.com> Signed-off-by: Clay Kauzlaric <ckauzlaric@vmware.com> * Update site/content/docs/main/customize-installation.md Co-authored-by: JenTing Hsiao <jenting.hsiao@suse.com> Signed-off-by: Clay Kauzlaric <ckauzlaric@vmware.com> * docs: remove comma * as per @carlisia 's suggestion Signed-off-by: Clay Kauzlaric <ckauzlaric@vmware.com> Co-authored-by: Clay Kauzlaric <ckauzlaric@vmware.com> Co-authored-by: Clay Kauzlaric <clay.kauzlaric@gmail.com> Co-authored-by: JenTing Hsiao <jenting.hsiao@suse.com>
* Add colors to describe command * Add colors to describe backups/restore/schedules commands * Make name in the output bold * Disable colors via `--colorized` flag or if velero isn't in TTY Co-authored-by: Clay Kauzlaric <ckauzlaric@vmware.com> Signed-off-by: Clay Kauzlaric <ckauzlaric@vmware.com> Signed-off-by: Mikael Manukyan <mmanukyan@vmware.com> * Add changelog * and run make update Co-authored-by: Mikael Manukyan <mmanukyan@vmware.com> Signed-off-by: Mikael Manukyan <mmanukyan@vmware.com> Signed-off-by: Clay Kauzlaric <ckauzlaric@vmware.com> * Add colorized to the client config file Co-authored-by: Mikael Manukyan <mmanukyan@vmware.com> Signed-off-by: Clay Kauzlaric <ckauzlaric@vmware.com> Co-authored-by: Mikael Manukyan <mmanukyan@vmware.com> * allow client config to use string values * the command `velero client config set colorized=false` writes a string value of "false" into the config. This change allows that string to be accepted and converted into a boolean when used in program. Signed-off-by: Clay Kauzlaric <ckauzlaric@vmware.com> * Add docs about colored CLI output Co-authored-by: Mikael Manukyan <mmanukyan@vmware.com> Signed-off-by: Clay Kauzlaric <ckauzlaric@vmware.com> * Update site/content/docs/main/customize-installation.md Co-authored-by: JenTing Hsiao <jenting.hsiao@suse.com> Signed-off-by: Clay Kauzlaric <ckauzlaric@vmware.com> * docs: remove comma * as per @carlisia 's suggestion Signed-off-by: Clay Kauzlaric <ckauzlaric@vmware.com> Co-authored-by: Clay Kauzlaric <ckauzlaric@vmware.com> Co-authored-by: Clay Kauzlaric <clay.kauzlaric@gmail.com> Co-authored-by: JenTing Hsiao <jenting.hsiao@suse.com>
* Add colors to describe command * Add colors to describe backups/restore/schedules commands * Make name in the output bold * Disable colors via `--colorized` flag or if velero isn't in TTY Co-authored-by: Clay Kauzlaric <ckauzlaric@vmware.com> Signed-off-by: Clay Kauzlaric <ckauzlaric@vmware.com> Signed-off-by: Mikael Manukyan <mmanukyan@vmware.com> * Add changelog * and run make update Co-authored-by: Mikael Manukyan <mmanukyan@vmware.com> Signed-off-by: Mikael Manukyan <mmanukyan@vmware.com> Signed-off-by: Clay Kauzlaric <ckauzlaric@vmware.com> * Add colorized to the client config file Co-authored-by: Mikael Manukyan <mmanukyan@vmware.com> Signed-off-by: Clay Kauzlaric <ckauzlaric@vmware.com> Co-authored-by: Mikael Manukyan <mmanukyan@vmware.com> * allow client config to use string values * the command `velero client config set colorized=false` writes a string value of "false" into the config. This change allows that string to be accepted and converted into a boolean when used in program. Signed-off-by: Clay Kauzlaric <ckauzlaric@vmware.com> * Add docs about colored CLI output Co-authored-by: Mikael Manukyan <mmanukyan@vmware.com> Signed-off-by: Clay Kauzlaric <ckauzlaric@vmware.com> * Update site/content/docs/main/customize-installation.md Co-authored-by: JenTing Hsiao <jenting.hsiao@suse.com> Signed-off-by: Clay Kauzlaric <ckauzlaric@vmware.com> * docs: remove comma * as per @carlisia 's suggestion Signed-off-by: Clay Kauzlaric <ckauzlaric@vmware.com> Co-authored-by: Clay Kauzlaric <ckauzlaric@vmware.com> Co-authored-by: Clay Kauzlaric <clay.kauzlaric@gmail.com> Co-authored-by: JenTing Hsiao <jenting.hsiao@suse.com>
--colorized
flag or if velero isn't in TTYFixes #1082
If you have any other coloring suggestion please let us know.
cc @KauzClay