From 8d7a636bfe2428f3ba36decedf81218ed1b39722 Mon Sep 17 00:00:00 2001 From: Steven Powell Date: Thu, 9 Dec 2021 14:38:18 -0800 Subject: [PATCH] don't output Docker performance issues when user wants JSON --- pkg/drivers/kic/oci/cli_runner.go | 2 +- third_party/kubeadm/app/constants/constants_unix.go | 1 + third_party/kubeadm/app/constants/constants_windows.go | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/drivers/kic/oci/cli_runner.go b/pkg/drivers/kic/oci/cli_runner.go index 27857d51a4..3212c322cc 100644 --- a/pkg/drivers/kic/oci/cli_runner.go +++ b/pkg/drivers/kic/oci/cli_runner.go @@ -135,7 +135,7 @@ func runCmd(cmd *exec.Cmd, warnSlow ...bool) (*RunResult, error) { start := time.Now() err := cmd.Run() elapsed := time.Since(start) - if warn { + if warn && !out.JSON { if elapsed > warnTime { warnLock.Lock() _, ok := alreadyWarnedCmds[rr.Command()] diff --git a/third_party/kubeadm/app/constants/constants_unix.go b/third_party/kubeadm/app/constants/constants_unix.go index 16ff72d555..812faf064b 100644 --- a/third_party/kubeadm/app/constants/constants_unix.go +++ b/third_party/kubeadm/app/constants/constants_unix.go @@ -1,3 +1,4 @@ +//go:build !windows // +build !windows /* diff --git a/third_party/kubeadm/app/constants/constants_windows.go b/third_party/kubeadm/app/constants/constants_windows.go index 6daae0a1ff..1a44a82723 100644 --- a/third_party/kubeadm/app/constants/constants_windows.go +++ b/third_party/kubeadm/app/constants/constants_windows.go @@ -1,3 +1,4 @@ +//go:build windows // +build windows /*