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

fully synchronize CRDs and helm values #190

Merged
merged 1 commit into from
Aug 19, 2024
Merged

Conversation

chrisseto
Copy link
Contributor

@chrisseto chrisseto commented Aug 15, 2024

Prior to this commit a variety of differences between the redpanda CRD and the helm values existed. This could prevent end users from leveraging certain features of the chart/operator and cause strange behaviors in cases of incorrect serialization.

To ensure these differences don't reappear, a new property test (leveraging a fork of rapid) has been added that asserts that the JSON serialization of the CRD and typed helm values are the same. This test ignores a handful of fields which are documented in the test itself.

The resultant heavy modifications to the CRD should be backwards compatible with existing installations. The majority of changes were either additions of optional fields or making required fields optional.

Fixes #146, #81

@chrisseto
Copy link
Contributor Author

The aspect I'm most worried about is the fullname change. I'm keeping the field around so we don't suddenly break existing deployments. I think the change is safe though as existing usages of that field would either a) do nothing or b) break horribly because helm wouldn't pick it up and some of the internal controllers' logic would break.

Please check my math.

Copy link
Contributor

@andrewstucki andrewstucki left a comment

Choose a reason for hiding this comment

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

Found one seeming field that looks like it was dropped.

@andrewstucki
Copy link
Contributor

The aspect I'm most worried about is the fullname change. I'm keeping the field around so we don't suddenly break existing deployments. I think the change is safe though as existing usages of that field would either a) do nothing or b) break horribly because helm wouldn't pick it up and some of the internal controllers' logic would break.

Still getting up-to-speed, but let me attempt to parse out the context/worry about this change:

In our helm chart we likely are using fullnameOverride v. fullNameOverride with the camelized Name? Hence in older versions of this CRD passing in a fullNameOverride would either:

A. Do nothing since the code to initialize the helm values is just marshaling the spec from the Redpanda CRD
B. Break things because of the point above coupled with whatever assumptions we might make in controller code about the value of the mis-tagged FullnameOverride field being reflected in reality?

If that's what you're saying, seems reasonable to me to keep the field around and just ignore it.

On the flip side though, is there a chance that we have any controller code that relies on the field essentially being ignored (i.e. always uses some default value) and fixing this might cause the controller code to break?

@chrisseto
Copy link
Contributor Author

On the flip side though, is there a chance that we have any controller code that relies on the field essentially being ignored (i.e. always uses some default value) and fixing this might cause the controller code to break?

The opposite actually. It seems like fullNameOverride would be respected when doing so would cause controller code to fail. Yet another example of how lack luster the current test coverage is 😬

Copy link
Contributor

@andrewstucki andrewstucki left a comment

Choose a reason for hiding this comment

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

I'm generally fine with these changes. I do still have a question about how we want to treat the deprecated fullNameOverride field though - should we plan on migrating the field to the new fullnameOverride when initializing the chart values to fix anyone that might be broken or just ignore it and use the new field? Here it looks like we're just ignoring it and keeping the field only for storage compatibility purposes. Either way is good with me, but just wondering if we had a typical way of handling stuff like this if it's happened before?

Also, if you feel comfortable with the rest of the changes, I'd say go ahead and merge, but if you want a more experienced with this codebase set of eyes first... maybe wait for Rafal to get back?

@chrisseto
Copy link
Contributor Author

should we plan on migrating the field to the new fullnameOverride when initializing the chart values to fix anyone that might be broken or just ignore it and use the new field?

I think that migrating it would likely end up in bugs being opened as it would trigger a massive and unexpected change to the existing deployment. For anything that would change an existing deployment in meaningful ways, I think it's best to make those opt-in. Predictability trumps correctness for something running someone else's software.

Also, if you feel comfortable with the rest of the changes, I'd say go ahead and merge, but if you want a more experienced with this codebase set of eyes first... maybe wait for Rafal to get back?

I'm pretty comfortable with merging this but I will wait until Monday to release it 😅

Prior to this commit a variety of differences between the redpanda CRD and the
helm values existed. This could prevent end users from leveraging certain
features of the chart/operator and cause strange behaviors in cases of
incorrect serialization.

To ensure these differences don't reappear, a new property test (leveraging a
fork of rapid) has been added that asserts that the JSON serialization of the
CRD and typed helm values are the same. This test ignores a handful of fields
which are documented in the test itself.

The resultant heavy modifications to the CRD should be backwards compatible
with existing installations. The majority of changes were either additions of
optional fields or making required fields optional.
@chrisseto chrisseto merged commit 358df38 into main Aug 19, 2024
4 checks passed
@chrisseto chrisseto deleted the chris/p/rapid-for-fuzz branch August 19, 2024 20:06
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.

Sync helm-chart values and Redpanda CRD
2 participants