You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
RHOAIENG-46780: feat(gateway): filter gateway refs based on listener allowedRoutes (opendatahub-io#771)
* feat(gateway): filter gateway refs based on listener allowedRoutes
Implement filterAllowedRefs to enforce Gateway API allowedRoutes
semantics: only gateway refs whose listeners permit routes from the
LLMInferenceService namespace are retained. Thread the gateway object
through getEffectiveGatewayRefs and getGatewayRefs so the filter has
access to listener configuration.
Handles All, Same, and Selector (permissive fallback since namespace
labels are unavailable in the controller context).
Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
* test(gateway): add unit and integration tests for allowedRoutes filtering
Add unit tests for filterAllowedRefs, listenerAllowsNamespace, and
gatewayAllowsNamespace covering All/Same/Selector semantics, nil
defaults, empty ref namespaces, mixed refs, and no-listener gateways.
Add integration tests verifying that cross-namespace refs are rejected
when listeners default to Same, accepted when listeners use All, and
accepted for same-namespace refs.
Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
* namespace selector
Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
* fix tests
Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
* lint
Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
* One more defensive test
Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
* Add namespace watch
Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
* fix: target namespace watch and clean up cross-ns test resources
Replace cluster-wide Gateway list in enqueueGatewaysFromNamespace with
targeted approach: extract gateway refs from LLMInferenceServices in
the changed namespace (resolving BaseRefs), then only enqueue those
that exist and have Selector-based listeners.
Add DeferCleanup for cross-namespace LLMInferenceService instances to
prevent stale refs from affecting cluster-wide listings.
Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
* fix: handle transient errors in namespace watch gateway lookup
Only skip IsNotFound errors when looking up gateways in the namespace
label change handler. Log and enqueue other errors so the reconciler
can retry on transient failures.
Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
* fix: propagate context to allowedRoutes filter functions for error logging
Thread context.Context through filterAllowedRefs, gatewayAllowsNamespace,
and listenerAllowsNamespace so malformed namespace selector errors are
logged via the structured logger instead of silently swallowed.
Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
* fix: clean up gateways in cross-namespace allowedRoutes tests
Add DeferCleanup to delete Gateways created in cross-namespace
tests to prevent interference via cluster-wide watches.
Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
---------
Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
0 commit comments