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

operator v1: alternative solution for drift detection with "null" #324

Merged
merged 2 commits into from
Nov 21, 2024

Conversation

birdayz
Copy link
Contributor

@birdayz birdayz commented Nov 21, 2024

This is an alternative to #320 .

Instead of adding a special case for "null", use the existing method that normalizes the values already when talking to redpanda (writing cluster config).
This way, both ends are normalized via the same function:

  • Writing done by cluster controller
  • Reading done by cluster configuration drift controller

The function used has a special case, similar to #320 : https://github.com/redpanda-data/redpanda-operator/blob/jb%2Fdrift-detection-alternative/operator/pkg/resources/configuration/patch.go#L106

This way, we don't need to have the "null" special code twice.

Very interested in review from @RafalKorepta , who may know this code better than i do.

cluster controller normalizes configs before sending them to admin-api,
when writing.
this patch makes use of the normalization when comparing for drift
detection, to avoid unexpected drifts, for example if the CRD sets
spec.additionalProperties.key to "null" (string).
@birdayz birdayz force-pushed the jb/drift-detection-alternative branch from 5c2eca4 to f4fef93 Compare November 21, 2024 17:39
@RafalKorepta
Copy link
Contributor

@RafalKorepta RafalKorepta merged commit 6e6f3c6 into main Nov 21, 2024
5 checks passed
@RafalKorepta RafalKorepta deleted the jb/drift-detection-alternative branch December 2, 2024 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants