diff --git a/hack/jenkins/common.ps1 b/hack/jenkins/common.ps1 index cdb06a80e4e5..e54e6b3dc9b8 100644 --- a/hack/jenkins/common.ps1 +++ b/hack/jenkins/common.ps1 @@ -29,6 +29,7 @@ function Write-GithubStatus { $env:SHORT_COMMIT=$env:COMMIT.substring(0, 7) $gcs_bucket="minikube-builds/logs/$env:MINIKUBE_LOCATION/$env:ROOT_JOB_ID" +$env:MINIKUBE_SUPPRESS_DOCKER_PERFORMANCE=true # Docker's kubectl breaks things, and comes earlier in the path than the regular kubectl. So download the expected kubectl and replace Docker's version. (New-Object Net.WebClient).DownloadFile("https://dl.k8s.io/release/v1.20.0/bin/windows/amd64/kubectl.exe", "C:\Program Files\Docker\Docker\resources\bin\kubectl.exe") diff --git a/hack/jenkins/common.sh b/hack/jenkins/common.sh index a616c707bfb9..6a0f7c6b87bc 100755 --- a/hack/jenkins/common.sh +++ b/hack/jenkins/common.sh @@ -33,6 +33,7 @@ readonly TEST_HOME="${TEST_ROOT}/${OS_ARCH}-${DRIVER}-${CONTAINER_RUNTIME}-${MIN export GOPATH="$HOME/go" export KUBECONFIG="${TEST_HOME}/kubeconfig" export PATH=$PATH:"/usr/local/bin/:/usr/local/go/bin/:$GOPATH/bin" +export MINIKUBE_SUPPRESS_DOCKER_PERFORMANCE=true readonly TIMEOUT=${1:-120m} diff --git a/pkg/drivers/kic/oci/cli_runner.go b/pkg/drivers/kic/oci/cli_runner.go index 3212c322cc40..cebf4f6afcbb 100644 --- a/pkg/drivers/kic/oci/cli_runner.go +++ b/pkg/drivers/kic/oci/cli_runner.go @@ -21,8 +21,10 @@ import ( "context" "fmt" "io" + "os" "os/exec" "runtime" + "strconv" "strings" "sync" "time" @@ -84,6 +86,19 @@ func PrefixCmd(cmd *exec.Cmd) *exec.Cmd { return cmd } +func suppressDockerMessage() bool { + envKey := "MINIKUBE_SUPPRESS_DOCKER_PERFORMANCE" + env := os.Getenv(envKey) + suppress, err := strconv.ParseBool(env) + if err != nil { + msg := fmt.Sprintf("failed to parse bool from the %s env, defaulting to 'false'; received: %s: %v", envKey, env, err) + klog.Warning(msg) + out.Styled(style.Warning, msg) + return false + } + return suppress +} + // runCmd runs a command exec.Command against docker daemon or podman func runCmd(cmd *exec.Cmd, warnSlow ...bool) (*RunResult, error) { cmd = PrefixCmd(cmd) @@ -135,7 +150,7 @@ func runCmd(cmd *exec.Cmd, warnSlow ...bool) (*RunResult, error) { start := time.Now() err := cmd.Run() elapsed := time.Since(start) - if warn && !out.JSON { + if warn && !out.JSON && !suppressDockerMessage() { if elapsed > warnTime { warnLock.Lock() _, ok := alreadyWarnedCmds[rr.Command()] diff --git a/site/content/en/docs/handbook/config.md b/site/content/en/docs/handbook/config.md index 5d6e10e73753..b10533cc213a 100644 --- a/site/content/en/docs/handbook/config.md +++ b/site/content/en/docs/handbook/config.md @@ -114,14 +114,12 @@ Some features can only be accessed by minikube specific environment variables, h * **MINIKUBE_IN_STYLE** - (bool) manually sets whether or not emoji and colors should appear in minikube. Set to false or 0 to disable this feature, true or 1 to force it to be turned on. -* **MINIKUBE_WANTUPDATENOTIFICATION** - (bool) sets whether the user wants an update notification for new minikube versions - -* **MINIKUBE_REMINDERWAITPERIODINHOURS** - (int) sets the number of hours to check for an update notification - * **CHANGE_MINIKUBE_NONE_USER** - (bool) automatically change ownership of ~/.minikube to the value of $SUDO_USER * **MINIKUBE_ENABLE_PROFILING** - (int, `1` enables it) enables trace profiling to be generated for minikube +* **MINIKUBE_SUPPRESS_DOCKER_PERFORMANCE** - (bool) suppresses Docker performance warnings when Docker is slow + ### Example: Disabling emoji {{% tabs %}} diff --git a/site/content/en/docs/tutorials/continuous_integration.md b/site/content/en/docs/tutorials/continuous_integration.md index 16f97819c926..6abe339aecf4 100644 --- a/site/content/en/docs/tutorials/continuous_integration.md +++ b/site/content/en/docs/tutorials/continuous_integration.md @@ -46,6 +46,6 @@ curl -LO \ https://storage.googleapis.com/kubernetes-release/release/$kv/bin/linux/amd64/kubectl \ && install kubectl /tmp/ -export MINIKUBE_WANTUPDATENOTIFICATION=false +/tmp/minikube-linux-amd64 config set WantUpdateNotification false /tmp/minikube-linux-amd64 start --driver=docker ```