Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

bugfix(gw-api) - routes: don't render backendRefs with RequestRedirect #391

Open
wants to merge 1 commit into
base: main
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

Signed-off-by: Christopher Larivière <lariviere.c@gmail.com>
@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
# for free to join this conversation on GitHub. Already have an account? # 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
2 participants