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: set default value for old CA field when missing. #527

Merged
merged 1 commit into from
Sep 11, 2024

Conversation

jvanz
Copy link
Member

@jvanz jvanz commented Sep 10, 2024

Description

Updates the webhooks.yaml template to set a default value "" to the old CA certificate when it's missing. This can happen because the empty value in the secret is removed during the upgrade. Therefore, in a future upgrade the b64enc function fails because the value is nil.

Fix #523

@jvanz jvanz self-assigned this Sep 10, 2024
@jvanz jvanz requested a review from a team as a code owner September 10, 2024 22:00
@@ -14,6 +14,14 @@
{{ $caCert = (index $caSecret.data "ca.crt") }}
{{ $caPrivateKey = (index $caSecret.data "ca.key") }}
{{ $oldCaCert = (index $caSecret.data "old-ca.crt") }}
# Check if the old CA certificate is missing. If so, set it to "". This is to
Copy link
Contributor

Choose a reason for hiding this comment

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

a simpler alternative : {{ $oldCaCert = (index $caSecret.data "old-ca.crt" | default "") }}

Updates the webhooks.yaml template to set a default value "" to the old
CA certificate when it's missing. This can happen because the empty
value in the secret is removed during the upgrade. Therefore, in a
future upgrade the b64enc function fails because the value is nil.

Signed-off-by: José Guilherme Vanz <[email protected]>
@jvanz jvanz merged commit f01a6b4 into kubewarden:main Sep 11, 2024
2 of 3 checks passed
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.

webhooks.yaml" at <b64dec>: invalid value; expected string
2 participants