Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
antongulenko opened this issue Oct 5, 2021 · 3 comments · Fixed by #5307
Closed

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

antongulenko opened this issue Oct 5, 2021 · 3 comments · Fixed by #5307
Assignees
Labels
language/helm Issue is related to a Helm operator project

Comments

@antongulenko
Copy link

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.

@openshift-ci openshift-ci bot added the language/helm Issue is related to a Helm operator project label Oct 5, 2021
@VenkatRamaraju
Copy link
Contributor

/assign

VenkatRamaraju added a commit to VenkatRamaraju/operator-sdk that referenced this issue Oct 12, 2021
@antongulenko
Copy link
Author

Thanks for the quick reaction!

@VenkatRamaraju
Copy link
Contributor

VenkatRamaraju commented Oct 14, 2021

Hi @antongulenko,

We have just merged #5307 on master now. It will be included in the 1.14 release, but can also be used currently with the helm-operator binary built from the master.

When running the Helm operator with the info zap log level, the Helm diffs will no longer be displayed. Feel free to reopen the issue if you have any concerns. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
language/helm Issue is related to a Helm operator project
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants