We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Description The DefaultHttpListenerName will always inject to gateway
Environmental Tell us what your cluster environment is like, e.g.
Expected behavior
Only if there is no listener or the name of the listener is equal to DefaultHttpListenerName, the default listener will be injected into the gateway.
Actual behavior Inject default listener any way. To Reproduce Steps to reproduce the behavior:
Screenshots If applicable, add screenshots to help explain your problem.
Additional context Add any other context about the problem here.
The text was updated successfully, but these errors were encountered:
needInjectDefaultListeners := true for index, listener := range r.Spec.GatewaySpec.Listeners { if listener.Name == DefaultHttpListenerName { needInjectDefaultListeners = false internalHostname := k8sgatewayapiv1beta1.Hostname(fmt.Sprintf("*.%s", r.Spec.ClusterDomain)) namespaceFromAll := k8sgatewayapiv1beta1.NamespacesFromAll listener.Hostname = &internalHostname listener.Port = constants.DefaultGatewayListenerPort listener.Protocol = constants.DefaultGatewayListenerProtocol listener.AllowedRoutes = &k8sgatewayapiv1beta1.AllowedRoutes{ Namespaces: &k8sgatewayapiv1beta1.RouteNamespaces{ From: &namespaceFromAll, }, } } else { hostname := k8sgatewayapiv1beta1.Hostname(fmt.Sprintf("*.%s", r.Spec.Domain)) listener.Hostname = &hostname } r.Spec.GatewaySpec.Listeners[index] = listener } if needInjectDefaultListeners { internalHostname := k8sgatewayapiv1beta1.Hostname(fmt.Sprintf("*.%s", r.Spec.ClusterDomain)) namespaceFromAll := k8sgatewayapiv1beta1.NamespacesFromAll internalHttpListener := k8sgatewayapiv1beta1.Listener{ Name: DefaultHttpListenerName, Hostname: &internalHostname, Port: constants.DefaultGatewayListenerPort, Protocol: constants.DefaultGatewayListenerProtocol, AllowedRoutes: &k8sgatewayapiv1beta1.AllowedRoutes{ Namespaces: &k8sgatewayapiv1beta1.RouteNamespaces{ From: &namespaceFromAll, }, }, } r.Spec.GatewaySpec.Listeners = append(r.Spec.GatewaySpec.Listeners, internalHttpListener) }
Would it be better to add the condition needInjectDefaultListeners := len(r.Spec.GatewaySpec.Listeners) == 0?
needInjectDefaultListeners := len(r.Spec.GatewaySpec.Listeners) == 0
Sorry, something went wrong.
@Bryce-huang I would like to work on this issue
No branches or pull requests
Description
The DefaultHttpListenerName will always inject to gateway
Environmental
Tell us what your cluster environment is like, e.g.
Expected behavior
Only if there is no listener or the name of the listener is equal to DefaultHttpListenerName, the default listener will be injected into the gateway.
Actual behavior
Inject default listener any way.
To Reproduce
Steps to reproduce the behavior:
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: