bitnami/sealed-secrets

[controller] Reduce log level for no-op branch of `UpdateFunc`

開放

#1,661 建立於 2024年12月16日

 (1 則留言) (1 個反應) (1 位負責人)Go (771 個分叉)auto 404
backloghelp wanted

倉庫指標

星標
 (9,222 顆星)
PR 合併指標
 (平均合併 6天 9小時) (30 天內合併 20 個 PR)

描述

Which component: controller version 2.17.0

Is your feature request related to a problem? Please describe. Whenever the spec of a sealed secret is updated, the informer will trigger the UpdateFunc twice: Once for the actual change of the spec and a second time due to the change of the the status sub resource that is updated by the controller. This leads to confusing log output like this:

time=2024-12-15T02:47:42.194Z level=INFO msg=Updating key=foo/bar
time=2024-12-15T02:47:42.316Z level=INFO msg="Event(v1.ObjectReference{Kind:\"SealedSecret\", Namespace:\"foo\", Name:\"bar\", UID:\"919b1d17-3cb2-43c8-8a3b-8884218c6df6\", APIVersion:\"bitnami.com/v1alpha1\", ResourceVersion:\"1450095925\", FieldPath:\"\"}): type: 'Normal' reason: 'Unsealed' SealedSecret unsealed successfully"
time=2024-12-15T02:47:42.327Z level=INFO msg="update suppressed, no changes in spec" sealed-secret=foo/bar

While the log output makes sense when familiar with the controller, it is rather confusing from a user's perspective.

Describe the solution you'd like Change the log level to Debug for: https://github.com/bitnami-labs/sealed-secrets/blob/e70e158d7e576711bbf4cd329d1d00a9d75acdfa/pkg/controller/controller.go#L133

貢獻者指南