Skip to content

Commit

Permalink
add kube-binaries-mirror flag to start cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
presztak committed Nov 22, 2021
1 parent d94b301 commit 9e4ca85
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/minikube/cmd/start_flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ const (
listenAddress = "listen-address"
extraDisks = "extra-disks"
certExpiration = "cert-expiration"
kubeBinariesMirror = "kube-binaries-mirror"
)

var (
Expand Down Expand Up @@ -173,6 +174,7 @@ func initMinikubeFlags() {
startCmd.Flags().StringP(trace, "", "", "Send trace events. Options include: [gcp]")
startCmd.Flags().Int(extraDisks, 0, "Number of extra disks created and attached to the minikube VM (currently only implemented for hyperkit and kvm2 drivers)")
startCmd.Flags().Duration(certExpiration, constants.DefaultCertExpiration, "Duration until minikube certificate expiration, defaults to three years (26280h).")
startCmd.Flags().String(kubeBinariesMirror, "", "Location to fetch kubectl, kubelet, & kubeadm binaries from.")
}

// initKubernetesFlags inits the commandline flags for Kubernetes related options
Expand Down Expand Up @@ -466,6 +468,7 @@ func generateNewConfigFromFlags(cmd *cobra.Command, k8sVersion string, drvName s
CertExpiration: viper.GetDuration(certExpiration),
Mount: viper.GetBool(createMount),
MountString: viper.GetString(mountString),
KubeBinariesMirror: viper.GetString(kubeBinariesMirror),
KubernetesConfig: config.KubernetesConfig{
KubernetesVersion: k8sVersion,
ClusterName: ClusterFlagValue(),
Expand Down Expand Up @@ -668,6 +671,7 @@ func updateExistingConfigFromFlags(cmd *cobra.Command, existing *config.ClusterC
updateDurationFromFlag(cmd, &cc.CertExpiration, certExpiration)
updateBoolFromFlag(cmd, &cc.Mount, createMount)
updateStringFromFlag(cmd, &cc.MountString, mountString)
updateStringFromFlag(cmd, &cc.KubeBinariesMirror, kubeBinariesMirror)

if cmd.Flags().Changed(kubernetesVersion) {
cc.KubernetesConfig.KubernetesVersion = getKubernetesVersion(existing)
Expand Down
1 change: 1 addition & 0 deletions pkg/minikube/config/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ type ClusterConfig struct {
CertExpiration time.Duration
Mount bool
MountString string
KubeBinariesMirror string // Mirror location for kube binaries (kubectl, kubelet, & kubeadm)
}

// KubernetesConfig contains the parameters used to configure the VM Kubernetes.
Expand Down

0 comments on commit 9e4ca85

Please sign in to comment.