Skip to content

Conversation

@scholzj
Copy link
Owner

@scholzj scholzj commented Oct 3, 2025

This PR changes the Go API to use pointers for the places where the original Strimzi API uses boxed primitives (e.g. Integer or Boolean).

The reason for this is that with the boxed primitives, the Strimzi API can have them at a null value and can assign it special meaning. For example an API field with Boolean type can be interpreted as true or full when set to null value. But the Golang APi when using bool does not let you to set it to null value easily. As an example of an error it can cause when working with the Strimzi resources:

  • The enableServiceLinks defaults to true in Kubernetes
  • When it is not set (set to null) in Strimzi Java API, it will be passed as unset to the Kubernetes Pods Strimzi creates as such and it will result into the service links being created in the Pod
  • But when working from it with the older versions of the Strimzi Go API, the bool field will default to false. So when you for example set it to false, it would assume it has the default value and not serialize it into the resource. But that would effectively mean it is set to true.

This Pr moves in these cases to use *bool. That way it respects the null / nil values. While this is harder to use, it respects the Strimzi API (and the ?mistakes? we did there).

@scholzj scholzj merged commit 5b3f0a7 into main Oct 3, 2025
2 checks passed
@scholzj scholzj deleted the use-pointers-for-boxed-java-types branch October 3, 2025 09:37
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