diff --git a/pkg/skaffold/build/cluster/logs.go b/pkg/skaffold/build/cluster/logs.go index b87cab7a87d..acec4c4367e 100644 --- a/pkg/skaffold/build/cluster/logs.go +++ b/pkg/skaffold/build/cluster/logs.go @@ -28,12 +28,15 @@ import ( corev1 "k8s.io/client-go/kubernetes/typed/core/v1" ) -// logLevel makes sure kaniko logs at least at Info level. +// logLevel makes sure kaniko logs at least at Info level and at most Debug level (trace doesn't work with Kaniko) func logLevel() logrus.Level { level := logrus.GetLevel() if level < logrus.InfoLevel { return logrus.InfoLevel } + if level > logrus.DebugLevel { + return logrus.DebugLevel + } return level } diff --git a/pkg/skaffold/build/cluster/logs_test.go b/pkg/skaffold/build/cluster/logs_test.go index 2d0a8f6f9ae..435bd1ab80f 100644 --- a/pkg/skaffold/build/cluster/logs_test.go +++ b/pkg/skaffold/build/cluster/logs_test.go @@ -28,6 +28,7 @@ func TestLogLevel(t *testing.T) { logrusLevel logrus.Level expected logrus.Level }{ + {logrusLevel: logrus.TraceLevel, expected: logrus.DebugLevel}, {logrusLevel: logrus.DebugLevel, expected: logrus.DebugLevel}, {logrusLevel: logrus.InfoLevel, expected: logrus.InfoLevel}, {logrusLevel: logrus.WarnLevel, expected: logrus.InfoLevel},