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(common): Don't render backendRefs with RequestRedirect in GW API routes #391

Open
wants to merge 3 commits into
base: common-3.7.3
Choose a base branch
from

Conversation

larivierec
Copy link
Contributor

Description of the change

Fixed

This should fix the rendering of backendRef when we have a RequestRedirect present.
Even the unittests didn't catch it

Possible drawbacks

I'm not sure this is the intended way to implement the requirement but right now, we validate that a user doesn't input a backendRef with a RequestRedirect but when rendering, it renders it.

Applicable issues

Additional information

Checklist

Sorry, something went wrong.

Verified

This commit was signed with the committer’s verified signature. The key has expired.
larivierec Christopher Larivière
Signed-off-by: Christopher Larivière <[email protected]>
@larivierec larivierec force-pushed the fix-backendrefs-render branch from 967dfda to 8f4db54 Compare March 11, 2025 19:24
name: {{ default .name $service.name }}
namespace: {{ default $rootContext.Release.Namespace .namespace }}
port: {{ default .port $servicePrimaryPort.port }}
weight: {{ include "bjw-s.common.lib.defaultKeepNonNullValue" (dict "value" .weight "default" 1) }}
{{- end }}
{{- if or (eq $routeKind "HTTPRoute") (eq $routeKind "GRPCRoute") }}
{{- with .matches }}
matches:

Choose a reason for hiding this comment

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

I think it fails here, if there is no backendRefs, then "-" is missing before matches.

Copy link
Contributor Author

@larivierec larivierec Mar 12, 2025

Choose a reason for hiding this comment

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

going to keep checking. i figured out how to debug this better locally.

@larivierec larivierec changed the title feat(gw-api) - routes: don't render backendRefs with RequestRedirect bugfix(gw-api) - routes: don't render backendRefs with RequestRedirect Mar 13, 2025
@bjw-s bjw-s changed the base branch from main to common-3.7.3 March 13, 2025 06:48
@bjw-s bjw-s changed the title bugfix(gw-api) - routes: don't render backendRefs with RequestRedirect fix(common): Don't render backendRefs with RequestRedirect in GW API routes Mar 13, 2025
bjw-s added 2 commits March 13, 2025 07:50

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
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.

HTTPRoute with RequestRedirect results in invalid spec
3 participants