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

fix: remove omitempty tag for boolean leaveOnDelete #126

Merged
merged 2 commits into from
Dec 14, 2023

Conversation

helgebonert
Copy link
Contributor

Description

Overriding the default value "true" for the boolean leaveOnDelete doesn't work. Even if the CRD is created with a default value "false" the conversion webhook uses the default value "true" from the operator's PassboltSecretSpec to create the passbolt secret.

It seems that the omitempty tag for boolean leaveOnDelete prevents parsing the value when set to "false" (as it is the zero value for booleans) and then the default webhook is kicking as it doesn't see any value for that field.

A similar issue can be fount here:
kubernetes-sigs/kubebuilder#2109

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings

@github-actions github-actions bot added fix size/XS Denotes a PR that changes 0-49 lines, ignoring generated files. labels Dec 12, 2023
@helgebonert helgebonert marked this pull request as ready for review December 14, 2023 13:05
@helgebonert helgebonert requested a review from a team as a code owner December 14, 2023 13:05
@helgebonert helgebonert requested a review from a team December 14, 2023 13:05
Copy link

@f-pietsch f-pietsch left a comment

Choose a reason for hiding this comment

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

LGTM

@helgebonert helgebonert merged commit 714576e into main Dec 14, 2023
13 checks passed
@helgebonert helgebonert deleted the fix/remove-omitempty-for-bool-leaveOnDelete branch December 14, 2023 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix size/XS Denotes a PR that changes 0-49 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants