Repository: kubernetes/minikube
Pull request #12066 (2021-07-27 22:02:36)

Make download.download not use progress bar if not in tty.
Downloading currently downloads with a progress bar regardless of whether in a tty. This can cause issues since updating a progressbar constantly prints to the output. This PR performs a check to disable the progressbar if in a TTY.


Patch:
diff --git a/hack/update/kubernetes_version/templates/v1beta2/containerd-api-port.yaml b/hack/update/kubernetes_version/templates/v1beta2/containerd-api-port.yaml
index 9037f6324..a83fe5fa2 100644
--- a/hack/update/kubernetes_version/templates/v1beta2/containerd-api-port.yaml
+++ b/hack/update/kubernetes_version/templates/v1beta2/containerd-api-port.yaml
@@ -68,7 +68,3 @@ clusterCIDR: "10.244.0.0/16"
 metricsBindAddress: 0.0.0.0:10249
 conntrack:
   maxPerCore: 0
-# Skip setting "net.netfilter.nf_conntrack_tcp_timeout_established"
-  tcpEstablishedTimeout: 0s
-# Skip setting "net.netfilter.nf_conntrack_tcp_timeout_close"
-  tcpCloseWaitTimeout: 0s
\ No newline at end of file
diff --git a/hack/update/kubernetes_version/templates/v1beta2/containerd-pod-network-cidr.yaml b/hack/update/kubernetes_version/templates/v1beta2/containerd-pod-network-cidr.yaml
index 1d4c47557..b81c883b4 100644
--- a/hack/update/kubernetes_version/templates/v1beta2/containerd-pod-network-cidr.yaml
+++ b/hack/update/kubernetes_version/templates/v1beta2/containerd-pod-network-cidr.yaml
@@ -68,7 +68,3 @@ clusterCIDR: "192.168.32.0/20"
 metricsBindAddress: 0.0.0.0:10249
 conntrack:
   maxPerCore: 0
-# Skip setting "net.netfilter.nf_conntrack_tcp_timeout_established"
-  tcpEstablishedTimeout: 0s
-# Skip setting "net.netfilter.nf_conntrack_tcp_timeout_close"
-  tcpCloseWaitTimeout: 0s
\ No newline at end of file
diff --git a/hack/update/kubernetes_version/templates/v1beta2/containerd.yaml b/hack/update/kubernetes_version/templates/v1beta2/containerd.yaml
index 371a01462..cfc59873c 100644
--- a/hack/update/kubernetes_version/templates/v1beta2/containerd.yaml
+++ b/hack/update/kubernetes_version/templates/v1beta2/containerd.yaml
@@ -68,7 +68,3 @@ clusterCIDR: "10.244.0.0/16"
 metricsBindAddress: 0.0.0.0:10249
 conntrack:
   maxPerCore: 0
-# Skip setting "net.netfilter.nf_conntrack_tcp_timeout_established"
-  tcpEstablishedTimeout: 0s
-# Skip setting "net.netfilter.nf_conntrack_tcp_timeout_close"
-  tcpCloseWaitTimeout: 0s
\ No newline at end of file
diff --git a/hack/update/kubernetes_version/templates/v1beta2/crio-options-gates.yaml b/hack/update/kubernetes_version/templates/v1beta2/crio-options-gates.yaml
index 366300727..81ee5d74c 100644
--- a/hack/update/kubernetes_version/templates/v1beta2/crio-options-gates.yaml
+++ b/hack/update/kubernetes_version/templates/v1beta2/crio-options-gates.yaml
@@ -74,8 +74,4 @@ clusterCIDR: "10.244.0.0/16"
 metricsBindAddress: 0.0.0.0:10249
 conntrack:
   maxPerCore: 0
-# Skip setting "net.netfilter.nf_conntrack_tcp_timeout_established"
-  tcpEstablishedTimeout: 0s
-# Skip setting "net.netfilter.nf_conntrack_tcp_timeout_close"
-  tcpCloseWaitTimeout: 0s
 mode: "iptables"
diff --git a/hack/update/kubernetes_version/templates/v1beta2/crio.yaml b/hack/update/kubernetes_version/templates/v1beta2/crio.yaml
index 1a28f99a7..ce8e5aefd 100644
--- a/hack/update/kubernetes_version/templates/v1beta2/crio.yaml
+++ b/hack/update/kubernetes_version/templates/v1beta2/crio.yaml
@@ -68,7 +68,3 @@ clusterCIDR: "10.244.0.0/16"
 metricsBindAddress: 0.0.0.0:10249
 conntrack:
   maxPerCore: 0
-# Skip setting "net.netfilter.nf_conntrack_tcp_timeout_established"
-  tcpEstablishedTimeout: 0s
-# Skip setting "net.netfilter.nf_conntrack_tcp_timeout_close"
-  tcpCloseWaitTimeout: 0s
\ No newline at end of file
diff --git a/hack/update/kubernetes_version/templates/v1beta2/default.yaml b/hack/update/kubernetes_version/templates/v1beta2/default.yaml
index 6fd15b0bf..358be5b13 100644
--- a/hack/update/kubernetes_version/templates/v1beta2/default.yaml
+++ b/hack/update/kubernetes_version/templates/v1beta2/default.yaml
@@ -68,7 +68,3 @@ clusterCIDR: "10.244.0.0/16"
 metricsBindAddress: 0.0.0.0:10249
 conntrack:
   maxPerCore: 0
-# Skip setting "net.netfilter.nf_conntrack_tcp_timeout_established"
-  tcpEstablishedTimeout: 0s
-# Skip setting "net.netfilter.nf_conntrack_tcp_timeout_close"
-  tcpCloseWaitTimeout: 0s
\ No newline at end of file
diff --git a/hack/update/kubernetes_version/templates/v1beta2/dns.yaml b/hack/update/kubernetes_version/templates/v1beta2/dns.yaml
index f8536ad49..689672217 100644
--- a/hack/update/kubernetes_version/templates/v1beta2/dns.yaml
+++ b/hack/update/kubernetes_version/templates/v1beta2/dns.yaml
@@ -68,7 +68,3 @@ clusterCIDR: "10.244.0.0/16"
 metricsBindAddress: 0.0.0.0:10249
 conntrack:
   maxPerCore: 0
-# Skip setting "net.netfilter.nf_conntrack_tcp_timeout_established"
-  tcpEstablishedTimeout: 0s
-# Skip setting "net.netfilter.nf_conntrack_tcp_timeout_close"
-  tcpCloseWaitTimeout: 0s
\ No newline at end of file
diff --git a/hack/update/kubernetes_version/templates/v1beta2/image-repository.yaml b/hack/update/kubernetes_version/templates/v1beta2/image-repository.yaml
index f9114b72e..c1b25120c 100644
--- a/hack/update/kubernetes_version/templates/v1beta2/image-repository.yaml
+++ b/hack/update/kubernetes_version/templates/v1beta2/image-repository.yaml
@@ -69,7 +69,3 @@ clusterCIDR: "10.244.0.0/16"
 metricsBindAddress: 0.0.0.0:10249
 conntrack:
   maxPerCore: 0
-# Skip setting "net.netfilter.nf_conntrack_tcp_timeout_established"
-  tcpEstablishedTimeout: 0s
-# Skip setting "net.netfilter.nf_conntrack_tcp_timeout_close"
-  tcpCloseWaitTimeout: 0s
\ No newline at end of file
diff --git a/hack/update/kubernetes_version/templates/v1beta2/options.yaml b/hack/update/kubernetes_version/templates/v1beta2/options.yaml
index be5e8249e..c0f1bdce0 100644
--- a/hack/update/kubernetes_version/templates/v1beta2/options.yaml
+++ b/hack/update/kubernetes_version/templates/v1beta2/options.yaml
@@ -71,8 +71,4 @@ clusterCIDR: "10.244.0.0/16"
 metricsBindAddress: 0.0.0.0:10249
 conntrack:
   maxPerCore: 0
-# Skip setting "net.netfilter.nf_conntrack_tcp_timeout_established"
-  tcpEstablishedTimeout: 0s
-# Skip setting "net.netfilter.nf_conntrack_tcp_timeout_close"
-  tcpCloseWaitTimeout: 0s
 mode: "iptables"
diff --git a/pkg/minikube/constants/constants.go b/pkg/minikube/constants/constants.go
index b0d425d95..7b496c862 100644
--- a/pkg/minikube/constants/constants.go
+++ b/pkg/minikube/constants/constants.go
@@ -37,7 +37,7 @@ const (
 	DefaultKubernetesVersion = "v1.21.3"
 	// NewestKubernetesVersion is the newest Kubernetes version to test against
 	// NOTE: You may need to update coreDNS & etcd versions in pkg/minikube/bootstrapper/images/images.go
-	NewestKubernetesVersion = "v1.22.0-rc.0"
+	NewestKubernetesVersion = "v1.22.0-beta.2"
 	// OldestKubernetesVersion is the oldest Kubernetes version to test against
 	OldestKubernetesVersion = "v1.14.0"
 	// DefaultClusterName is the default nane for the k8s cluster
diff --git a/pkg/minikube/download/download.go b/pkg/minikube/download/download.go
index e99aef592..d65590775 100644
--- a/pkg/minikube/download/download.go
+++ b/pkg/minikube/download/download.go
@@ -51,9 +51,15 @@ func CreateDstDownloadMock(src, dst string) error {
 
 // download is a well-configured atomic download function
 func download(src string, dst string) error {
-	progress := getter.WithProgress(DefaultProgressBar)
-	if out.JSON {
-		progress = getter.WithProgress(DefaultJSONOutput)
+	var clientOptions []getter.ClientOption
+	if out.IsTerminal(os.Stdout) {
+		progress := getter.WithProgress(DefaultProgressBar)
+		if out.JSON {
+			progress = getter.WithProgress(DefaultJSONOutput)
+		}
+		clientOptions = []getter.ClientOption{progress}
+	} else {
+		clientOptions = []getter.ClientOption{}
 	}
 	tmpDst := dst + ".download"
 	client := &getter.Client{
@@ -61,7 +67,7 @@ func download(src string, dst string) error {
 		Dst:     tmpDst,
 		Dir:     false,
 		Mode:    getter.ClientModeFile,
-		Options: []getter.ClientOption{progress},
+		Options: clientOptions,
 		Getters: map[string]getter.Getter{
 			"file":  &getter.FileGetter{Copy: false},
 			"http":  &getter.HttpGetter{Netrc: false},
diff --git a/site/content/en/docs/commands/start.md b/site/content/en/docs/commands/start.md
index db342ac67..18f1dc24d 100644
--- a/site/content/en/docs/commands/start.md
+++ b/site/content/en/docs/commands/start.md
@@ -66,7 +66,7 @@ minikube start [flags]
       --interactive                       Allow user prompts for more information (default true)
       --iso-url strings                   Locations to fetch the minikube ISO from. (default [https://storage.googleapis.com/minikube/iso/minikube-v1.22.0.iso,https://github.com/kubernetes/minikube/releases/download/v1.22.0/minikube-v1.22.0.iso,https://kubernetes.oss-cn-hangzhou.aliyuncs.com/minikube/iso/minikube-v1.22.0.iso])
       --keep-context                      This will keep the existing kubectl context and will create a minikube context.
-      --kubernetes-version string         The Kubernetes version that the minikube VM will use (ex: v1.2.3, 'stable' for v1.21.3, 'latest' for v1.22.0-rc.0). Defaults to 'stable'.
+      --kubernetes-version string         The Kubernetes version that the minikube VM will use (ex: v1.2.3, 'stable' for v1.21.3, 'latest' for v1.22.0-beta.2). Defaults to 'stable'.
       --kvm-gpu                           Enable experimental NVIDIA GPU support in minikube
       --kvm-hidden                        Hide the hypervisor signature from the guest in minikube (kvm2 driver only)
       --kvm-network string                The KVM default network name. (kvm2 driver only) (default "default")


Test patch:
diff --git a/hack/jenkins/test-flake-chart/report_flakes.sh b/hack/jenkins/test-flake-chart/report_flakes.sh
index 98e10099e..d18e19ed8 100755
--- a/hack/jenkins/test-flake-chart/report_flakes.sh
+++ b/hack/jenkins/test-flake-chart/report_flakes.sh
@@ -46,7 +46,7 @@ TMP_DATA=$(mktemp)
   | (xargs gsutil ls || true) \
   | xargs gsutil cat \
   | "$DIR/process_data.sh" \
-  | sed -n -r -e "s|[0-9a-f]*,[0-9-]*,([a-zA-Z/_0-9-]*),([a-zA-Z/_0-9-]*),Failed,[.0-9]*,[a-zA-Z/_0-9-]*,[0-9]*,[.0-9]*|\1:\2|p" \
+  | sed -n -r -e "s|[0-9a-f]*,[0-9-]*,([a-zA-Z/_0-9-]*),([a-zA-Z/_0-9-]*),Failed,[.0-9]*|\1:\2|p" \
   | sort \
   > "$TMP_DATA"
 
diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.22/containerd-api-port.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.22/containerd-api-port.yaml
index 9df5003de..09f51c6cd 100644
--- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.22/containerd-api-port.yaml
+++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.22/containerd-api-port.yaml
@@ -40,7 +40,7 @@ etcd:
     dataDir: /var/lib/minikube/etcd
     extraArgs:
       proxy-refresh-interval: "70000"
-kubernetesVersion: v1.22.0-rc.0
+kubernetesVersion: v1.22.0-beta.2
 networking:
   dnsDomain: cluster.local
   podSubnet: "10.244.0.0/16"
diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.22/containerd-pod-network-cidr.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.22/containerd-pod-network-cidr.yaml
index dbb3848b7..f4209344b 100644
--- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.22/containerd-pod-network-cidr.yaml
+++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.22/containerd-pod-network-cidr.yaml
@@ -40,7 +40,7 @@ etcd:
     dataDir: /var/lib/minikube/etcd
     extraArgs:
       proxy-refresh-interval: "70000"
-kubernetesVersion: v1.22.0-rc.0
+kubernetesVersion: v1.22.0-beta.2
 networking:
   dnsDomain: cluster.local
   podSubnet: "192.168.32.0/20"
diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.22/containerd.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.22/containerd.yaml
index 0b4338aa9..bc02c8647 100644
--- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.22/containerd.yaml
+++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.22/containerd.yaml
@@ -40,7 +40,7 @@ etcd:
     dataDir: /var/lib/minikube/etcd
     extraArgs:
       proxy-refresh-interval: "70000"
-kubernetesVersion: v1.22.0-rc.0
+kubernetesVersion: v1.22.0-beta.2
 networking:
   dnsDomain: cluster.local
   podSubnet: "10.244.0.0/16"
diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.22/crio-options-gates.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.22/crio-options-gates.yaml
index 7146db8f6..f1a98d57c 100644
--- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.22/crio-options-gates.yaml
+++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.22/crio-options-gates.yaml
@@ -46,7 +46,7 @@ etcd:
     dataDir: /var/lib/minikube/etcd
     extraArgs:
       proxy-refresh-interval: "70000"
-kubernetesVersion: v1.22.0-rc.0
+kubernetesVersion: v1.22.0-beta.2
 networking:
   dnsDomain: cluster.local
   podSubnet: "10.244.0.0/16"
diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.22/crio.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.22/crio.yaml
index 0f98e0487..d102d9879 100644
--- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.22/crio.yaml
+++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.22/crio.yaml
@@ -40,7 +40,7 @@ etcd:
     dataDir: /var/lib/minikube/etcd
     extraArgs:
       proxy-refresh-interval: "70000"
-kubernetesVersion: v1.22.0-rc.0
+kubernetesVersion: v1.22.0-beta.2
 networking:
   dnsDomain: cluster.local
   podSubnet: "10.244.0.0/16"
diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.22/default.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.22/default.yaml
index 6a04619bf..c6ab23519 100644
--- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.22/default.yaml
+++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.22/default.yaml
@@ -40,7 +40,7 @@ etcd:
     dataDir: /var/lib/minikube/etcd
     extraArgs:
       proxy-refresh-interval: "70000"
-kubernetesVersion: v1.22.0-rc.0
+kubernetesVersion: v1.22.0-beta.2
 networking:
   dnsDomain: cluster.local
   podSubnet: "10.244.0.0/16"
diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.22/dns.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.22/dns.yaml
index 9bbacc2ff..d1102f1c0 100644
--- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.22/dns.yaml
+++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.22/dns.yaml
@@ -40,7 +40,7 @@ etcd:
     dataDir: /var/lib/minikube/etcd
     extraArgs:
       proxy-refresh-interval: "70000"
-kubernetesVersion: v1.22.0-rc.0
+kubernetesVersion: v1.22.0-beta.2
 networking:
   dnsDomain: minikube.local
   podSubnet: "10.244.0.0/16"
diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.22/image-repository.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.22/image-repository.yaml
index 169d8d472..222f4214f 100644
--- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.22/image-repository.yaml
+++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.22/image-repository.yaml
@@ -41,7 +41,7 @@ etcd:
     dataDir: /var/lib/minikube/etcd
     extraArgs:
       proxy-refresh-interval: "70000"
-kubernetesVersion: v1.22.0-rc.0
+kubernetesVersion: v1.22.0-beta.2
 networking:
   dnsDomain: cluster.local
   podSubnet: "10.244.0.0/16"
diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.22/options.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.22/options.yaml
index e663396bb..527ac8c7b 100644
--- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.22/options.yaml
+++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.22/options.yaml
@@ -43,7 +43,7 @@ etcd:
     dataDir: /var/lib/minikube/etcd
     extraArgs:
       proxy-refresh-interval: "70000"
-kubernetesVersion: v1.22.0-rc.0
+kubernetesVersion: v1.22.0-beta.2
 networking:
   dnsDomain: cluster.local
   podSubnet: "10.244.0.0/16"
diff --git a/test/integration/functional_test.go b/test/integration/functional_test.go
index 5ccae3ca6..793345a2b 100644
--- a/test/integration/functional_test.go
+++ b/test/integration/functional_test.go
@@ -976,22 +976,10 @@ func validateCacheCmd(ctx context.Context, t *testing.T, profile string) {
 				t.Skipf("failed to build docker image, skipping local test: %v", err)
 			}
 
-			defer func() {
-				_, err := Run(t, exec.CommandContext(ctx, "docker", "rmi", img))
-				if err != nil {
-					t.Errorf("failed to delete local image %q, err %v", img, err)
-				}
-			}()
-
 			rr, err := Run(t, exec.CommandContext(ctx, Target(), "-p", profile, "cache", "add", img))
 			if err != nil {
 				t.Errorf("failed to 'cache add' local image %q. args %q err %v", img, rr.Command(), err)
 			}
-
-			rr, err = Run(t, exec.CommandContext(ctx, Target(), "-p", profile, "cache", "delete", img))
-			if err != nil {
-				t.Errorf("failed to 'cache delete' local image %q. args %q err %v", img, rr.Command(), err)
-			}
 		})
 
 		t.Run("delete_k8s.gcr.io/pause:3.3", func(t *testing.T) {