Merge pull request #13135 from spowelljr/stopDockerWarningJSON

Don't output Docker performance issues when user wants JSON
pull/13143/head
Medya Ghazizadeh 2021-12-10 12:51:19 -08:00 committed by GitHub
commit 6b48163b90
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 1 deletions

View File

@ -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()]

View File

@ -1,3 +1,4 @@
//go:build !windows
// +build !windows
/*

View File

@ -1,3 +1,4 @@
//go:build windows
// +build windows
/*