Documentation ¶
Index ¶
- Constants
- Variables
- func AddToConfigMap(name string, images []string) error
- func AskForPasswordValue(s string) string
- func AskForStaticValue(s string) string
- func AskForStaticValueOptional(s string) string
- func AskForYesNoConfirmation(s string, posResponses, negResponses []string) bool
- func DeleteFromConfigMap(name string, images []string) error
- func EnableOrDisableAddon(name string, val string) error
- func EnableOrDisableStorageClasses(name, val string) error
- func Get(name string) (string, error)
- func IsContainerdRuntime(_, _ string) error
- func IsPositive(name string, val string) error
- func IsURLExists(name string, location string) error
- func IsValidAddon(name string, val string) error
- func IsValidCIDR(name string, cidr string) error
- func IsValidDiskSize(name string, disksize string) error
- func IsValidDriver(string, name string) error
- func IsValidPath(name string, path string) error
- func IsValidRuntime(name string, runtime string) error
- func IsValidURL(name string, location string) error
- func ListConfigMap(name string) ([]string, error)
- func RequiresRestartMsg(string, string) error
- func Set(name string, value string) error
- func SetBool(m config.MinikubeConfig, name string, val string) error
- func SetConfigMap(m config.MinikubeConfig, name string, val string) error
- func SetInt(m config.MinikubeConfig, name string, val string) error
- func SetMap(m config.MinikubeConfig, name string, val map[string]interface{}) error
- func SetString(m config.MinikubeConfig, name string, val string) error
- func Unset(name string) error
- func View() error
- type AddonListTemplate
- type ErrValidateProfile
- type Setting
- type ViewTemplate
Constants ¶
const Bootstrapper = "bootstrapper"
Bootstrapper is the name for bootstrapper
Variables ¶
var AddonsCmd = &cobra.Command{ Use: "addons SUBCOMMAND [flags]", Short: "Modify minikube's kubernetes addons", 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 { glog.Errorf("help: %v", err) } }, }
AddonsCmd represents the addons command
var ConfigCmd = &cobra.Command{ Use: "config SUBCOMMAND [flags]", Short: "Modify minikube config", Long: `config modifies minikube config files using subcommands like "minikube config set vm-driver kvm" Configurable fields: ` + "\n\n" + configurableFields(), Run: func(cmd *cobra.Command, args []string) { if err := cmd.Help(); err != nil { glog.Errorf("help: %v", err) } }, }
ConfigCmd represents the config 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", 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 { profile := viper.GetString(pkgConfig.MachineProfile) out.T(out.Empty, profile) os.Exit(0) } if len(args) > 1 { exit.UsageT("usage: minikube profile [MINIKUBE_PROFILE_NAME]") } profile := args[0] if pkgConfig.ProfileNameInReservedKeywords(profile) { out.ErrT(out.FailureType, `Profile name "{{.profilename}}" is minikube keyword. To delete profile use command minikube delete -p <profile name> `, out.V{"profilename": profile}) os.Exit(0) } if profile == "default" { profile = "minikube" } else { errProfile, ok := ValidateProfile(profile) if !ok && errProfile != nil { out.FailureT(errProfile.Msg) } } if !pkgConfig.ProfileExists(profile) { err := pkgConfig.CreateEmptyProfile(profile) if err != nil { exit.WithError("Creating a new profile failed", err) } out.SuccessT("Created a new profile : {{.profile_name}}", out.V{"profile_name": profile}) } err := Set(pkgConfig.MachineProfile, profile) if err != nil { exit.WithError("Setting profile failed", err) } cc, err := pkgConfig.Load(profile) if err != nil && !os.IsNotExist(err) { out.ErrT(out.Sad, `Error loading profile config: {{.error}}`, out.V{"error": err}) } if err == nil { if cc.KeepContext { out.SuccessT("Skipped switching kubectl context for {{.profile_name}} because --keep-context was set.", out.V{"profile_name": profile}) out.SuccessT("To connect to this cluster, use: kubectl --context={{.profile_name}}", out.V{"profile_name": profile}) } else { err := kubeconfig.SetCurrentContext(profile, constants.KubeconfigPath) if err != nil { out.ErrT(out.Sad, `Error while setting kubectl current context : {{.error}}`, out.V{"error": err}) } } } out.SuccessT("minikube profile was successfully set to {{.profile_name}}", out.V{"profile_name": profile}) }, }
ProfileCmd represents the profile command
Functions ¶
func AddToConfigMap ¶ added in v0.24.0
AddToConfigMap adds entries to a map in the config file
func AskForPasswordValue ¶ added in v0.21.0
AskForPasswordValue asks for a password value, while hiding the input
func AskForStaticValue ¶ added in v0.17.0
AskForStaticValue asks for a single value to enter
func AskForStaticValueOptional ¶ added in v0.22.0
AskForStaticValueOptional asks for a optional single value to enter, can just skip enter
func AskForYesNoConfirmation ¶ added in v0.17.0
AskForYesNoConfirmation asks the user for confirmation. A user must type in "yes" or "no" and then press enter. It has fuzzy matching, so "y", "Y", "yes", "YES", and "Yes" all count as confirmations. If the input is not recognized, it will ask again. The function does not return until it gets a valid response from the user.
func DeleteFromConfigMap ¶ added in v0.24.0
DeleteFromConfigMap deletes entries from a map in the config file
func EnableOrDisableAddon ¶ added in v0.12.0
EnableOrDisableAddon updates addon status executing any commands necessary
func EnableOrDisableStorageClasses ¶ added in v0.33.0
EnableOrDisableStorageClasses enables or disables storage classes
func IsContainerdRuntime ¶ added in v0.31.0
IsContainerdRuntime is a validator which returns an error if the current runtime is not containerd
func IsPositive ¶
IsPositive checks if an integer is positive
func IsURLExists ¶ added in v0.31.0
IsURLExists checks if a location actually exists
func IsValidAddon ¶ added in v0.12.0
IsValidAddon checks if a string is a valid addon
func IsValidCIDR ¶
IsValidCIDR checks if a string parses as a CIDR
func IsValidDiskSize ¶
IsValidDiskSize checks if a string is a valid disk size
func IsValidDriver ¶
IsValidDriver checks if a driver is supported
func IsValidPath ¶
IsValidPath checks if a string is a valid path
func IsValidRuntime ¶ added in v1.6.0
IsValidRuntime checks if a string is a valid runtime
func IsValidURL ¶ added in v0.14.0
IsValidURL checks if a location is a valid URL
func ListConfigMap ¶ added in v0.25.0
ListConfigMap list entries from config file
func RequiresRestartMsg ¶
RequiresRestartMsg returns the "requires restart" message
func SetBool ¶
func SetBool(m config.MinikubeConfig, name string, val string) error
SetBool sets a bool value
func SetConfigMap ¶ added in v0.24.0
func SetConfigMap(m config.MinikubeConfig, name string, val string) error
SetConfigMap sets a config map value
func SetInt ¶
func SetInt(m config.MinikubeConfig, name string, val string) error
SetInt sets an int value
func SetMap ¶ added in v0.24.0
func SetMap(m config.MinikubeConfig, name string, val map[string]interface{}) error
SetMap sets a map value
Types ¶
type AddonListTemplate ¶ added in v0.12.0
AddonListTemplate represents the addon list template
type ErrValidateProfile ¶ added in v1.5.0
ErrValidateProfile Error to validate profile
func ValidateProfile ¶ added in v1.5.0
func ValidateProfile(profile string) (*ErrValidateProfile, bool)
ValidateProfile checks if the profile user is trying to switch exists, else throws error
func (ErrValidateProfile) Error ¶ added in v1.5.0
func (e ErrValidateProfile) Error() string
type Setting ¶
type Setting struct {
// contains filtered or unexported fields
}
Setting represents a setting
type ViewTemplate ¶ added in v1.0.0
type ViewTemplate struct { ConfigKey string ConfigValue interface{} }
ViewTemplate represents the view template