Skip to content

Commit

Permalink
Merge pull request #8036 from tstromberg/help-me
Browse files Browse the repository at this point in the history
Make `minikube help` output consistent
  • Loading branch information
medyagh authored May 7, 2020
2 parents 269b938 + cad2960 commit 294a5c3
Show file tree
Hide file tree
Showing 87 changed files with 210 additions and 209 deletions.
4 changes: 2 additions & 2 deletions cmd/minikube/cmd/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ const cacheImageConfigKey = "cache"
// cacheCmd represents the cache command
var cacheCmd = &cobra.Command{
Use: "cache",
Short: "Add or delete an image from the local cache.",
Long: "Add or delete an image from the local cache.",
Short: "Add, delete, or push a local image into minikube",
Long: "Add, delete, or push a local image into minikube",
}

// addCacheCmd represents the cache add command
Expand Down
2 changes: 1 addition & 1 deletion cmd/minikube/cmd/completion.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const boilerPlate = `

var completionCmd = &cobra.Command{
Use: "completion SHELL",
Short: "Outputs minikube shell completion for the given shell (bash, zsh or fish)",
Short: "Generate command completion for a shell",
Long: longDescription,
Run: func(cmd *cobra.Command, args []string) {
if len(args) != 1 {
Expand Down
2 changes: 1 addition & 1 deletion cmd/minikube/cmd/config/addons.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
// AddonsCmd represents the addons command
var AddonsCmd = &cobra.Command{
Use: "addons SUBCOMMAND [flags]",
Short: "Modify minikube's kubernetes addons",
Short: "Enable or disable a minikube addon",
Long: `addons modifies minikube addons files using subcommands like "minikube addons enable dashboard"`,
Run: func(cmd *cobra.Command, args []string) {
if err := cmd.Help(); err != nil {
Expand Down
2 changes: 1 addition & 1 deletion cmd/minikube/cmd/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ var settings = []Setting{
// ConfigCmd represents the config command
var ConfigCmd = &cobra.Command{
Use: "config SUBCOMMAND [flags]",
Short: "Modify minikube config",
Short: "Modify persistent configuration values",
Long: `config modifies minikube config files using subcommands like "minikube config set driver kvm"
Configurable fields: ` + "\n\n" + configurableFields(),
Run: func(cmd *cobra.Command, args []string) {
Expand Down
4 changes: 2 additions & 2 deletions cmd/minikube/cmd/config/open.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ You can add one by annotating a service with the label {{.labelName}}:{{.addonNa
}

if len(urlString) != 0 {
out.T(out.Celebrate, "Opening kubernetes service {{.namespace_name}}/{{.service_name}} in default browser...", out.V{"namespace_name": namespace, "service_name": svc})
out.T(out.Celebrate, "Opening Kubernetes service {{.namespace_name}}/{{.service_name}} in default browser...", out.V{"namespace_name": namespace, "service_name": svc})
for _, url := range urlString {
if err := browser.OpenURL(url); err != nil {
exit.WithError(fmt.Sprintf("browser failed to open url %s", url), err)
Expand All @@ -106,7 +106,7 @@ You can add one by annotating a service with the label {{.labelName}}:{{.addonNa
}

func init() {
addonsOpenCmd.Flags().BoolVar(&addonsURLMode, "url", false, "Display the kubernetes addons URL in the CLI instead of opening it in the default browser")
addonsOpenCmd.Flags().BoolVar(&addonsURLMode, "url", false, "Display the Kubernetes addons URL in the CLI instead of opening it in the default browser")
addonsOpenCmd.Flags().BoolVar(&https, "https", false, "Open the addons URL with https instead of http")
addonsOpenCmd.Flags().IntVar(&wait, "wait", service.DefaultWait, "Amount of time to wait for service in seconds")
addonsOpenCmd.Flags().IntVar(&interval, "interval", service.DefaultInterval, "The time interval for each check that wait performs in seconds")
Expand Down
2 changes: 1 addition & 1 deletion cmd/minikube/cmd/config/profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (
// ProfileCmd represents the profile command
var ProfileCmd = &cobra.Command{
Use: "profile [MINIKUBE_PROFILE_NAME]. You can return to the default minikube profile by running `minikube profile default`",
Short: "Profile gets or sets the current minikube profile",
Short: "Get or list the the current profiles (clusters)",
Long: "profile sets the current minikube profile, or gets the current profile if no arguments are provided. This is used to run and manage multiple minikube instance. You can return to the default minikube profile by running `minikube profile default`",
Run: func(cmd *cobra.Command, args []string) {
if len(args) == 0 {
Expand Down
4 changes: 2 additions & 2 deletions cmd/minikube/cmd/dashboard.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ var (
// dashboardCmd represents the dashboard command
var dashboardCmd = &cobra.Command{
Use: "dashboard",
Short: "Access the kubernetes dashboard running within the minikube cluster",
Long: `Access the kubernetes dashboard running within the minikube cluster`,
Short: "Access the Kubernetes dashboard running within the minikube cluster",
Long: `Access the Kubernetes dashboard running within the minikube cluster`,
Run: func(cmd *cobra.Command, args []string) {
cname := ClusterFlagValue()
co := mustload.Healthy(cname)
Expand Down
4 changes: 2 additions & 2 deletions cmd/minikube/cmd/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ var purge bool
// deleteCmd represents the delete command
var deleteCmd = &cobra.Command{
Use: "delete",
Short: "Deletes a local kubernetes cluster",
Long: `Deletes a local kubernetes cluster. This command deletes the VM, and removes all
Short: "Deletes a local Kubernetes cluster",
Long: `Deletes a local Kubernetes cluster. This command deletes the VM, and removes all
associated files.`,
Run: runDelete,
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/minikube/cmd/docker-env.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ func isDockerActive(r command.Runner) bool {
// dockerEnvCmd represents the docker-env command
var dockerEnvCmd = &cobra.Command{
Use: "docker-env",
Short: "Sets up docker env variables; similar to '$(docker-machine env)'",
Short: "Configure environment to use minikube's Docker daemon",
Long: `Sets up docker env variables; similar to '$(docker-machine env)'.`,
Run: func(cmd *cobra.Command, args []string) {
cname := ClusterFlagValue()
Expand Down
4 changes: 2 additions & 2 deletions cmd/minikube/cmd/kubectl.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ import (
// kubectlCmd represents the kubectl command
var kubectlCmd = &cobra.Command{
Use: "kubectl",
Short: "Run kubectl",
Long: `Run the kubernetes client, download it if necessary. Remember -- after kubectl!
Short: "Run a kubectl binary matching the cluster version",
Long: `Run the Kubernetes client, download it if necessary. Remember -- after kubectl!
Examples:
minikube kubectl -- --help
Expand Down
2 changes: 1 addition & 1 deletion cmd/minikube/cmd/logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ var (
// logsCmd represents the logs command
var logsCmd = &cobra.Command{
Use: "logs",
Short: "Gets the logs of the running instance, used for debugging minikube, not user code.",
Short: "Returns logs to debug a local Kubernetes cluster",
Long: `Gets the logs of the running instance, used for debugging minikube, not user code.`,
Run: func(cmd *cobra.Command, args []string) {
co := mustload.Running(ClusterFlagValue())
Expand Down
2 changes: 1 addition & 1 deletion cmd/minikube/cmd/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
// nodeCmd represents the set of node subcommands
var nodeCmd = &cobra.Command{
Use: "node",
Short: "Node operations",
Short: "Add, remove, or list additional nodes",
Long: "Operations on nodes",
Run: func(cmd *cobra.Command, args []string) {
exit.UsageT("Usage: minikube node [add|start|stop|delete|list]")
Expand Down
4 changes: 2 additions & 2 deletions cmd/minikube/cmd/node_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (
var nodeListCmd = &cobra.Command{
Use: "list",
Short: "List nodes.",
Long: "List existing Minikube nodes.",
Long: "List existing minikube nodes.",
Run: func(cmd *cobra.Command, args []string) {
if len(args) != 0 {
exit.UsageT("Usage: minikube node list")
Expand All @@ -40,7 +40,7 @@ var nodeListCmd = &cobra.Command{
_, cc := mustload.Partial(cname)

if len(cc.Nodes) < 1 {
glog.Warningf("Did not found any Minikube node.")
glog.Warningf("Did not found any minikube node.")
} else {
glog.Infof("%v", cc.Nodes)
}
Expand Down
9 changes: 5 additions & 4 deletions cmd/minikube/cmd/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,11 @@ import (

// optionsCmd represents the options command
var optionsCmd = &cobra.Command{
Use: "options",
Short: "Show a list of global command-line options (applies to all commands).",
Long: "Show a list of global command-line options (applies to all commands).",
Run: runOptions,
Use: "options",
Short: "Show a list of global command-line options (applies to all commands).",
Long: "Show a list of global command-line options (applies to all commands).",
Hidden: true,
Run: runOptions,
}

// runOptions handles the executes the flow of "minikube options"
Expand Down
2 changes: 1 addition & 1 deletion cmd/minikube/cmd/pause.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ var (
// pauseCmd represents the docker-pause command
var pauseCmd = &cobra.Command{
Use: "pause",
Short: "pause containers",
Short: "pause Kubernetes",
Run: runPause,
}

Expand Down
2 changes: 1 addition & 1 deletion cmd/minikube/cmd/podman-env.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ func createExternalSSHClient(d drivers.Driver) (*ssh.ExternalClient, error) {
// podmanEnvCmd represents the podman-env command
var podmanEnvCmd = &cobra.Command{
Use: "podman-env",
Short: "Sets up podman env variables; similar to '$(podman-machine env)'",
Short: "Configure environment to use minikube's Podman daemon",
Long: `Sets up podman env variables; similar to '$(podman-machine env)'.`,
Run: func(cmd *cobra.Command, args []string) {
cname := ClusterFlagValue()
Expand Down
6 changes: 3 additions & 3 deletions cmd/minikube/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ var viperWhiteList = []string{
// RootCmd represents the base command when called without any subcommands
var RootCmd = &cobra.Command{
Use: "minikube",
Short: "Minikube is a tool for managing local Kubernetes clusters.",
Long: `Minikube is a CLI tool that provisions and manages single-node Kubernetes clusters optimized for development workflows.`,
Short: "minikube quickly sets up a local Kubernetes cluster",
Long: `minikube provisions and manages local Kubernetes clusters optimized for development workflows.`,
PersistentPreRun: func(cmd *cobra.Command, args []string) {
for _, path := range dirs {
if err := os.MkdirAll(path, 0777); err != nil {
Expand Down Expand Up @@ -163,7 +163,7 @@ func setFlagsUsingViper() {
func init() {
translate.DetermineLocale()
RootCmd.PersistentFlags().StringP(config.ProfileName, "p", constants.DefaultClusterName, `The name of the minikube VM being used. This can be set to allow having multiple instances of minikube independently.`)
RootCmd.PersistentFlags().StringP(configCmd.Bootstrapper, "b", "kubeadm", "The name of the cluster bootstrapper that will set up the kubernetes cluster.")
RootCmd.PersistentFlags().StringP(configCmd.Bootstrapper, "b", "kubeadm", "The name of the cluster bootstrapper that will set up the Kubernetes cluster.")

groups := templates.CommandGroups{
{
Expand Down
6 changes: 3 additions & 3 deletions cmd/minikube/cmd/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ var (
// serviceCmd represents the service command
var serviceCmd = &cobra.Command{
Use: "service [flags] SERVICE",
Short: "Gets the kubernetes URL(s) for the specified service in your local cluster",
Long: `Gets the kubernetes URL(s) for the specified service in your local cluster. In the case of multiple URLs they will be printed one at a time.`,
Short: "Returns a URL to connect to a service",
Long: `Returns the Kubernetes URL for a service in your local cluster. In the case of multiple URLs they will be printed one at a time.`,
PersistentPreRun: func(cmd *cobra.Command, args []string) {
t, err := template.New("serviceURL").Parse(serviceURLFormat)
if err != nil {
Expand Down Expand Up @@ -101,7 +101,7 @@ You may select another namespace by using 'minikube service {{.service}} -n <nam

func init() {
serviceCmd.Flags().StringVarP(&namespace, "namespace", "n", "default", "The service namespace")
serviceCmd.Flags().BoolVar(&serviceURLMode, "url", false, "Display the kubernetes service URL in the CLI instead of opening it in the default browser")
serviceCmd.Flags().BoolVar(&serviceURLMode, "url", false, "Display the Kubernetes service URL in the CLI instead of opening it in the default browser")
serviceCmd.Flags().BoolVar(&https, "https", false, "Open the service URL with https instead of http")
serviceCmd.Flags().IntVar(&wait, "wait", service.DefaultWait, "Amount of time to wait for a service in seconds")
serviceCmd.Flags().IntVar(&interval, "interval", service.DefaultInterval, "The initial time interval for each check that wait performs in seconds")
Expand Down
2 changes: 1 addition & 1 deletion cmd/minikube/cmd/ssh.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ var (
// sshCmd represents the docker-ssh command
var sshCmd = &cobra.Command{
Use: "ssh",
Short: "Log into or run a command on a machine with SSH; similar to 'docker-machine ssh'",
Short: "Log into the minikube environment (for debugging)",
Long: "Log into or run a command on a machine with SSH; similar to 'docker-machine ssh'.",
Run: func(cmd *cobra.Command, args []string) {
cname := ClusterFlagValue()
Expand Down
8 changes: 4 additions & 4 deletions cmd/minikube/cmd/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ func init() {
// startCmd represents the start command
var startCmd = &cobra.Command{
Use: "start",
Short: "Starts a local kubernetes cluster",
Long: "Starts a local kubernetes cluster",
Short: "Starts a local Kubernetes cluster",
Long: "Starts a local Kubernetes cluster",
Run: runStart,
}

Expand Down Expand Up @@ -436,7 +436,7 @@ func maybeDeleteAndRetry(cc config.ClusterConfig, n config.Node, existingAddons
func kubectlVersion(path string) (string, error) {
j, err := exec.Command(path, "version", "--client", "--output=json").Output()
if err != nil {
// really old kubernetes clients did not have the --output parameter
// really old Kubernetes clients did not have the --output parameter
b, err := exec.Command(path, "version", "--client", "--short").Output()
if err != nil {
return "", errors.Wrap(err, "exec")
Expand Down Expand Up @@ -839,7 +839,7 @@ func validateFlags(cmd *cobra.Command, drvName string) {
out.WarningT("Using the '{{.runtime}}' runtime with the 'none' driver is an untested configuration!", out.V{"runtime": runtime})
}

// conntrack is required starting with kubernetes 1.18, include the release candidates for completion
// conntrack is required starting with Kubernetes 1.18, include the release candidates for completion
version, _ := util.ParseKubernetesVersion(getKubernetesVersion(nil))
if version.GTE(semver.MustParse("1.18.0-beta.1")) {
if _, err := exec.LookPath("conntrack"); err != nil {
Expand Down
8 changes: 4 additions & 4 deletions cmd/minikube/cmd/start_flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ func initMinikubeFlags() {
startCmd.Flags().String(criSocket, "", "The cri socket path to be used.")
startCmd.Flags().String(networkPlugin, "", "The name of the network plugin.")
startCmd.Flags().Bool(enableDefaultCNI, false, "Enable the default CNI plugin (/etc/cni/net.d/k8s.conf). Used in conjunction with \"--network-plugin=cni\".")
startCmd.Flags().StringSlice(waitComponents, kverify.DefaultWaitList, fmt.Sprintf("comma separated list of kubernetes components to verify and wait for after starting a cluster. defaults to %q, available options: %q . other acceptable values are 'all' or 'none', 'true' and 'false'", strings.Join(kverify.DefaultWaitList, ","), strings.Join(kverify.AllComponentsList, ",")))
startCmd.Flags().StringSlice(waitComponents, kverify.DefaultWaitList, fmt.Sprintf("comma separated list of Kubernetes components to verify and wait for after starting a cluster. defaults to %q, available options: %q . other acceptable values are 'all' or 'none', 'true' and 'false'", strings.Join(kverify.DefaultWaitList, ","), strings.Join(kverify.AllComponentsList, ",")))
startCmd.Flags().Duration(waitTimeout, 6*time.Minute, "max time to wait per Kubernetes core services to be healthy.")
startCmd.Flags().Bool(nativeSSH, true, "Use native Golang SSH client (default true). Set to 'false' to use the command line 'ssh' command when accessing the docker machine. Useful for the machine drivers when they will not start with 'Waiting for SSH'.")
startCmd.Flags().Bool(autoUpdate, true, "If set, automatically updates drivers to the latest version. Defaults to true.")
Expand All @@ -142,16 +142,16 @@ func initMinikubeFlags() {
startCmd.Flags().Bool(forceSystemd, false, "If set, force the container runtime to use sytemd as cgroup manager. Currently available for docker and crio. Defaults to false.")
}

// initKubernetesFlags inits the commandline flags for kubernetes related options
// initKubernetesFlags inits the commandline flags for Kubernetes related options
func initKubernetesFlags() {
startCmd.Flags().String(kubernetesVersion, "", fmt.Sprintf("The kubernetes version that the minikube VM will use (ex: v1.2.3, 'stable' for %s, 'latest' for %s). Defaults to 'stable'.", constants.DefaultKubernetesVersion, constants.NewestKubernetesVersion))
startCmd.Flags().String(kubernetesVersion, "", fmt.Sprintf("The Kubernetes version that the minikube VM will use (ex: v1.2.3, 'stable' for %s, 'latest' for %s). Defaults to 'stable'.", constants.DefaultKubernetesVersion, constants.NewestKubernetesVersion))
startCmd.Flags().Var(&config.ExtraOptions, "extra-config",
`A set of key=value pairs that describe configuration that may be passed to different components.
The key should be '.' separated, and the first part before the dot is the component to apply the configuration to.
Valid components are: kubelet, kubeadm, apiserver, controller-manager, etcd, proxy, scheduler
Valid kubeadm parameters: `+fmt.Sprintf("%s, %s", strings.Join(bsutil.KubeadmExtraArgsWhitelist[bsutil.KubeadmCmdParam], ", "), strings.Join(bsutil.KubeadmExtraArgsWhitelist[bsutil.KubeadmConfigParam], ",")))
startCmd.Flags().String(featureGates, "", "A set of key=value pairs that describe feature gates for alpha/experimental features.")
startCmd.Flags().String(dnsDomain, constants.ClusterDNSDomain, "The cluster dns domain name used in the kubernetes cluster")
startCmd.Flags().String(dnsDomain, constants.ClusterDNSDomain, "The cluster dns domain name used in the Kubernetes cluster")
startCmd.Flags().Int(apiServerPort, constants.APIServerPort, "The apiserver listening port")
startCmd.Flags().String(apiServerName, constants.APIServerName, "The authoritative apiserver hostname for apiserver certificates and connectivity. This can be used if you want to make the apiserver available from outside the machine")
startCmd.Flags().StringArrayVar(&apiServerNames, "apiserver-names", nil, "A set of apiserver names which are used in the generated certificate for kubernetes. This can be used if you want to make the apiserver available from outside the machine")
Expand Down
8 changes: 4 additions & 4 deletions cmd/minikube/cmd/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,10 @@ kubelet: {{.Kubelet}}
// statusCmd represents the status command
var statusCmd = &cobra.Command{
Use: "status",
Short: "Gets the status of a local kubernetes cluster",
Long: `Gets the status of a local kubernetes cluster.
Exit status contains the status of minikube's VM, cluster and kubernetes encoded on it's bits in this order from right to left.
Eg: 7 meaning: 1 (for minikube NOK) + 2 (for cluster NOK) + 4 (for kubernetes NOK)`,
Short: "Gets the status of a local Kubernetes cluster",
Long: `Gets the status of a local Kubernetes cluster.
Exit status contains the status of minikube's VM, cluster and Kubernetes encoded on it's bits in this order from right to left.
Eg: 7 meaning: 1 (for minikube NOK) + 2 (for cluster NOK) + 4 (for Kubernetes NOK)`,
Run: func(cmd *cobra.Command, args []string) {

if output != "text" && statusFormat != defaultStatusFormat {
Expand Down
4 changes: 2 additions & 2 deletions cmd/minikube/cmd/stop.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ import (
// stopCmd represents the stop command
var stopCmd = &cobra.Command{
Use: "stop",
Short: "Stops a running local kubernetes cluster",
Long: `Stops a local kubernetes cluster running in Virtualbox. This command stops the VM
Short: "Stops a running local Kubernetes cluster",
Long: `Stops a local Kubernetes cluster running in Virtualbox. This command stops the VM
itself, leaving all files intact. The cluster can be started again with the "start" command.`,
Run: runStop,
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/minikube/cmd/tunnel.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ var cleanup bool
// tunnelCmd represents the tunnel command
var tunnelCmd = &cobra.Command{
Use: "tunnel",
Short: "tunnel makes services of type LoadBalancer accessible on localhost",
Short: "Connect to LoadBalancer services",
Long: `tunnel creates a route to services deployed with type LoadBalancer and sets their Ingress to their ClusterIP. for a detailed example see https://minikube.sigs.k8s.io/docs/tasks/loadbalancer`,
PersistentPreRun: func(cmd *cobra.Command, args []string) {
RootCmd.PersistentPreRun(cmd, args)
Expand Down
2 changes: 1 addition & 1 deletion cmd/minikube/cmd/update-context.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
// updateContextCmd represents the update-context command
var updateContextCmd = &cobra.Command{
Use: "update-context",
Short: "Verify the IP address of the running cluster in kubeconfig.",
Short: "Update kubeconfig in case of an IP or port change",
Long: `Retrieves the IP address of the running cluster, checks it
with IP in kubeconfig, and corrects kubeconfig if incorrect.`,
Run: func(cmd *cobra.Command, args []string) {
Expand Down
2 changes: 1 addition & 1 deletion hack/preload-images/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func generateTarball(kubernetesVersion, containerRuntime, tarballFilename string
// will need to do this to enable the container run-time service
sv, err := util.ParseKubernetesVersion(kubernetesVersion)
if err != nil {
return errors.Wrap(err, "Failed to parse kubernetes version")
return errors.Wrap(err, "Failed to parse Kubernetes version")
}

co := cruntime.Config{
Expand Down
Loading

0 comments on commit 294a5c3

Please sign in to comment.