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

Re-enable logging json patch on StatusDrifted #1010

Merged
merged 1 commit into from
Jun 19, 2024
Merged

Re-enable logging json patch on StatusDrifted #1010

merged 1 commit into from
Jun 19, 2024

Conversation

souleb
Copy link
Member

@souleb souleb commented Jun 18, 2024

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
Copy link
Member Author

souleb commented Jun 18, 2024

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"}

Copy link
Member

@stefanprodan stefanprodan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Thanks @souleb

@stefanprodan stefanprodan added the backport:release/v1.0.x To be backported to release/v1.0.x label Jun 19, 2024
@souleb souleb merged commit 655432b into main Jun 19, 2024
7 checks passed
@souleb souleb deleted the fix-1008 branch June 19, 2024 08:11
@fluxcdbot
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:release/v1.0.x To be backported to release/v1.0.x
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Drift Detection is not logging JSON patch when --log-level=debug
3 participants