Documentation ¶
Index ¶
- Constants
- Variables
- func ClusterFlagValue() string
- func DeleteProfiles(profiles []*config.Profile) []error
- func Execute()
- func GenerateBashCompletion(w io.Writer, cmd *cobra.Command) error
- func GenerateFishCompletion(w io.Writer, cmd *cobra.Command) error
- func GeneratePowerShellCompletion(w io.Writer, cmd *cobra.Command) error
- func GenerateZshCompletion(out io.Writer, cmd *cobra.Command) error
- func HandleDeletionErrors(errors []error)
- func KubectlCommand(version, binaryURL string, args ...string) (*exec.Cmd, error)
- type BaseState
- type CacheListTemplate
- type ClusterState
- type DeletionError
- type DockerEnvConfig
- type DockerShellConfig
- type EnvNoProxyGetter
- type NoProxyGetter
- type NodeState
- type PodmanEnvConfig
- type PodmanShellConfig
- type Status
Constants ¶
const ( // Fatal is a type of DeletionError Fatal typeOfError = 0 // MissingProfile is a type of DeletionError MissingProfile typeOfError = 1 // MissingCluster is a type of DeletionError MissingCluster typeOfError = 2 )
const ( // Configured means configured Configured = "Configured" // ~state.Saved // Misconfigured means misconfigured Misconfigured = "Misconfigured" // ~state.Error // Nonexistent means the resource does not exist Nonexistent = "Nonexistent" // ~state.None // Irrelevant is used for statuses that aren't meaningful for worker nodes Irrelevant = "Irrelevant" )
Additional legacy states
const ( Starting = 100 Pausing = 101 Unpausing = 102 Stopping = 110 Deleting = 120 OK = 200 Warning = 203 NotFound = 404 Stopped = 405 Paused = 418 // I'm a teapot! Error = 500 InsufficientStorage = 507 Unknown = 520 )
New status modes, based roughly on HTTP/SMTP standards
Variables ¶
var ( // ErrKubernetesPatchNotFound is when a patch was not found for the given <major>.<minor> version ErrKubernetesPatchNotFound = errors.New("Unable to detect the latest patch release for specified Kubernetes version") )
var RootCmd = &cobra.Command{ Use: "minikube", Short: "minikube quickly sets up a local Kubernetes cluster", Long: `minikube provisions and manages local Kubernetes clusters optimized for development workflows.`, PersistentPreRun: func(_ *cobra.Command, _ []string) { for _, path := range dirs { if err := os.MkdirAll(path, 0777); err != nil { exit.Error(reason.HostHomeMkdir, "Error creating minikube directory", err) } } userName := viper.GetString(config.UserFlag) if !validateUsername(userName) { out.WarningT("User name '{{.username}}' is not valid", out.V{"username": userName}) exit.Message(reason.Usage, "User name must be 60 chars or less.") } var err error auditID, err = audit.LogCommandStart() if err != nil { klog.Warningf("failed to log command start to audit: %v", err) } if viper.GetBool(config.Rootless) { os.Setenv(constants.MinikubeRootlessEnv, "true") } }, PersistentPostRun: func(_ *cobra.Command, _ []string) { if err := audit.LogCommandEnd(auditID); err != nil { klog.Warningf("failed to log command end to audit: %v", err) } }, }
RootCmd represents the base command when called without any subcommands
Functions ¶
func ClusterFlagValue ¶ added in v1.9.0
func ClusterFlagValue() string
ClusterFlagValue returns the current cluster name based on flags
func DeleteProfiles ¶ added in v1.5.0
DeleteProfiles deletes one or more profiles
func Execute ¶
func Execute()
Execute adds all child commands to the root command sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.
func GenerateBashCompletion ¶ added in v0.12.1
GenerateBashCompletion generates the completion for the bash shell
func GenerateFishCompletion ¶ added in v1.10.0
GenerateFishCompletion generates the completion for the bash shell
func GeneratePowerShellCompletion ¶ added in v1.31.0
GeneratePowerShellCompletion generates the completion for the PowerShell
func GenerateZshCompletion ¶ added in v0.24.0
GenerateZshCompletion generates the completion for the zsh shell
func HandleDeletionErrors ¶ added in v1.5.0
func HandleDeletionErrors(errors []error)
HandleDeletionErrors handles deletion errors from DeleteProfiles
Types ¶
type BaseState ¶ added in v1.12.2
type BaseState struct { // Name is the name of the object Name string // StatusCode is an HTTP-like status code for this object StatusCode int // Name is a human-readable name for the status code StatusName string // StatusDetail is long human-readable string describing why this particular status code was chosen StatusDetail string `json:",omitempty"` // Not yet implemented // Step is which workflow step the object is at. Step string `json:",omitempty"` // StepDetail is a long human-readable string describing the step StepDetail string `json:",omitempty"` }
BaseState holds a component state representation, such as "apiserver" or "kubeconfig"
type CacheListTemplate ¶ added in v0.25.0
type CacheListTemplate struct {
CacheImage string
}
CacheListTemplate represents the cache list template
type ClusterState ¶ added in v1.12.2
type ClusterState struct { BaseState BinaryVersion string TimeToStop string `json:",omitempty"` Components map[string]BaseState Nodes []NodeState }
ClusterState holds a cluster state representation
type DeletionError ¶ added in v1.5.0
type DeletionError struct { Err error Errtype typeOfError }
DeletionError can be returned from DeleteProfiles
func (DeletionError) Error ¶ added in v1.5.0
func (error DeletionError) Error() string
type DockerEnvConfig ¶ added in v1.7.3
DockerEnvConfig encapsulates all external inputs into shell generation for Docker
type DockerShellConfig ¶ added in v1.7.3
type DockerShellConfig struct { shell.Config DockerCertPath string DockerHost string DockerTLSVerify string MinikubeDockerdProfile string NoProxyVar string NoProxyValue string ExistingDockerCertPath string ExistingDockerHost string ExistingDockerTLSVerify string SSHAuthSock string SSHAgentPID string }
DockerShellConfig represents the shell config for Docker
type EnvNoProxyGetter ¶ added in v0.17.0
type EnvNoProxyGetter struct{}
EnvNoProxyGetter gets the no_proxy variable, using environment
func (EnvNoProxyGetter) GetNoProxyVar ¶ added in v0.17.0
func (EnvNoProxyGetter) GetNoProxyVar() (string, string)
GetNoProxyVar gets the no_proxy var
type NoProxyGetter ¶ added in v0.17.0
NoProxyGetter gets the no_proxy variable
type PodmanEnvConfig ¶ added in v1.7.3
PodmanEnvConfig encapsulates all external inputs into shell generation for Podman
type PodmanShellConfig ¶ added in v1.7.3
type PodmanShellConfig struct { shell.Config VarlinkBridge string ContainerHost string ContainerSSHKey string MinikubePodmanProfile string ExistingContainerHost string }
PodmanShellConfig represents the shell config for Podman
type Status ¶ added in v0.10.0
type Status struct { Name string Host string Kubelet string APIServer string Kubeconfig string Worker bool TimeToStop string `json:",omitempty"` DockerEnv string `json:",omitempty"` PodManEnv string `json:",omitempty"` }
Status holds string representations of component states
Source Files ¶
- cache.go
- cache_list.go
- completion.go
- cp.go
- dashboard.go
- delete.go
- docker-env.go
- generate-docs.go
- image.go
- ip.go
- kubectl.go
- license.go
- logs.go
- mount.go
- node.go
- node_add.go
- node_delete.go
- node_list.go
- node_start.go
- node_stop.go
- options.go
- pause.go
- podman-env.go
- root.go
- service.go
- service_list.go
- ssh-host.go
- ssh-key.go
- ssh.go
- start.go
- start_flags.go
- status.go
- stop.go
- tunnel.go
- unpause.go
- update-check.go
- update-context.go
- version.go