Skip to content

Commit d21f57b

Browse files
ivanmatmatioktalz
authored andcommitted
MINOR: don't need referencegrant if tcproute and backendref are in same namespace
1 parent 5faba1d commit d21f57b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/gateways/gateways.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ func (gm GatewayManagerImpl) isBackendRefValid(backendRef store.BackendRef) bool
349349
// This check depends on cross namespace reference and authorization to do so by referenceGrant if necessary.
350350
func (gm GatewayManagerImpl) isNamespaceGranted(namespace string, backendRef store.BackendRef) (granted bool) {
351351
// If namespace of backendRef is specified ...
352-
if backendRef.Namespace != nil {
352+
if backendRef.Namespace != nil && *backendRef.Namespace != namespace {
353353
ns, found := gm.k8sStore.Namespaces[*backendRef.Namespace]
354354
if !found || !ns.Relevant {
355355
gm.statusManager.SetRouteReasonBackendNotFound(fmt.Sprintf("backend '%s/%s' not found", utils.PointerDefaultValueIfNil(backendRef.Namespace), backendRef.Name))

0 commit comments

Comments
 (0)