Skip to content

fix(operator/crd): Skip serializing traffic policy field if None#1152

Merged
Techassi merged 1 commit intomainfrom
fix/listenerclass-skip-serializing
Feb 17, 2026
Merged

fix(operator/crd): Skip serializing traffic policy field if None#1152
Techassi merged 1 commit intomainfrom
fix/listenerclass-skip-serializing

Conversation

@Techassi
Copy link
Member

Came up in stackabletech/listener-operator#369.

We skip serialization if this is None to ensure that forwarding the selection of the policy to Kubernetes works as expected. We stumbled over the following unexpected behaviour:

  • If ListenerClass manifests (which don't set this field) are applied by a client (like kubectl or helm), they are applied as expected - no errors.
  • If the same manifests are applied by Rust code, it fails. This field cannot be set to "null". Serde by default serializes None to "null".

We expected there to be a null variant in the schema, which would allow setting this field to null, but the schema only lists the two available variants. Additionally, ad-hoc testing showed that manifests would still be rejected after manually adjusting the schema in the CRD. This is something which should be investigated further.

We skip serialization if this is None to ensure that forwarding the
selection of the policy to Kubernetes works as expected. We stumbled
over the following unexpected behaviour:

- If ListenerClass manifests (which don't set this field) are applied
  by a client (like kubectl or helm), they are applied as expected -
  no errors.
- If the same manifests are applied by Rust code, it fails. This field
  cannot be set to "null". Serde by default serializes None to "null".

We expected there to be a null variant in the schema, which would allow
setting this field to null, but the schema only lists the two available
variants. Additionally, ad-hoc testing showed that manifests would still
be rejected after manually adjusting the schema in the CRD. This is
something which should be investigated further.
@Techassi Techassi self-assigned this Feb 17, 2026
@Techassi Techassi moved this to Development: Waiting for Review in Stackable Engineering Feb 17, 2026
@Techassi Techassi added this pull request to the merge queue Feb 17, 2026
Merged via the queue into main with commit d360c47 Feb 17, 2026
5 checks passed
@Techassi Techassi deleted the fix/listenerclass-skip-serializing branch February 17, 2026 10:39
@Techassi Techassi moved this from Development: Waiting for Review to Development: Done in Stackable Engineering Feb 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Development: Done

Development

Successfully merging this pull request may close these issues.

2 participants