Skip to content

Engnode 568#3997

Merged
sowmyav27 merged 5 commits into
loft-sh:mainfrom
zerbitx:ENGNODE-568
Jun 12, 2026
Merged

Engnode 568#3997
sowmyav27 merged 5 commits into
loft-sh:mainfrom
zerbitx:ENGNODE-568

Conversation

@zerbitx

@zerbitx zerbitx commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

⚠️ Comes after #3996

What issue type does this pull request address? (keep at least one, remove the others)
/kind bugfix

What does this pull request do? Which issues does it resolve? (use resolves #<issue_number> if possible)
resolves #ENGNODE-568

Please provide a short message that should be published in the vcluster release notes
Fixed an issue where vcluster ...

What else do we need to know?

E2E Tests

Default Test Execution

The mandatory PR suite runs automatically. Only specify additional test suites below if needed.

Adding New Test Suites

When adding a new ginkgo test suite:

  • Add labels to the test suite
  • Update label-filter section below to execute the new test suite
  • Verify test suite runs in CI/CD pipeline

Additional test suites

Additional test suite(s) that will be executed before the mandatory PR suite:

none

@zerbitx

zerbitx commented Jun 11, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1ff87191c9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread pkg/util/gatewayapi/enabled.go
zerbitx added 3 commits June 11, 2026 12:58
Pin ReferenceGrant, TLSRoute, and BackendTLSPolicy syncing to the v1
Gateway API versions instead of negotiating older served versions
against the host. Hosts whose Gateway API CRDs do not serve v1 fail
fast at startup with an actionable error.

Signed-off-by: Ryan Swanson <ryan.swanson@loft.sh>
  - route controllers watch virtual ReferenceGrants regardless of
    sync.toHost.gatewayApi.referenceGrants.enabled; with the flag "false"
    the CRD was never installed and the watch failed forever, silently
    blocking all HTTPRoute/TLSRoute sync
  - extract EnsureReferenceGrantCRD and call it from the HTTPRoute and
    TLSRoute mappers, keeping "false" semantics: grants never sync to the
    host and virtual grants stay authoritative for cross-namespace refs
  - add gatewayapi-grants-disabled e2e suite plus a unit test asserting
    route mappers ensure the grant CRD when grant sync is disabled

Signed-off-by: Ryan Swanson <ryan.swanson@loft.sh>
  - route controllers watch virtual ReferenceGrants for cross-namespace
    authorization regardless of sync.toHost.gatewayApi.referenceGrants.enabled;
    with the flag "false" the CRD was never installed and the watch failed
    forever (no matches for kind "ReferenceGrant"), silently blocking all
    HTTPRoute/TLSRoute sync
  - extract EnsureReferenceGrantCRD and call it from the HTTPRoute and
    TLSRoute mappers, independent of grant sync
  - keep "false" semantics: no host discovery check, no mapper, no syncer,
    grants never sync to the host; virtual grants stay authoritative for
    cross-namespace refs in single-namespace mode
  - add gatewayapi-grants-disabled e2e suite: same-namespace route syncs,
    cross-namespace backendRef denied until a virtual ReferenceGrant permits
    it, grant itself never syncs to the host
  - add unit test asserting route mappers ensure the grant CRD when grant
    sync is disabled

Signed-off-by: Ryan Swanson <ryan.swanson@loft.sh>

# Conflicts:
#	e2e-next/test_gatewayapi/test_gatewayapi_grants_disabled.go
#	pkg/mappings/resources/register_gateway_test.go
#	pkg/mappings/resources/tlsroutes.go
The umbrella sync.toHost.gatewayApi.enabled only enabled HTTPRoute sync:
the tenant gateways CRD was never installed, host RBAC for gateways was
never granted, and route controllers logged watch errors for the missing
Gateway kind.

- honor the umbrella in GatewaysEnabled and the chart gateways RBAC rule
- install the tenant Gateway CRD whenever route sync is enabled
- sync ReferenceGrants to the host only with namespace sync or an
  explicit referenceGrants toggle, matching the read-only RBAC the chart
  grants in single-namespace mode; tenant-side validation is unchanged
- document umbrella and referenceGrants auto semantics in the schema
- add umbrella-only e2e suite plus unit and chart test coverage

Closes ENGNODE-568

Signed-off-by: Ryan Swanson <ryan.swanson@loft.sh>
@zerbitx zerbitx marked this pull request as ready for review June 12, 2026 13:23
@zerbitx zerbitx requested review from a team as code owners June 12, 2026 13:23

@sowmyav27 sowmyav27 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have some comments for the tests, but they are non-blocking, will log a separate issue for those.

@sowmyav27 sowmyav27 merged commit edbb688 into loft-sh:main Jun 12, 2026
15 checks passed
@loft-bot

Copy link
Copy Markdown
Contributor

💚 All backports created successfully

Status Branch Result
v0.35

Questions ?

Please refer to the Backport tool documentation and see the Github Action logs for details

zerbitx added a commit that referenced this pull request Jun 12, 2026
* feat: use latest gateway api versions only

Pin ReferenceGrant, TLSRoute, and BackendTLSPolicy syncing to the v1
Gateway API versions instead of negotiating older served versions
against the host. Hosts whose Gateway API CRDs do not serve v1 fail
fast at startup with an actionable error.

Signed-off-by: Ryan Swanson <ryan.swanson@loft.sh>

* fix: install tenant referencegrant crd whenever route sync is enabled

  - route controllers watch virtual ReferenceGrants regardless of
    sync.toHost.gatewayApi.referenceGrants.enabled; with the flag "false"
    the CRD was never installed and the watch failed forever, silently
    blocking all HTTPRoute/TLSRoute sync
  - extract EnsureReferenceGrantCRD and call it from the HTTPRoute and
    TLSRoute mappers, keeping "false" semantics: grants never sync to the
    host and virtual grants stay authoritative for cross-namespace refs
  - add gatewayapi-grants-disabled e2e suite plus a unit test asserting
    route mappers ensure the grant CRD when grant sync is disabled

Signed-off-by: Ryan Swanson <ryan.swanson@loft.sh>

* fix: install tenant referencegrant crd whenever route sync is enabled

  - route controllers watch virtual ReferenceGrants for cross-namespace
    authorization regardless of sync.toHost.gatewayApi.referenceGrants.enabled;
    with the flag "false" the CRD was never installed and the watch failed
    forever (no matches for kind "ReferenceGrant"), silently blocking all
    HTTPRoute/TLSRoute sync
  - extract EnsureReferenceGrantCRD and call it from the HTTPRoute and
    TLSRoute mappers, independent of grant sync
  - keep "false" semantics: no host discovery check, no mapper, no syncer,
    grants never sync to the host; virtual grants stay authoritative for
    cross-namespace refs in single-namespace mode
  - add gatewayapi-grants-disabled e2e suite: same-namespace route syncs,
    cross-namespace backendRef denied until a virtual ReferenceGrant permits
    it, grant itself never syncs to the host
  - add unit test asserting route mappers ensure the grant CRD when grant
    sync is disabled

Signed-off-by: Ryan Swanson <ryan.swanson@loft.sh>

# Conflicts:
#	e2e-next/test_gatewayapi/test_gatewayapi_grants_disabled.go
#	pkg/mappings/resources/register_gateway_test.go
#	pkg/mappings/resources/tlsroutes.go

* fix: enable tenant gateway sync via the gatewayapi umbrella switch

The umbrella sync.toHost.gatewayApi.enabled only enabled HTTPRoute sync:
the tenant gateways CRD was never installed, host RBAC for gateways was
never granted, and route controllers logged watch errors for the missing
Gateway kind.

- honor the umbrella in GatewaysEnabled and the chart gateways RBAC rule
- install the tenant Gateway CRD whenever route sync is enabled
- sync ReferenceGrants to the host only with namespace sync or an
  explicit referenceGrants toggle, matching the read-only RBAC the chart
  grants in single-namespace mode; tenant-side validation is unchanged
- document umbrella and referenceGrants auto semantics in the schema
- add umbrella-only e2e suite plus unit and chart test coverage

Closes ENGNODE-568

Signed-off-by: Ryan Swanson <ryan.swanson@loft.sh>

---------

Signed-off-by: Ryan Swanson <ryan.swanson@loft.sh>
(cherry picked from commit edbb688)
Signed-off-by: Ryan Swanson <ryan.swanson@loft.sh>

# Conflicts:
#	pkg/mappings/resources/httproutes.go
#	pkg/mappings/resources/referencegrants.go
#	pkg/mappings/resources/register_gateway_test.go

# Conflicts:
#	pkg/mappings/resources/httproutes.go
#	pkg/mappings/resources/referencegrants.go
#	pkg/mappings/resources/register_gateway_test.go
zerbitx added a commit that referenced this pull request Jun 12, 2026
* feat: use latest gateway api versions only

Pin ReferenceGrant, TLSRoute, and BackendTLSPolicy syncing to the v1
Gateway API versions instead of negotiating older served versions
against the host. Hosts whose Gateway API CRDs do not serve v1 fail
fast at startup with an actionable error.

Signed-off-by: Ryan Swanson <ryan.swanson@loft.sh>

* fix: install tenant referencegrant crd whenever route sync is enabled

  - route controllers watch virtual ReferenceGrants regardless of
    sync.toHost.gatewayApi.referenceGrants.enabled; with the flag "false"
    the CRD was never installed and the watch failed forever, silently
    blocking all HTTPRoute/TLSRoute sync
  - extract EnsureReferenceGrantCRD and call it from the HTTPRoute and
    TLSRoute mappers, keeping "false" semantics: grants never sync to the
    host and virtual grants stay authoritative for cross-namespace refs
  - add gatewayapi-grants-disabled e2e suite plus a unit test asserting
    route mappers ensure the grant CRD when grant sync is disabled

Signed-off-by: Ryan Swanson <ryan.swanson@loft.sh>

* fix: install tenant referencegrant crd whenever route sync is enabled

  - route controllers watch virtual ReferenceGrants for cross-namespace
    authorization regardless of sync.toHost.gatewayApi.referenceGrants.enabled;
    with the flag "false" the CRD was never installed and the watch failed
    forever (no matches for kind "ReferenceGrant"), silently blocking all
    HTTPRoute/TLSRoute sync
  - extract EnsureReferenceGrantCRD and call it from the HTTPRoute and
    TLSRoute mappers, independent of grant sync
  - keep "false" semantics: no host discovery check, no mapper, no syncer,
    grants never sync to the host; virtual grants stay authoritative for
    cross-namespace refs in single-namespace mode
  - add gatewayapi-grants-disabled e2e suite: same-namespace route syncs,
    cross-namespace backendRef denied until a virtual ReferenceGrant permits
    it, grant itself never syncs to the host
  - add unit test asserting route mappers ensure the grant CRD when grant
    sync is disabled

Signed-off-by: Ryan Swanson <ryan.swanson@loft.sh>

# Conflicts:
#	e2e-next/test_gatewayapi/test_gatewayapi_grants_disabled.go
#	pkg/mappings/resources/register_gateway_test.go
#	pkg/mappings/resources/tlsroutes.go

* fix: enable tenant gateway sync via the gatewayapi umbrella switch

The umbrella sync.toHost.gatewayApi.enabled only enabled HTTPRoute sync:
the tenant gateways CRD was never installed, host RBAC for gateways was
never granted, and route controllers logged watch errors for the missing
Gateway kind.

- honor the umbrella in GatewaysEnabled and the chart gateways RBAC rule
- install the tenant Gateway CRD whenever route sync is enabled
- sync ReferenceGrants to the host only with namespace sync or an
  explicit referenceGrants toggle, matching the read-only RBAC the chart
  grants in single-namespace mode; tenant-side validation is unchanged
- document umbrella and referenceGrants auto semantics in the schema
- add umbrella-only e2e suite plus unit and chart test coverage

Closes ENGNODE-568

Signed-off-by: Ryan Swanson <ryan.swanson@loft.sh>

---------

Signed-off-by: Ryan Swanson <ryan.swanson@loft.sh>
(cherry picked from commit edbb688)
Signed-off-by: Ryan Swanson <ryan.swanson@loft.sh>

# Conflicts:
#	pkg/mappings/resources/httproutes.go
#	pkg/mappings/resources/referencegrants.go
#	pkg/mappings/resources/register_gateway_test.go

# Conflicts:
#	pkg/mappings/resources/httproutes.go
#	pkg/mappings/resources/referencegrants.go
#	pkg/mappings/resources/register_gateway_test.go
zerbitx added a commit that referenced this pull request Jun 12, 2026
* feat: use latest gateway api versions only

Pin ReferenceGrant, TLSRoute, and BackendTLSPolicy syncing to the v1
Gateway API versions instead of negotiating older served versions
against the host. Hosts whose Gateway API CRDs do not serve v1 fail
fast at startup with an actionable error.

Signed-off-by: Ryan Swanson <ryan.swanson@loft.sh>

* fix: install tenant referencegrant crd whenever route sync is enabled

  - route controllers watch virtual ReferenceGrants regardless of
    sync.toHost.gatewayApi.referenceGrants.enabled; with the flag "false"
    the CRD was never installed and the watch failed forever, silently
    blocking all HTTPRoute/TLSRoute sync
  - extract EnsureReferenceGrantCRD and call it from the HTTPRoute and
    TLSRoute mappers, keeping "false" semantics: grants never sync to the
    host and virtual grants stay authoritative for cross-namespace refs
  - add gatewayapi-grants-disabled e2e suite plus a unit test asserting
    route mappers ensure the grant CRD when grant sync is disabled

Signed-off-by: Ryan Swanson <ryan.swanson@loft.sh>

* fix: install tenant referencegrant crd whenever route sync is enabled

  - route controllers watch virtual ReferenceGrants for cross-namespace
    authorization regardless of sync.toHost.gatewayApi.referenceGrants.enabled;
    with the flag "false" the CRD was never installed and the watch failed
    forever (no matches for kind "ReferenceGrant"), silently blocking all
    HTTPRoute/TLSRoute sync
  - extract EnsureReferenceGrantCRD and call it from the HTTPRoute and
    TLSRoute mappers, independent of grant sync
  - keep "false" semantics: no host discovery check, no mapper, no syncer,
    grants never sync to the host; virtual grants stay authoritative for
    cross-namespace refs in single-namespace mode
  - add gatewayapi-grants-disabled e2e suite: same-namespace route syncs,
    cross-namespace backendRef denied until a virtual ReferenceGrant permits
    it, grant itself never syncs to the host
  - add unit test asserting route mappers ensure the grant CRD when grant
    sync is disabled

Signed-off-by: Ryan Swanson <ryan.swanson@loft.sh>

# Conflicts:
#	e2e-next/test_gatewayapi/test_gatewayapi_grants_disabled.go
#	pkg/mappings/resources/register_gateway_test.go
#	pkg/mappings/resources/tlsroutes.go

* fix: enable tenant gateway sync via the gatewayapi umbrella switch

The umbrella sync.toHost.gatewayApi.enabled only enabled HTTPRoute sync:
the tenant gateways CRD was never installed, host RBAC for gateways was
never granted, and route controllers logged watch errors for the missing
Gateway kind.

- honor the umbrella in GatewaysEnabled and the chart gateways RBAC rule
- install the tenant Gateway CRD whenever route sync is enabled
- sync ReferenceGrants to the host only with namespace sync or an
  explicit referenceGrants toggle, matching the read-only RBAC the chart
  grants in single-namespace mode; tenant-side validation is unchanged
- document umbrella and referenceGrants auto semantics in the schema
- add umbrella-only e2e suite plus unit and chart test coverage

Closes ENGNODE-568

Signed-off-by: Ryan Swanson <ryan.swanson@loft.sh>

---------

Signed-off-by: Ryan Swanson <ryan.swanson@loft.sh>
(cherry picked from commit edbb688)
Signed-off-by: Ryan Swanson <ryan.swanson@loft.sh>

# Conflicts:
#	pkg/mappings/resources/httproutes.go
#	pkg/mappings/resources/referencegrants.go
#	pkg/mappings/resources/register_gateway_test.go

# Conflicts:
#	pkg/mappings/resources/httproutes.go
#	pkg/mappings/resources/referencegrants.go
#	pkg/mappings/resources/register_gateway_test.go
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants