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
In src/utils/ParentReferencesSelect.tsx, each Gateway FormSelectOption shows name (namespace) in its label, but its value is only gateway.metadata.name. So two Gateways that share a name in different namespaces appear as two visually distinct rows, yet carry the same underlying value.
Because the option value is not unique:
FormSelect.onChange receives only the name and can't tell which row was clicked;
updateParentReference resolves it with availableGateways.find((gw) => gw.metadata.name === value), which always returns the first match — so the wrong namespace is written to the HTTPRoute's parentRef;
on re-render, value={parentRef.gatewayName} (name only) matches the first option with that value, so the dropdown visually snaps the selection back to the first Gateway.
Steps to reproduce:
Create two Gateways with the same name in two different namespaces.
Open Create (or Edit) HTTPRoute → add a parent reference → open the Gateway dropdown.
You see two rows, e.g. gw (ns-a) and gw (ns-b).
Select the second one (gw (ns-b)).
Observed: the form resolves to the first Gateway (gw (ns-a)) — its namespace is written to the parentRef, and the dropdown shows the first entry as selected. You cannot actually pick the second Gateway.
Expected: Each row is uniquely selectable; selecting gw (ns-b) keeps gw (ns-b) selected and writes ns-b to the parentRef.
Proposed fix:
Use ${namespace}/${name} as both the option value and the resolution/selection key (and parse it back on change), following the pattern already used in src/components/gateway/GatewaySelect.tsx. Verify standalone Create/Edit HTTPRoute e2e still passes.
Context: Pre-existing defect (predates #795), flagged by CodeRabbit on the #795 PR. Deferred from that PR because the fix touches the standalone Create HTTPRoute form, which #795 promised to leave behaviorally unchanged.
Description:
In src/utils/ParentReferencesSelect.tsx, each Gateway FormSelectOption shows name (namespace) in its label, but its value is only gateway.metadata.name. So two Gateways that share a name in different namespaces appear as two visually distinct rows, yet carry the same underlying value.
Because the option value is not unique:
Steps to reproduce:
Expected: Each row is uniquely selectable; selecting gw (ns-b) keeps gw (ns-b) selected and writes ns-b to the parentRef.
Proposed fix:
Use ${namespace}/${name} as both the option value and the resolution/selection key (and parse it back on change), following the pattern already used in src/components/gateway/GatewaySelect.tsx. Verify standalone Create/Edit HTTPRoute e2e still passes.
Context: Pre-existing defect (predates #795), flagged by CodeRabbit on the #795 PR. Deferred from that PR because the fix touches the standalone Create HTTPRoute form, which #795 promised to leave behaviorally unchanged.
Screen.Recording.2026-09-01.at.15.33.50.mov