Skip to content

Commit 113ccf0

Browse files
committed
Add cross-architecture remote Docker support with SSH tunneling and TLS certificate handling
1 parent 759214f commit 113ccf0

File tree

122 files changed

+5790
-643
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

122 files changed

+5790
-643
lines changed

Makefile

Lines changed: 28 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ KIC_VERSION ?= $(shell grep -E "Version =" pkg/drivers/kic/types.go | cut -d \"
2424
HUGO_VERSION ?= $(shell grep -E "HUGO_VERSION = \"" netlify.toml | cut -d \" -f2)
2525

2626
# Default to .0 for higher cache hit rates, as build increments typically don't require new ISO versions
27-
ISO_VERSION ?= v1.36.0
27+
ISO_VERSION ?= v1.36.0-1751315722-20991
2828

2929
# Dashes are valid in semver, but not Linux packaging. Use ~ to delimit alpha/beta
3030
DEB_VERSION ?= $(subst -,~,$(RAW_VERSION))
@@ -79,7 +79,6 @@ MINIKUBE_BUCKET ?= minikube/releases
7979
MINIKUBE_UPLOAD_LOCATION := gs://${MINIKUBE_BUCKET}
8080
MINIKUBE_RELEASES_URL=https://github.com/kubernetes/minikube/releases/download
8181

82-
KERNEL_VERSION ?= 5.10.207
8382
# latest from https://github.com/golangci/golangci-lint/releases
8483
# update this only by running `make update-golint-version`
8584
GOLINT_VERSION ?= v2.1.5
@@ -103,7 +102,7 @@ $(shell mkdir -p $(BUILD_DIR))
103102
CURRENT_GIT_BRANCH ?= $(shell git branch | grep \* | cut -d ' ' -f2)
104103

105104
# Use system python if it exists, otherwise use Docker.
106-
PYTHON := $(shell command -v python || echo "docker run --rm -it -v $(shell pwd):/minikube:Z -w /minikube python python")
105+
PYTHON := $(shell command -v python || echo "docker run --rm -it -v $(shell pwd):/minikube -w /minikube python python")
107106
BUILD_OS := $(shell uname -s)
108107

109108
SHA512SUM=$(shell command -v sha512sum || echo "shasum -a 512")
@@ -189,7 +188,7 @@ endef
189188

190189
# $(call DOCKER, image, command)
191190
define DOCKER
192-
docker run --rm -e GOCACHE=/app/.cache -e IN_DOCKER=1 --user $(shell id -u):$(shell id -g) -w /app -v $(PWD):/app:Z -v $(GOPATH):/go --init $(1) /bin/bash -c '$(2)'
191+
docker run --rm -e GOCACHE=/app/.cache -e IN_DOCKER=1 --user $(shell id -u):$(shell id -g) -w /app -v $(PWD):/app -v $(GOPATH):/go --init $(1) /bin/bash -c '$(2)'
193192
endef
194193

195194
ifeq ($(BUILD_IN_DOCKER),y)
@@ -302,10 +301,25 @@ out/e2e-windows-amd64.exe: out/e2e-windows-amd64
302301
minikube-iso-amd64: minikube-iso-x86_64
303302
minikube-iso-arm64: minikube-iso-aarch64
304303

305-
minikube-iso-%: deploy/iso/minikube-iso/board/minikube/%/rootfs-overlay/usr/bin/auto-pause # build minikube iso
304+
minikube-iso-%: iso-prepare-% deploy/iso/minikube-iso/board/minikube/%/rootfs-overlay/usr/bin/auto-pause # build minikube iso
305+
$(MAKE) -C $(BUILD_DIR)/buildroot $(BUILDROOT_OPTIONS) O=$(BUILD_DIR)/buildroot/output-$* host-python3
306+
$(MAKE) -C $(BUILD_DIR)/buildroot $(BUILDROOT_OPTIONS) O=$(BUILD_DIR)/buildroot/output-$*
307+
# x86_64 ISO is still BIOS rather than EFI because of AppArmor issues for KVM, and Gen 2 issues for Hyper-V
308+
if [ "$*" = "aarch64" ]; then \
309+
mv $(BUILD_DIR)/buildroot/output-aarch64/images/boot.iso $(BUILD_DIR)/minikube-arm64.iso; \
310+
else \
311+
mv $(BUILD_DIR)/buildroot/output-x86_64/images/rootfs.iso9660 $(BUILD_DIR)/minikube-amd64.iso; \
312+
fi;
313+
314+
.PHONY: iso-prepare-%
315+
iso-prepare-%: buildroot
306316
echo $(VERSION_JSON) > deploy/iso/minikube-iso/board/minikube/$*/rootfs-overlay/version.json
307317
echo $(ISO_VERSION) > deploy/iso/minikube-iso/board/minikube/$*/rootfs-overlay/etc/VERSION
308318
cp deploy/iso/minikube-iso/arch/$*/Config.in.tmpl deploy/iso/minikube-iso/Config.in
319+
$(MAKE) -C $(BUILD_DIR)/buildroot $(BUILDROOT_OPTIONS) O=$(BUILD_DIR)/buildroot/output-$* minikube_$*_defconfig
320+
321+
.PHONY: buildroot
322+
buildroot:
309323
if [ ! -d $(BUILD_DIR)/buildroot ]; then \
310324
mkdir -p $(BUILD_DIR); \
311325
git clone --depth=1 --branch=$(BUILDROOT_BRANCH) https://github.com/buildroot/buildroot $(BUILD_DIR)/buildroot; \
@@ -315,39 +329,30 @@ minikube-iso-%: deploy/iso/minikube-iso/board/minikube/%/rootfs-overlay/usr/bin/
315329
git --git-dir=$(BUILD_DIR)/buildroot/.git config user.email "dev@random.com"; \
316330
git --git-dir=$(BUILD_DIR)/buildroot/.git config user.name "Random developer"; \
317331
fi;
318-
$(MAKE) -C $(BUILD_DIR)/buildroot $(BUILDROOT_OPTIONS) O=$(BUILD_DIR)/buildroot/output-$* minikube_$*_defconfig
319-
$(MAKE) -C $(BUILD_DIR)/buildroot $(BUILDROOT_OPTIONS) O=$(BUILD_DIR)/buildroot/output-$* host-python3
320-
$(MAKE) -C $(BUILD_DIR)/buildroot $(BUILDROOT_OPTIONS) O=$(BUILD_DIR)/buildroot/output-$*
321-
# x86_64 ISO is still BIOS rather than EFI because of AppArmor issues for KVM, and Gen 2 issues for Hyper-V
322-
if [ "$*" = "aarch64" ]; then \
323-
mv $(BUILD_DIR)/buildroot/output-aarch64/images/boot.iso $(BUILD_DIR)/minikube-arm64.iso; \
324-
else \
325-
mv $(BUILD_DIR)/buildroot/output-x86_64/images/rootfs.iso9660 $(BUILD_DIR)/minikube-amd64.iso; \
326-
fi;
327332

328333
# Change buildroot configuration for the minikube ISO
329334
.PHONY: iso-menuconfig
330-
iso-menuconfig-%: ## Configure buildroot configuration
335+
iso-menuconfig-%: iso-prepare-% ## Configure buildroot configuration
331336
$(MAKE) -C $(BUILD_DIR)/buildroot $(BUILDROOT_OPTIONS) O=$(BUILD_DIR)/buildroot/output-$* menuconfig
332337
$(MAKE) -C $(BUILD_DIR)/buildroot $(BUILDROOT_OPTIONS) O=$(BUILD_DIR)/buildroot/output-$* savedefconfig
333338

334339
# Change the kernel configuration for the minikube ISO
335-
linux-menuconfig-%: ## Configure Linux kernel configuration
336-
$(MAKE) -C $(BUILD_DIR)/buildroot/output-$*/build/linux-$(KERNEL_VERSION)/ menuconfig
337-
$(MAKE) -C $(BUILD_DIR)/buildroot/output-$*/build/linux-$(KERNEL_VERSION)/ savedefconfig
338-
cp $(BUILD_DIR)/buildroot/output-$*/build/linux-$(KERNEL_VERSION)/defconfig deploy/iso/minikube-iso/board/minikube/$*/linux_$*_defconfig
340+
linux-menuconfig-%: iso-prepare-% ## Configure Linux kernel configuration
341+
$(MAKE) -C $(BUILD_DIR)/buildroot $(BUILDROOT_OPTIONS) O=$(BUILD_DIR)/buildroot/output-$* linux-menuconfig
342+
$(MAKE) -C $(BUILD_DIR)/buildroot $(BUILDROOT_OPTIONS) O=$(BUILD_DIR)/buildroot/output-$* linux-savedefconfig
343+
$(MAKE) -C $(BUILD_DIR)/buildroot $(BUILDROOT_OPTIONS) O=$(BUILD_DIR)/buildroot/output-$* linux-update-defconfig
339344

340345
out/minikube-%.iso: $(shell find "deploy/iso/minikube-iso" -type f)
341346
ifeq ($(IN_DOCKER),1)
342347
$(MAKE) minikube-iso-$*
343348
else
344-
docker run --rm --workdir /mnt --volume $(CURDIR):/mnt:Z $(ISO_DOCKER_EXTRA_ARGS) \
349+
docker run --rm --workdir /mnt --volume $(CURDIR):/mnt $(ISO_DOCKER_EXTRA_ARGS) \
345350
--user $(shell id -u):$(shell id -g) --env HOME=/tmp --env IN_DOCKER=1 \
346351
$(ISO_BUILD_IMAGE) /bin/bash -lc '/usr/bin/make minikube-iso-$*'
347352
endif
348353

349354
iso_in_docker:
350-
docker run -it --rm --workdir /mnt --volume $(CURDIR):/mnt:Z $(ISO_DOCKER_EXTRA_ARGS) \
355+
docker run -it --rm --workdir /mnt --volume $(CURDIR):/mnt $(ISO_DOCKER_EXTRA_ARGS) \
351356
--user $(shell id -u):$(shell id -g) --env HOME=/tmp --env IN_DOCKER=1 \
352357
$(ISO_BUILD_IMAGE) /bin/bash
353358

@@ -523,7 +528,7 @@ out/linters/golangci-lint-$(GOLINT_VERSION):
523528
.PHONY: lint
524529
ifeq ($(MINIKUBE_BUILD_IN_DOCKER),y)
525530
lint:
526-
docker run --rm -v `pwd`:/app:Z -w /app golangci/golangci-lint:$(GOLINT_VERSION) \
531+
docker run --rm -v `pwd`:/app -w /app golangci/golangci-lint:$(GOLINT_VERSION) \
527532
golangci-lint run ${GOLINT_OPTIONS} ./..."
528533
# --skip-dirs "cmd/drivers/kvm|cmd/drivers/hyperkit|pkg/drivers/kvm|pkg/drivers/hyperkit"
529534
# The "--skip-dirs" parameter is no longer supported in the V2 version. If you need to skip the directory,
@@ -657,7 +662,7 @@ out/docker-machine-driver-hyperkit:
657662
ifeq ($(MINIKUBE_BUILD_IN_DOCKER),y)
658663
docker run --rm -e GOCACHE=/app/.cache -e IN_DOCKER=1 \
659664
--user $(shell id -u):$(shell id -g) -w /app \
660-
-v $(PWD):/app:Z -v $(GOPATH):/go:Z --init --entrypoint "" \
665+
-v $(PWD):/app -v $(GOPATH):/go --init --entrypoint "" \
661666
$(HYPERKIT_BUILD_IMAGE) /bin/bash -c 'CC=o64-clang CXX=o64-clang++ /usr/bin/make $@'
662667
else
663668
$(if $(quiet),@echo " GO $@")

cmd/minikube/cmd/config/profile_list.go

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,11 @@ import (
4040
"k8s.io/klog/v2"
4141
)
4242

43-
var profileOutput string
44-
var isLight bool
43+
var (
44+
profileOutput string
45+
isLight bool
46+
isDetailed bool
47+
)
4548

4649
var profileListCmd = &cobra.Command{
4750
Use: "list",
@@ -130,7 +133,13 @@ func profileStatus(p *config.Profile, api libmachine.API) cluster.State {
130133

131134
func renderProfilesTable(ps [][]string) {
132135
table := tablewriter.NewWriter(os.Stdout)
133-
table.SetHeader([]string{"Profile", "VM Driver", "Runtime", "IP", "Port", "Version", "Status", "Nodes", "Active Profile", "Active Kubecontext"})
136+
if isDetailed {
137+
table.SetHeader([]string{"Profile", "Driver", "Runtime", "IP", "Port", "Version",
138+
"Status", "Nodes", "Active Profile", "Active Kubecontext"})
139+
} else {
140+
table.SetHeader([]string{"Profile", "Driver", "Runtime", "IP", "Version", "Status",
141+
"Nodes", "Active Profile", "Active Kubecontext"})
142+
}
134143
table.SetAutoFormatHeaders(false)
135144
table.SetBorders(tablewriter.Border{Left: true, Top: true, Right: true, Bottom: true})
136145
table.SetCenterSeparator("|")
@@ -164,7 +173,13 @@ func profilesToTableData(profiles []*config.Profile) [][]string {
164173
if p.ActiveKubeContext {
165174
k = "*"
166175
}
167-
data = append(data, []string{p.Name, p.Config.Driver, p.Config.KubernetesConfig.ContainerRuntime, cpIP, strconv.Itoa(cpPort), k8sVersion, p.Status, strconv.Itoa(len(p.Config.Nodes)), c, k})
176+
if isDetailed {
177+
data = append(data, []string{p.Name, p.Config.Driver, p.Config.KubernetesConfig.ContainerRuntime,
178+
cpIP, strconv.Itoa(cpPort), k8sVersion, p.Status, strconv.Itoa(len(p.Config.Nodes)), c, k})
179+
} else {
180+
data = append(data, []string{p.Name, p.Config.Driver, p.Config.KubernetesConfig.ContainerRuntime,
181+
cpIP, k8sVersion, p.Status, strconv.Itoa(len(p.Config.Nodes)), c, k})
182+
}
168183
}
169184
return data
170185
}
@@ -213,5 +228,6 @@ func profilesOrDefault(profiles []*config.Profile) []*config.Profile {
213228
func init() {
214229
profileListCmd.Flags().StringVarP(&profileOutput, "output", "o", "table", "The output format. One of 'json', 'table'")
215230
profileListCmd.Flags().BoolVarP(&isLight, "light", "l", false, "If true, returns list of profiles faster by skipping validating the status of the cluster.")
231+
profileListCmd.Flags().BoolVarP(&isDetailed, "detailed", "d", false, "If true, returns a detailed list of profiles.")
216232
ProfileCmd.AddCommand(profileListCmd)
217233
}

cmd/minikube/cmd/service.go

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -163,18 +163,20 @@ You may select another namespace by using 'minikube service {{.service}} -n <nam
163163
for _, svc := range noNodePortServices {
164164
noNodePortSvcNames = append(noNodePortSvcNames, fmt.Sprintf("%s/%s", svc.Namespace, svc.Name))
165165
}
166-
if len(noNodePortServices) != 0 {
166+
if len(noNodePortServices) > 0 {
167167
out.WarningT("Services {{.svc_names}} have type \"ClusterIP\" not meant to be exposed, however for local development minikube allows you to access this !", out.V{"svc_names": noNodePortSvcNames})
168168
}
169169

170-
if driver.NeedsPortForward(co.Config.Driver) && services != nil {
171-
startKicServiceTunnel(services, cname, co.Config.Driver)
170+
if driver.NeedsPortForward(co.Config.Driver) {
171+
svcs := services
172+
if len(svcs) == 0 && len(noNodePortServices) > 0 {
173+
svcs = noNodePortServices
174+
}
175+
if len(svcs) > 0 {
176+
startKicServiceTunnel(svcs, cname, co.Config.Driver)
177+
}
172178
} else if !serviceURLMode {
173179
openURLs(data)
174-
if len(noNodePortServices) != 0 {
175-
startKicServiceTunnel(noNodePortServices, cname, co.Config.Driver)
176-
}
177-
178180
}
179181
},
180182
}

cmd/minikube/cmd/ssh.go

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ import (
2929
"k8s.io/minikube/pkg/minikube/node"
3030
"k8s.io/minikube/pkg/minikube/out"
3131
"k8s.io/minikube/pkg/minikube/reason"
32+
"k8s.io/minikube/pkg/drivers/kic/oci"
33+
"k8s.io/klog/v2"
3234
)
3335

3436
var nativeSSHClient bool
@@ -56,7 +58,16 @@ var sshCmd = &cobra.Command{
5658
}
5759
}
5860

59-
err = machine.CreateSSHShell(co.API, *co.Config, *n, args, nativeSSHClient)
61+
// For remote Docker contexts, use docker exec instead of SSH
62+
klog.Warningf("SSH Command: Driver=%s, IsRemoteDockerContext=%v", co.Config.Driver, oci.IsRemoteDockerContext())
63+
if co.Config.Driver == driver.Docker && oci.IsRemoteDockerContext() {
64+
klog.Warningf("Using CreateSSHTerminal for remote Docker context")
65+
err = oci.CreateSSHTerminal(config.MachineName(*co.Config, *n), args)
66+
} else {
67+
klog.Warningf("Using standard SSH shell")
68+
err = machine.CreateSSHShell(co.API, *co.Config, *n, args, nativeSSHClient)
69+
}
70+
6071
if err != nil {
6172
// This is typically due to a non-zero exit code, so no need for flourish.
6273
out.ErrLn("ssh: %v", err)

cmd/minikube/cmd/start.go

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ import (
4141
"github.com/google/go-containerregistry/pkg/name"
4242
"github.com/google/go-containerregistry/pkg/v1/remote"
4343
"github.com/pkg/errors"
44-
"github.com/shirou/gopsutil/v3/cpu"
45-
gopshost "github.com/shirou/gopsutil/v3/host"
44+
"github.com/shirou/gopsutil/v4/cpu"
45+
gopshost "github.com/shirou/gopsutil/v4/host"
4646
"github.com/spf13/cobra"
4747
"github.com/spf13/viper"
4848
"golang.org/x/text/cases"
@@ -113,10 +113,11 @@ func init() {
113113

114114
// startCmd represents the start command
115115
var startCmd = &cobra.Command{
116-
Use: "start",
117-
Short: "Starts a local Kubernetes cluster",
118-
Long: "Starts a local Kubernetes cluster",
119-
Run: runStart,
116+
Use: "start",
117+
Aliases: []string{"create"},
118+
Short: "Starts a local Kubernetes cluster",
119+
Long: "Starts a local Kubernetes cluster",
120+
Run: runStart,
120121
}
121122

122123
// platform generates a user-readable platform message
@@ -135,7 +136,12 @@ func platform() string {
135136

136137
vsys, vrole, err := gopshost.Virtualization()
137138
if err != nil {
138-
klog.Warningf("gopshost.Virtualization returned error: %v", err)
139+
// Only log if it's a real error, not just "not implemented yet"
140+
if !strings.Contains(err.Error(), "not implemented yet") {
141+
klog.Warningf("gopshost.Virtualization returned error: %v", err)
142+
} else {
143+
klog.V(3).Infof("Virtualization detection not implemented for this platform (harmless)")
144+
}
139145
} else {
140146
klog.Infof("virtualization: %s %s", vsys, vrole)
141147
}
@@ -731,6 +737,14 @@ func selectDriver(existing *config.ClusterConfig) (registry.DriverState, []regis
731737
return ds, nil, true
732738
}
733739

740+
// Check for remote Docker context and auto-select docker driver
741+
if oci.IsRemoteDockerContext() {
742+
ds := driver.Status("docker")
743+
out.Step(style.Sparkle, `Detected a remote Docker context, using the {{.driver}} driver`, out.V{"driver": ds.String()})
744+
out.Infof("For remote Docker connections, you may need to run 'minikube tunnel-ssh' for API server access")
745+
return ds, nil, true
746+
}
747+
734748
choices := driver.Choices(viper.GetBool("vm"))
735749
pick, alts, rejects := driver.Suggest(choices)
736750
if pick.Name == "" {
@@ -1098,8 +1112,8 @@ func suggestMemoryAllocation(sysLimit, containerLimit, nodes int) int {
10981112
return mem
10991113
}
11001114

1101-
const fallback = 2200
1102-
maximum := 6000
1115+
const fallback = 3072
1116+
maximum := 6144
11031117

11041118
if sysLimit > 0 && fallback > sysLimit {
11051119
return sysLimit

cmd/minikube/cmd/start_flags.go

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424

2525
"github.com/blang/semver/v4"
2626
"github.com/pkg/errors"
27-
"github.com/shirou/gopsutil/v3/cpu"
27+
"github.com/shirou/gopsutil/v4/cpu"
2828
"github.com/spf13/cobra"
2929
"github.com/spf13/viper"
3030
"k8s.io/klog/v2"
@@ -61,8 +61,8 @@ const (
6161
hostOnlyCIDR = "host-only-cidr"
6262
containerRuntime = "container-runtime"
6363
criSocket = "cri-socket"
64-
networkPlugin = "network-plugin"
65-
enableDefaultCNI = "enable-default-cni"
64+
networkPlugin = "network-plugin" // deprecated, use --cni instead
65+
enableDefaultCNI = "enable-default-cni" // deprecated, use --cni=bridge instead
6666
cniFlag = "cni"
6767
hypervVirtualSwitch = "hyperv-virtual-switch"
6868
hypervUseExternalSwitch = "hyperv-use-external-switch"
@@ -163,7 +163,7 @@ func initMinikubeFlags() {
163163
startCmd.Flags().Bool(dryRun, false, "dry-run mode. Validates configuration, but does not mutate system state")
164164

165165
startCmd.Flags().String(cpus, "2", fmt.Sprintf("Number of CPUs allocated to Kubernetes. Use %q to use the maximum number of CPUs. Use %q to not specify a limit (Docker/Podman only)", constants.MaxResources, constants.NoLimit))
166-
startCmd.Flags().String(memory, "", fmt.Sprintf("Amount of RAM to allocate to Kubernetes (format: <number>[<unit>], where unit = b, k, m or g). Use %q to use the maximum amount of memory. Use %q to not specify a limit (Docker/Podman only)", constants.MaxResources, constants.NoLimit))
166+
startCmd.Flags().StringP(memory, "m", "", fmt.Sprintf("Amount of RAM to allocate to Kubernetes (format: <number>[<unit>], where unit = b, k, m or g). Use %q to use the maximum amount of memory. Use %q to not specify a limit (Docker/Podman only)", constants.MaxResources, constants.NoLimit))
167167
startCmd.Flags().String(humanReadableDiskSize, defaultDiskSize, "Disk size allocated to the minikube VM (format: <number>[<unit>], where unit = b, k, m or g).")
168168
startCmd.Flags().Bool(downloadOnly, false, "If true, only download and cache files for later use - don't install or start anything.")
169169
startCmd.Flags().Bool(cacheImages, true, "If true, cache docker images for the current bootstrapper and load them into the machine. Always false with --driver=none.")
@@ -182,7 +182,7 @@ func initMinikubeFlags() {
182182
startCmd.Flags().Uint16(mountPortFlag, defaultMountPort, mountPortDescription)
183183
startCmd.Flags().String(mountTypeFlag, defaultMountType, mountTypeDescription)
184184
startCmd.Flags().String(mountUID, defaultMountUID, mountUIDDescription)
185-
startCmd.Flags().StringSlice(config.AddonListFlag, nil, "Enable addons. see `minikube addons list` for a list of valid addon names.")
185+
startCmd.Flags().StringSlice(config.AddonListFlag, nil, "Enable one or more addons, in a comma-separated format. See `minikube addons list` for a list of valid addon names.")
186186
startCmd.Flags().String(criSocket, "", "The cri socket path to be used.")
187187
startCmd.Flags().String(networkPlugin, "", "DEPRECATED: Replaced by --cni")
188188
startCmd.Flags().Bool(enableDefaultCNI, false, "DEPRECATED: Replaced by --cni=bridge")
@@ -232,6 +232,20 @@ func initKubernetesFlags() {
232232
func initDriverFlags() {
233233
startCmd.Flags().StringP("driver", "d", "", fmt.Sprintf("Driver is one of: %v (defaults to auto-detect)", driver.DisplaySupportedDrivers()))
234234
startCmd.Flags().String("vm-driver", "", "DEPRECATED, use `driver` instead.")
235+
// Hide the deprecated vm-driver flag from help text
236+
if err := startCmd.Flags().MarkHidden("vm-driver"); err != nil {
237+
klog.Warningf("Failed to hide vm-driver flag: %v\n", err)
238+
}
239+
// Hide the deprecated flag from help text so new users dont use it (still will be processed)
240+
if err := startCmd.Flags().MarkHidden(enableDefaultCNI); err != nil {
241+
klog.Warningf("Failed to hide %s flag: %v\n", enableDefaultCNI, err)
242+
}
243+
244+
// Hide the deprecated flag from help text so new users dont use it (still will be processed)
245+
if err := startCmd.Flags().MarkHidden(networkPlugin); err != nil {
246+
klog.Warningf("Failed to hide %s flag: %v\n", networkPlugin, err)
247+
}
248+
235249
startCmd.Flags().Bool(disableDriverMounts, false, "Disables the filesystem mounts provided by the hypervisors")
236250
startCmd.Flags().Bool("vm", false, "Filter to use only VM Drivers")
237251

cmd/minikube/cmd/start_test.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -277,26 +277,26 @@ func TestSuggestMemoryAllocation(t *testing.T) {
277277
nodes int
278278
want int
279279
}{
280-
{"128GB sys", 128000, 0, 1, 6000},
281-
{"64GB sys", 64000, 0, 1, 6000},
282-
{"32GB sys", 32768, 0, 1, 6000},
280+
{"128GB sys", 128000, 0, 1, 6144},
281+
{"64GB sys", 64000, 0, 1, 6144},
282+
{"32GB sys", 32768, 0, 1, 6144},
283283
{"16GB sys", 16384, 0, 1, 4000},
284284
{"odd sys", 14567, 0, 1, 3600},
285-
{"4GB sys", 4096, 0, 1, 2200},
285+
{"4GB sys", 4096, 0, 1, 3072},
286286
{"2GB sys", 2048, 0, 1, 2048},
287-
{"Unable to poll sys", 0, 0, 1, 2200},
287+
{"Unable to poll sys", 0, 0, 1, 3072},
288288
{"128GB sys, 16GB container", 128000, 16384, 1, 16336},
289289
{"64GB sys, 16GB container", 64000, 16384, 1, 16000},
290290
{"16GB sys, 4GB container", 16384, 4096, 1, 4000},
291291
{"4GB sys, 3.5GB container", 16384, 3500, 1, 3452},
292292
{"16GB sys, 2GB container", 16384, 2048, 1, 2048},
293293
{"16GB sys, unable to poll container", 16384, 0, 1, 4000},
294-
{"128GB sys 2 nodes", 128000, 0, 2, 6000},
295-
{"8GB sys 3 nodes", 8192, 0, 3, 2200},
296-
{"16GB sys 2 nodes", 16384, 0, 2, 2200},
294+
{"128GB sys 2 nodes", 128000, 0, 2, 6144},
295+
{"8GB sys 3 nodes", 8192, 0, 3, 3072},
296+
{"16GB sys 2 nodes", 16384, 0, 2, 3072},
297297
{"32GB sys 2 nodes", 32768, 0, 2, 4050},
298-
{"odd sys 2 nodes", 14567, 0, 2, 2200},
299-
{"4GB sys 2 nodes", 4096, 0, 2, 2200},
298+
{"odd sys 2 nodes", 14567, 0, 2, 3072},
299+
{"4GB sys 2 nodes", 4096, 0, 2, 3072},
300300
{"2GB sys 3 nodes", 2048, 0, 3, 2048},
301301
}
302302
for _, test := range tests {

0 commit comments

Comments
 (0)