Skip to content

fix: bools where nil is interpreted as true can't have omitempty#774

Open
vshnbot wants to merge 1 commit intomasterfrom
appcat/388/default-true-vs-omitempty
Open

fix: bools where nil is interpreted as true can't have omitempty#774
vshnbot wants to merge 1 commit intomasterfrom
appcat/388/default-true-vs-omitempty

Conversation

@vshnbot
Copy link
Collaborator

@vshnbot vshnbot commented Jun 17, 2025

DeletionProtection is a pointer to boolean with "omitempty" and a default of "true". This combination is broken in case the bool is set to "false", because the YAML mapper thinks that "false" is the default, thus ommitting the field; but then k8s thinks that "true" is the default (since the field is omitted). The result is that this is is always true, and it's completely impossible to set this field to "false" via the YAML mapper.

This PR fixes this by removing the "omitempty", which will make the YAML serializer also include "false" values instead of nil.

Component PR: #774
Link: vshn/appcat#388

@vshnbot vshnbot force-pushed the appcat/388/default-true-vs-omitempty branch from b9a2193 to 305449d Compare June 17, 2025 11:15
Base automatically changed from develop to master July 2, 2025 11:52
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