diff --git a/internal/runner/log_buffer.go b/internal/runner/log_buffer.go index a3d571299..50d0cb0d6 100644 --- a/internal/runner/log_buffer.go +++ b/internal/runner/log_buffer.go @@ -37,7 +37,7 @@ func NewDebugLog(log logr.Logger) *DebugLog { } func (l *DebugLog) Log(format string, v ...interface{}) { - l.log.V(1).Info(fmt.Sprintf(format, v...)) + l.log.Info(fmt.Sprintf(format, v...)) } type LogBuffer struct { diff --git a/internal/runner/runner.go b/internal/runner/runner.go index 8f9d4057c..d8d12c78f 100644 --- a/internal/runner/runner.go +++ b/internal/runner/runner.go @@ -42,6 +42,8 @@ import ( "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" + runtimelogger "github.com/fluxcd/pkg/runtime/logger" + v2 "github.com/fluxcd/helm-controller/api/v2beta1" "github.com/fluxcd/helm-controller/internal/features" ) @@ -74,12 +76,15 @@ type Runner struct { // namespace configured to the provided values. func NewRunner(getter genericclioptions.RESTClientGetter, storageNamespace string, logger logr.Logger) (*Runner, error) { runner := &Runner{ - logBuffer: NewLogBuffer(NewDebugLog(logger).Log, defaultBufferSize), + logBuffer: NewLogBuffer(NewDebugLog(logger.V(runtimelogger.DebugLevel)).Log, defaultBufferSize), } - runner.config = new(action.Configuration) - if err := runner.config.Init(getter, storageNamespace, "secret", runner.logBuffer.Log); err != nil { + cfg := new(action.Configuration) + if err := cfg.Init(getter, storageNamespace, "secret", NewDebugLog(logger.V(runtimelogger.TraceLevel)).Log); err != nil { return nil, err } + // Override the logger used by the Helm actions with the log buffer. + cfg.Log = runner.logBuffer.Log + runner.config = cfg return runner, nil }