fluxcd / helm-controller

The GitOps Toolkit Helm reconciler, for declarative Helming
https://fluxcd.io
Apache License 2.0
396 stars 153 forks source link

Re-enable logging json patch on StatusDrifted #1010

Closed souleb closed 3 weeks ago

souleb commented 3 weeks ago

fix #1008

We previously disabled logging json patches on ReleaseStatusDrifted due to the fact that the MaskSecretPatchData() cannot differentiate between Secrets and ConfigMaps in #935

We are re-enabling this with a check on the kind to know when to call MaskSecretPatchData().

souleb commented 3 weeks ago

Tested this on a kind cluster:

drifted configmap

{"level":"debug","ts":"2024-06-18T21:48:05.588Z","msg":"resource modified","controller":"helmrelease","controllerGroup":"helm.toolkit.fluxcd.io","controllerKind":"HelmRelease","HelmRelease":{"name":"podinfo","namespace":"default"},"namespace":"default","name":"podinfo","reconcileID":"622968d9-00df-4254-b812-992a9f1b62eb","patch":[{"value":"maxmemory 64mb\nmaxmemory-policy allkeys-lru\nsave \"\"\nappendonly no\n","op":"replace","path":"/data/redis.conf"}],"resource":"ConfigMap/default/podinfo-redis"}

**drifted deployment***

{"level":"debug","ts":"2024-06-18T21:28:23.163Z","msg":"resource modified","controller":"helmrelease","controllerGroup":"helm.toolkit.fluxcd.io","controllerKind":"HelmRelease","HelmRelease":{"name":"ww-gitops","namespace":"flux-system"},"namespace":"flux-system","name":"ww-gitops","reconcileID":"6079f6e4-0fff-4b48-b58d-3efcc7023773","patch":[{"value":1,"op":"replace","path":"/spec/replicas"}],"resource":"Deployment/flux-system/ww-gitops-weave-gitops"}
fluxcdbot commented 3 weeks ago

Successfully created backport PR for release/v1.0.x: