config

package
v1.4.0-beta.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 5, 2019 License: Apache-2.0 Imports: 15 Imported by: 315

Documentation

Index

Constants

View Source
const (
	// WantUpdateNotification is the key for WantUpdateNotification
	WantUpdateNotification = "WantUpdateNotification"
	// ReminderWaitPeriodInHours is the key for WantUpdateNotification
	ReminderWaitPeriodInHours = "ReminderWaitPeriodInHours"
	// WantReportError is the key for WantReportError
	WantReportError = "WantReportError"
	// WantReportErrorPrompt is the key for WantReportErrorPrompt
	WantReportErrorPrompt = "WantReportErrorPrompt"
	// WantKubectlDownloadMsg is the key for WantKubectlDownloadMsg
	WantKubectlDownloadMsg = "WantKubectlDownloadMsg"
	// WantNoneDriverWarning is the key for WantNoneDriverWarning
	WantNoneDriverWarning = "WantNoneDriverWarning"
	// MachineProfile is the key for MachineProfile
	MachineProfile = "profile"
	// ShowDriverDeprecationNotification is the key for ShowDriverDeprecationNotification
	ShowDriverDeprecationNotification = "ShowDriverDeprecationNotification"
	// ShowBootstrapperDeprecationNotification is the key for ShowBootstrapperDeprecationNotification
	ShowBootstrapperDeprecationNotification = "ShowBootstrapperDeprecationNotification"
)

Variables

View Source
var (
	// ErrKeyNotFound is the error returned when a key doesn't exist in the config file
	ErrKeyNotFound = errors.New("specified key could not be found in config")
)

Functions

func ContainsParam added in v1.4.0

func ContainsParam(slice []string, s string) bool

ContainsParam checks if a given slice of strings contains the provided string. If a modifier func is provided, it is called with the slice item before the comparation.

func CreateEmptyProfile added in v1.4.0

func CreateEmptyProfile(name string, miniHome ...string) error

CreateProfile creates an empty profile stores in $MINIKUBE_HOME/profiles/<profilename>/config.json

func CreateProfile added in v1.4.0

func CreateProfile(name string, cfg *Config, miniHome ...string) error

CreateProfile creates an profile out of the cfg and stores in $MINIKUBE_HOME/profiles/<profilename>/config.json

func DeleteProfile added in v1.4.0

func DeleteProfile(profile string, miniHome ...string) error

func Get added in v0.12.0

func Get(name string) (string, error)

Get gets a named value from config

func GetMachineName added in v0.19.0

func GetMachineName() string

GetMachineName gets the machine name for the VM

func ListProfiles added in v1.3.0

func ListProfiles(miniHome ...string) (validPs []*Profile, inValidPs []*Profile, err error)

ListProfiles returns all valid and invalid (if any) minikube profiles invalidPs are the profiles that have a directory or config file but not usable invalidPs would be suggested to be deleted

func ProfileExists added in v1.4.0

func ProfileExists(name string, miniHome ...string) bool

ProfileExists returns true if there is a profile config (regardless of being valid)

func WriteConfig added in v1.3.1

func WriteConfig(configFile string, m MinikubeConfig) error

WriteConfig writes a minikube config to the JSON file

Types

type ComponentExtraOptionMap added in v1.4.0

type ComponentExtraOptionMap map[string]map[string]string

ComponentExtraOptionMap maps components to their extra opts, which is a map of keys to values

func (ComponentExtraOptionMap) Get added in v1.4.0

func (cm ComponentExtraOptionMap) Get(component string) map[string]string

Get returns the extra option map of keys to values for the specified component

type Config added in v0.26.0

type Config struct {
	MachineConfig    MachineConfig
	KubernetesConfig KubernetesConfig
}

Config contains machine and k8s config

func Load added in v0.31.0

func Load() (*Config, error)

Load loads the kubernetes and machine config for the current machine

type ExtraOption added in v1.4.0

type ExtraOption struct {
	Component string
	Key       string
	Value     string
}

ExtraOption is an extra option

func (*ExtraOption) String added in v1.4.0

func (e *ExtraOption) String() string

type ExtraOptionSlice added in v1.4.0

type ExtraOptionSlice []ExtraOption

ExtraOptionSlice is a slice of ExtraOption

func (*ExtraOptionSlice) AsMap added in v1.4.0

AsMap converts the slice to a map of components to a map of keys and values.

func (*ExtraOptionSlice) Get added in v1.4.0

func (es *ExtraOptionSlice) Get(key string, component ...string) string

Get finds and returns the value of an argument with the specified key and component (optional) or an empty string if not found. If component contains more than one value, the value for the first component found is returned. If component is not specified, all of the components are used.

func (*ExtraOptionSlice) Set added in v1.4.0

func (es *ExtraOptionSlice) Set(value string) error

Set parses the string value into a slice

func (*ExtraOptionSlice) String added in v1.4.0

func (es *ExtraOptionSlice) String() string

String converts the slice to a string value

func (*ExtraOptionSlice) Type added in v1.4.0

func (es *ExtraOptionSlice) Type() string

Type returns the type

type KubernetesConfig added in v0.26.0

type KubernetesConfig struct {
	KubernetesVersion string
	NodeIP            string
	NodePort          int
	NodeName          string
	APIServerName     string
	APIServerNames    []string
	APIServerIPs      []net.IP
	DNSDomain         string
	ContainerRuntime  string
	CRISocket         string
	NetworkPlugin     string
	FeatureGates      string
	ServiceCIDR       string
	ImageRepository   string
	ExtraOptions      ExtraOptionSlice

	ShouldLoadCachedImages bool
	EnableDefaultCNI       bool
}

KubernetesConfig contains the parameters used to configure the VM Kubernetes.

type Loader added in v0.31.0

type Loader interface {
	LoadConfigFromFile(profile string, miniHome ...string) (*Config, error)
}

Loader loads the kubernetes and machine config based on the machine profile name

var DefaultLoader Loader = &simpleConfigLoader{}

DefaultLoader is the default config loader

type MachineConfig added in v0.26.0

type MachineConfig struct {
	KeepContext         bool // used by start and profile command to or not to switch kubectl's current context
	EmbedCerts          bool // used by kubeconfig.Setup
	MinikubeISO         string
	Memory              int
	CPUs                int
	DiskSize            int
	VMDriver            string
	ContainerRuntime    string
	HyperkitVpnKitSock  string   // Only used by the Hyperkit driver
	HyperkitVSockPorts  []string // Only used by the Hyperkit driver
	DockerEnv           []string // Each entry is formatted as KEY=VALUE.
	InsecureRegistry    []string
	RegistryMirror      []string
	HostOnlyCIDR        string // Only used by the virtualbox driver
	HypervVirtualSwitch string
	KVMNetwork          string             // Only used by the KVM driver
	KVMQemuURI          string             // Only used by kvm2
	KVMGPU              bool               // Only used by kvm2
	KVMHidden           bool               // Only used by kvm2
	Downloader          util.ISODownloader `json:"-"`
	DockerOpt           []string           // Each entry is formatted as KEY=VALUE.
	DisableDriverMounts bool               // Only used by virtualbox
	NFSShare            []string
	NFSSharesRoot       string
	UUID                string // Only used by hyperkit to restore the mac address
	NoVTXCheck          bool   // Only used by virtualbox
	DNSProxy            bool   // Only used by virtualbox
	HostDNSResolver     bool   // Only used by virtualbox
}

MachineConfig contains the parameters used to start a cluster.

type MinikubeConfig added in v0.12.0

type MinikubeConfig map[string]interface{}

MinikubeConfig represents minikube config

func ReadConfig added in v0.12.0

func ReadConfig(configFile string) (MinikubeConfig, error)

ReadConfig reads in the JSON minikube config

type Profile added in v1.3.0

type Profile struct {
	Name   string
	Config *Config
}

Profile represents a minikube profile

type VersionedExtraOption added in v1.4.0

type VersionedExtraOption struct {

	// The flag and component that will be set
	Option ExtraOption

	// This flag will only be applied to versions before or equal to this version
	// If it is the default value, it will have no upper bound on versions the
	// flag is applied to
	LessThanOrEqual semver.Version

	// The flag will only be applied to versions after or equal to this version
	// If it is the default value, it will have no lower bound on versions the
	// flag is applied to
	GreaterThanOrEqual semver.Version
}

VersionedExtraOption holds information on flags to apply to a specific range of versions

func NewUnversionedOption added in v1.4.0

func NewUnversionedOption(component, k, v string) VersionedExtraOption

NewUnversionedOption returns a VersionedExtraOption that applies to all versions.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL