UI: make fatal/conflict and failures red color#22511
UI: make fatal/conflict and failures red color#22511medyagh wants to merge 6 commits intokubernetes:masterfrom
Conversation
…d to use it for warning messages.
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: medyagh The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Pull request overview
Adds support for applying ANSI color codes to stylized console output, enabling red-highlighted warning messages.
Changes:
- Extend
style.Optionswith aColorfield to support style-level coloring. - Add a per-call color override path via
out.Color(...)andstylized/applyStyleupdates. - Update
minikube startto print the Docker-runtime warning in red.
Reviewed changes
Copilot reviewed 2 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/minikube/style/style.go | Adds Color field to style options for default style coloring. |
| pkg/minikube/out/out_style.go | Adds color application logic and supports per-call override color. |
| pkg/minikube/out/out.go | Introduces out.Color(...) helper for passing a color override through templating args. |
| pkg/minikube/out/out_style_test.go | Updates tests for the new applyStyle signature. |
| cmd/minikube/cmd/start.go | Applies red coloring to a specific runtime warning output. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| ShouldSpin bool | ||
| HideAfterSpin bool // Hide the prefix after spinning | ||
| HideAfterSpin bool // Hide the prefix after spinning | ||
| Color string // Color to apply to the message |
There was a problem hiding this comment.
Options.Color is introduced and applyStyle supports it, but nothing in style.Config sets Color yet (so the branch is effectively dead unless every call uses an override). If the goal is “red warnings”, consider setting style.Config[style.Warning].Color (and similar styles) instead of leaving defaults empty, or remove the field until it’s actually used.
cmd/minikube/cmd/start.go
Outdated
| rtime := getContainerRuntime(existing) | ||
| if rtime == constants.Docker && (existing == nil || viper.IsSet(containerRuntime)) { | ||
| out.WarningT(`Starting v1.39.0, minikube will default to "containerd" container runtime. See #21973 for more info.`) | ||
| out.WarningT(`Starting v1.39.0, minikube will default to "containerd" container runtime. See #21973 for more info.`, out.Color(style.Red)) |
There was a problem hiding this comment.
This call-site uses a per-message color override for a warning. If warnings are intended to be red globally, using the new style.Options.Color for style.Warning would avoid having to thread out.Color(...) through each warning call and keeps styling concerns centralized.
| out.WarningT(`Starting v1.39.0, minikube will default to "containerd" container runtime. See #21973 for more info.`, out.Color(style.Red)) | |
| out.WarningT(`Starting v1.39.0, minikube will default to "containerd" container runtime. See #21973 for more info.`) |
…ith color enabled
|
@medyagh: The following tests failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
|
PR needs rebase. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Uh oh!
There was an error while loading. Please reload this page.