Skip to content

Helm Operator: Cannot disable verbose logging of reconciled Helm releases #5278

@antongulenko

Description

@antongulenko

Bug Report

What did you do?

I am using the helm-operator with one Helm chart and one entry in the watches.yaml, along with the --zap-log-level=info command line flag.

What did you expect to see?

I expected the logging output of the operator to be more or less concise, as one would typically expect from an info log level.

What did you see instead? Under which circumstances?

The operator logs a colored diff for every update in any deployed Helm chart release. In my case, the operator manages around 60 releases. These have to be updated from time to time, resulting in a stream of Helm release diffs, making the actual log output unreadable.

Environment

Operator type:

/language helm

Kubernetes cluster type:

Vanilla Kubernetes

$ operator-sdk version

operator-sdk version: "v1.8.0-ocp", commit: "777254bdcc3114e6e2e34ee900a9aec1bcf94739", kubernetes version: "v1.20.2", go version: "go1.16.4", GOOS: "linux", GOARCH: "amd64"

$ kubectl version

Client Version: version.Info{Major:"1", Minor:"21", GitVersion:"v1.21.4", GitCommit:"3cce4a82b44f032d0cd1a1790e6d2f5a55d20aae", GitTreeState:"clean", BuildDate:"2021-08-11T18:16:05Z", GoVersion:"go1.16.7", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"21+", GitVersion:"v1.21.3-dhc", GitCommit:"ca643a4d1f7bfe34773c74f79527be4afd95bf39", GitTreeState:"dirty", BuildDate:"2021-08-02T05:45:22Z", GoVersion:"go1.16.6", Compiler:"gc", Platform:"linux/amd64"}

Possible Solution

The verbose diff is printed in the HelmOperatorReconciler.Reconcile to standard out, when log.V(0).Enabled(), which seems to be true regardless of what parameter is given to --zap-log-level. My guess is the Enabled() check should be done for a higher (i.e., more verbose) log level.

Additional context

I also tried to pass --zap-log-level=0, --zap-log-level=1, and --zap-log-level=warning to the operator, with the same result.

Metadata

Metadata

Labels

language/helmIssue is related to a Helm operator project

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions