Fixing variable style

pull/4376/head
Sharif Elgamal 2019-05-29 19:19:33 -07:00
parent 34ccd2ad41
commit 6d507fbcd1
No known key found for this signature in database
GPG Key ID: 23CC0225BD9FD702
5 changed files with 36 additions and 35 deletions

View File

@ -492,7 +492,7 @@ func prepareNone() {
console.OutLn("")
console.Warning("The 'none' driver provides limited isolation and may reduce system security and reliability.")
console.Warning("For more information, see:")
console.OutStyle(console.Url, "https://github.com/kubernetes/minikube/blob/master/docs/vmdriver-none.md")
console.OutStyle(console.URL, "https://github.com/kubernetes/minikube/blob/master/docs/vmdriver-none.md")
console.OutLn("")
}

View File

@ -346,7 +346,7 @@ To disable this message, run [minikube config set WantShowDriverDeprecationNotif
func createHost(api libmachine.API, config cfg.MachineConfig) (*host.Host, error) {
preCreateHost(&config)
console.OutStyle(console.StartingVm, "Creating %s VM (CPUs=%d, Memory=%dMB, Disk=%dMB) ...", config.VMDriver, config.CPUs, config.Memory, config.DiskSize)
console.OutStyle(console.StartingVM, "Creating %s VM (CPUs=%d, Memory=%dMB, Disk=%dMB) ...", config.VMDriver, config.CPUs, config.Memory, config.DiskSize)
def, err := registry.Driver(config.VMDriver)
if err != nil {
if err == registry.ErrDriverNotFound {

View File

@ -72,7 +72,7 @@ var styles = map[StyleEnum]style{
Command: {Prefix: " ▪ ", LowPrefix: lowIndent}, // Indented bullet
LogEntry: {Prefix: " "}, // Indent
Crushed: {Prefix: "💔 "},
Url: {Prefix: "👉 ", LowPrefix: lowIndent},
URL: {Prefix: "👉 ", LowPrefix: lowIndent},
Documentation: {Prefix: "📘 "},
Issues: {Prefix: "⁉️ "},
Issue: {Prefix: " ▪ ", LowPrefix: lowIndent}, // Indented bullet
@ -81,33 +81,33 @@ var styles = map[StyleEnum]style{
// Specialized purpose styles
IsoDownload: {Prefix: "💿 "},
FileDownload: {Prefix: "💾 "},
Caching: {Prefix: "🤹 "},
StartingVm: {Prefix: "🔥 "},
Caching: {Prefix: "🤹 "},
StartingVM: {Prefix: "🔥 "},
StartingNone: {Prefix: "🤹 "},
Resetting: {Prefix: "🔄 "},
Resetting: {Prefix: "🔄 "},
DeletingHost: {Prefix: "🔥 "},
Copying: {Prefix: "✨ "},
Connectivity: {Prefix: "📶 "},
Internet: {Prefix: "🌐 "},
Mounting: {Prefix: "📁 "},
Celebrate: {Prefix: "🎉 "},
Copying: {Prefix: "✨ "},
Connectivity: {Prefix: "📶 "},
Internet: {Prefix: "🌐 "},
Mounting: {Prefix: "📁 "},
Celebrate: {Prefix: "🎉 "},
ContainerRuntime: {Prefix: "🎁 "},
Docker: {Prefix: "🐳 "},
Docker: {Prefix: "🐳 "},
Crio: {Prefix: "🎁 "}, // This should be a snow-flake, but the emoji has a strange width on macOS
Containerd: {Prefix: "📦 "},
Permissions: {Prefix: "🔑 "},
Enabling: {Prefix: "🔌 "},
Shutdown: {Prefix: "🛑 "},
Pulling: {Prefix: "🚜 "},
Verifying: {Prefix: "🤔 "},
Containerd: {Prefix: "📦 "},
Permissions: {Prefix: "🔑 "},
Enabling: {Prefix: "🔌 "},
Shutdown: {Prefix: "🛑 "},
Pulling: {Prefix: "🚜 "},
Verifying: {Prefix: "🤔 "},
VerifyingNoLine: {Prefix: "🤔 ", OmitNewline: true},
Kubectl: {Prefix: "💗 "},
Meh: {Prefix: "🙄 ", LowPrefix: lowWarning},
Embarrassed: {Prefix: "🤦 ", LowPrefix: lowWarning},
Tip: {Prefix: "💡 "},
Unmount: {Prefix: "🔥 "},
Kubectl: {Prefix: "💗 "},
Meh: {Prefix: "🙄 ", LowPrefix: lowWarning},
Embarrassed: {Prefix: "🤦 ", LowPrefix: lowWarning},
Tip: {Prefix: "💡 "},
Unmount: {Prefix: "🔥 "},
MountOptions: {Prefix: "💾 "},
Fileserver: {Prefix: "🚀 ", OmitNewline: true},
Fileserver: {Prefix: "🚀 ", OmitNewline: true},
}
// Add a prefix to a string

View File

@ -17,6 +17,7 @@ limitations under the License.
package console
type StyleEnum int
const (
Happy StyleEnum = iota
SuccessType
@ -42,7 +43,7 @@ const (
Command
LogEntry
Crushed
Url
URL
Documentation
Issues
Issue
@ -50,7 +51,7 @@ const (
IsoDownload
FileDownload
Caching
StartingVm
StartingVM
StartingNone
Resetting
DeletingHost
@ -103,7 +104,7 @@ func (style StyleEnum) String() string {
"Command",
"LogEntry",
"Crushed",
"Url",
"URL",
"Documentation",
"Issues",
"Issue",
@ -111,7 +112,7 @@ func (style StyleEnum) String() string {
"IsoDownload",
"FileDownload",
"Caching",
"StartingVm",
"StartingVM",
"StartingNone",
"Resetting",
"DeletingHost",
@ -122,7 +123,7 @@ func (style StyleEnum) String() string {
"Celebrate",
"ContainerRuntime",
"Docker",
"Crio",
"Crio",
"Containerd",
"Permissions",
"Enabling",
@ -131,16 +132,16 @@ func (style StyleEnum) String() string {
"Verifying",
"VerifyingNoLine",
"Kubectl",
"Meh",
"Meh",
"Embarrassed",
"Tip",
"Tip",
"Unmount",
"MountOptions",
"Fileserver"}
if style > Fileserver{
if style > Fileserver {
return "Unknown"
}
return s[style]
}
}

View File

@ -75,7 +75,7 @@ func WithProblem(msg string, p *problem.Problem) {
p.Display()
console.Err("\n")
console.ErrStyle(console.Sad, "If the above advice does not help, please let us know: ")
console.ErrStyle(console.Url, "https://github.com/kubernetes/minikube/issues/new")
console.ErrStyle(console.URL, "https://github.com/kubernetes/minikube/issues/new")
os.Exit(Config)
}
@ -102,5 +102,5 @@ func displayError(msg string, err error) {
console.Fatal(msg+": %v", err)
console.Err("\n")
console.ErrStyle(console.Sad, "Sorry that minikube crashed. If this was unexpected, we would love to hear from you:")
console.ErrStyle(console.Url, "https://github.com/kubernetes/minikube/issues/new")
console.ErrStyle(console.URL, "https://github.com/kubernetes/minikube/issues/new")
}