Skip to content

Commit

Permalink
Merge pull request #6977 from tstromberg/new-warning-type
Browse files Browse the repository at this point in the history
New warning emoji
  • Loading branch information
tstromberg authored Mar 10, 2020
2 parents 4f5c882 + b99304e commit 7d28b2a
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion cmd/minikube/cmd/config/profile_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ var printProfilesTable = func() {
table.Render()

if invalidProfiles != nil {
out.T(out.WarningType, "Found {{.number}} invalid profile(s) ! ", out.V{"number": len(invalidProfiles)})
out.T(out.Warning, "Found {{.number}} invalid profile(s) ! ", out.V{"number": len(invalidProfiles)})
for _, p := range invalidProfiles {
out.T(out.Empty, "\t "+p.Name)
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/minikube/cmd/config/validations.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func IsValidDriver(string, name string) error {

// RequiresRestartMsg returns the "requires restart" message
func RequiresRestartMsg(string, string) error {
out.T(out.WarningType, "These changes will take effect upon a minikube delete and then a minikube start")
out.T(out.Warning, "These changes will take effect upon a minikube delete and then a minikube start")
return nil
}

Expand Down
2 changes: 1 addition & 1 deletion cmd/minikube/cmd/mount.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ var mountCmd = &cobra.Command{

// An escape valve to allow future hackers to try NFS, VirtFS, or other FS types.
if !supportedFilesystems[cfg.Type] {
out.T(out.WarningType, "{{.type}} is not yet a supported filesystem. We will try anyways!", out.V{"type": cfg.Type})
out.T(out.Warning, "{{.type}} is not yet a supported filesystem. We will try anyways!", out.V{"type": cfg.Type})
}

bindIP := ip.String() // the ip to listen on the user's host machine
Expand Down
2 changes: 1 addition & 1 deletion cmd/minikube/cmd/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ func startKicServiceTunnel(svc, configName string) {
service.PrintServiceList(os.Stdout, data)

openURLs(svc, urls)
out.T(out.WarningType, "Because you are using docker driver on Mac, the terminal needs to be open to run it.")
out.T(out.Warning, "Because you are using docker driver on Mac, the terminal needs to be open to run it.")

<-ctrlC

Expand Down
2 changes: 1 addition & 1 deletion cmd/minikube/cmd/stop.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func runStop(cmd *cobra.Command, args []string) {
}

if err := killMountProcess(); err != nil {
out.T(out.WarningType, "Unable to kill mount process: {{.error}}", out.V{"error": err})
out.T(out.Warning, "Unable to kill mount process: {{.error}}", out.V{"error": err})
}

err = kubeconfig.UnsetCurrentContext(profile, kubeconfig.PathFromEnv())
Expand Down
2 changes: 1 addition & 1 deletion pkg/minikube/machine/fix.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ func maybeWarnAboutEvalEnv(drver string, name string) {
return
}
out.T(out.Notice, "Noticed that you are using minikube docker-env:")
out.T(out.WarningType, `After minikube restart the dockerd ports might have changed. To ensure docker-env works properly.
out.T(out.Warning, `After minikube restart the dockerd ports might have changed. To ensure docker-env works properly.
Please re-eval the docker-env command:
'minikube -p {{.profile_name}} docker-env'
Expand Down
2 changes: 1 addition & 1 deletion pkg/minikube/out/out.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ func FatalT(format string, a ...V) {

// WarningT is a shortcut for writing a templated warning message to stderr
func WarningT(format string, a ...V) {
ErrT(WarningType, format, a...)
ErrT(Warning, format, a...)
}

// FailureT is a shortcut for writing a templated failure message to stderr
Expand Down
2 changes: 1 addition & 1 deletion pkg/minikube/out/out_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func TestOutT(t *testing.T) {
}{
{Happy, "Happy", nil, "😄 Happy\n", "* Happy\n"},
{Option, "Option", nil, " ▪ Option\n", " - Option\n"},
{WarningType, "Warning", nil, "⚠️ Warning\n", "! Warning\n"},
{Warning, "Warning", nil, " Warning\n", "! Warning\n"},
{FatalType, "Fatal: {{.error}}", V{"error": "ugh"}, "💣 Fatal: ugh\n", "X Fatal: ugh\n"},
{Issue, "http://i/{{.number}}", V{"number": 10000}, " ▪ http://i/10000\n", " - http://i/10000\n"},
{Usage, "raw: {{.one}} {{.two}}", V{"one": "'%'", "two": "%d"}, "💡 raw: '%' %d\n", "* raw: '%' %d\n"},
Expand Down
2 changes: 1 addition & 1 deletion pkg/minikube/out/style.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ var styles = map[StyleEnum]style{
Reconfiguring: {Prefix: "📯 "},
Stopping: {Prefix: "✋ "},
Stopped: {Prefix: "🛑 "},
WarningType: {Prefix: "⚠️ ", LowPrefix: lowWarning},
Warning: {Prefix: " ", LowPrefix: lowWarning},
Waiting: {Prefix: "⌛ "},
Usage: {Prefix: "💡 "},
Launch: {Prefix: "🚀 "},
Expand Down
2 changes: 1 addition & 1 deletion pkg/minikube/out/style_enum.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const (
Reconfiguring
Stopping
Stopped
WarningType
Warning
Waiting
WaitingPods
Usage
Expand Down
2 changes: 1 addition & 1 deletion pkg/minikube/tunnel/kic/ssh_conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func createSSHConn(name, sshPort, sshKey string, svc *v1.Service) *sshConn {

if askForSudo {
out.T(
out.WarningType,
out.Warning,
"The service {{.service}} requires privileged ports to be exposed: {{.ports}}",
out.V{"service": svc.Name, "ports": fmt.Sprintf("%v", privilegedPorts)},
)
Expand Down

0 comments on commit 7d28b2a

Please sign in to comment.