Skip to content

Conversation

@adleong
Copy link
Member

@adleong adleong commented Mar 8, 2025

The Helm function default will treat a boolean false value as unset and use the default instead of the false, even when it is set. When rendering CRDs during install or upgrade, this can cause Linkerd to fall back to using the installGatewayAPI value even when enableHttpRoutes is explicitly set to false.

We replace the default function with a ternary which checks if the key is present. We also add tests for both CLI and Helm.

@adleong adleong requested a review from a team as a code owner March 8, 2025 02:35
@@ -1,4 +1,4 @@
{{- if .Values.enableTlsRoutes | default .Values.installGatewayAPI }}
{{- if (ternary .Values.enableTcpRoutes .Values.installGatewayAPI (hasKey .Values "enableTcpRoutes")) }}
Copy link
Member

Choose a reason for hiding this comment

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

Should be enableTlsRoutes

IsInstall: true,
}

fmt.Println("overrideConfig", overrideConfig)
Copy link
Member

Choose a reason for hiding this comment

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

Leftover debugging?

t.Fatal("Unexpected error", err)
}

fmt.Println("valuesToRender", valuesToRender)
Copy link
Member

Choose a reason for hiding this comment

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

ditto

@@ -1,4 +1,4 @@
{{- if .Values.enableHttpRoutes | default .Values.installGatewayAPI }}
{{- if (ternary .Values.enableHttpRoutes .Values.installGatewayAPI (hasKey .Values "enableHttpRoutes")) }}
Copy link
Member

Choose a reason for hiding this comment

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

Nit: no-parenthesis alternative:

{{- if hasKey .Values "enableHttpRoutes" | ternary .Values.enableHttpRoutes .Values.installGatewayAPI }}

Signed-off-by: Alex Leong <[email protected]>
@adleong adleong merged commit f09def4 into main Mar 10, 2025
38 checks passed
@adleong adleong deleted the alex/gateway-defaulting branch March 10, 2025 23:03
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.

3 participants