linkerd2 icon indicating copy to clipboard operation
linkerd2 copied to clipboard

Missing Golang type for enableHTTPRoutes

Open bencoxford opened this issue 1 year ago • 4 comments

What is the issue?

https://github.com/linkerd/linkerd2/blob/main/pkg/charts/linkerd2/values.go is missing the types for enableHTTPRoutes introduced into 2.14.x release. Rendering the chart causes linkerd policy pods to fail since the CRD for HTTPRoutes is not applied. This is a result of the value enableHTTPRoutes not being casted to linkerd2.Values since its not defined.

How can it be reproduced?

Attempt to render the helm charts using golang.

Logs, error output, etc

{"timestamp":"2024-01-03T12:31:06.488000Z","level":"INFO","fields":{"message":"stream failed","error":"failed to perform initial object list: ApiError: \"404 page not found\\n\": Failed to parse error data (ErrorResponse { status: \"404 Not Found\", message: \"\\\"404 page not found\\\\n\\\"\", reason: \"Failed to parse error data\", code: 404 })"},"target":"kubert::errors","spans":[{"name":"httproutes.gateway.networking.k8s.io"}]}

output of linkerd check -o short

N/A

Environment

Linkerd version: 2.14.x

Possible solution

Add the new value enableHTTPRoutes to Values struct in https://github.com/linkerd/linkerd2/blob/main/pkg/charts/linkerd2/values.go

Additional context

No response

Would you like to work on fixing this bug?

yes

bencoxford avatar Jan 03 '24 12:01 bencoxford

That struct is for the linkerd-control-plane chart. The CRDs are rendered via the linkerd-crds chart, which can be done via helm or through the CLI: linkerd install --crds | kubectl apply -f -.

alpeb avatar Jan 03 '24 16:01 alpeb

That struct is for the linkerd-control-plane chart. The CRDs are rendered via the linkerd-crds chart, which can be done via helm or through the CLI: linkerd install --crds | kubectl apply -f -.

The function NewValues() returns the merged values.yaml for both the linkerd-control-plane chart and linkerd-crds chart. When the helm chart is rendered (golang) with the new values, the HTTPRoute CRD will not be applied since enableHTTPRoutes is not present.

bencoxford avatar Jan 03 '24 16:01 bencoxford

Ok I see. Are you relying on this function for custom work? Feel free to submit a PR with the fix and we'll take a look at it.

alpeb avatar Jan 03 '24 16:01 alpeb

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Apr 13 '24 11:04 stale[bot]