Skip to content

feat(extensionManager): add support for multiple ExtensionManagers with sequential chaining#8458

Merged
zhaohuabing merged 13 commits intoenvoyproxy:mainfrom
toffentoffen:multiple-extension-managers
Apr 28, 2026
Merged

feat(extensionManager): add support for multiple ExtensionManagers with sequential chaining#8458
zhaohuabing merged 13 commits intoenvoyproxy:mainfrom
toffentoffen:multiple-extension-managers

Conversation

@toffentoffen
Copy link
Copy Markdown
Contributor

@toffentoffen toffentoffen commented Mar 9, 2026

Add a new extensionManagers plural field to EnvoyGatewaySpec that allows registering multiple extension managers with sequential chaining semantics. Each extension's output becomes the next extension's input.

Key changes:

  • Add Name field to ExtensionManager and ExtensionManagers list to EnvoyGatewaySpec
  • Add GetExtensionManagers() helper to normalize singular/plural fields
  • Add mutual exclusivity validation between singular and plural fields
  • Implement CompositeManager wrapping multiple managers behind the Manager interface
  • Implement compositeXDSHookClient with per-extension policy filtering and per-extension resource-type gating in PostTranslateModifyHook
  • Merge TranslationConfig using OR semantics across all managers
  • Add CleanupHookConns() to the Manager interface
  • Unify NewManager factory to handle 0, 1, and N extensions

Fixes: #8264
Release Notes: Yes

Hints for reviewers:

  • I could have changed the signature of PostTranslatedModifyHook and provide a slices of values extensionPolicies []ir.UnstructuredRef instead of pointers extensionPolicies []*ir.UnstructuredRef to avoid mutations, by cloning the content. But this would have been to much overhead I think. Instead we improved the interface.
  • Deprecating old Singular extensionManager has not been added to this PR as I am not familiar with the deprecation policies. Advice welcome.
  • Public facing documentation docs have not changed. Once this PR is approved we can work on them and changed them accordingly. Advice here much appreciated.
  • No observability added to ExtensionManager/s. Planned for another PR if agreed that it is needed, which I think it is.

@toffentoffen toffentoffen requested a review from a team as a code owner March 9, 2026 11:34
@netlify
Copy link
Copy Markdown

netlify Bot commented Mar 9, 2026

Deploy Preview for cerulean-figolla-1f9435 ready!

Name Link
🔨 Latest commit f61a4b5
🔍 Latest deploy log https://app.netlify.com/projects/cerulean-figolla-1f9435/deploys/69efd95f7d04160008d8db92
😎 Deploy Preview https://deploy-preview-8458--cerulean-figolla-1f9435.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 9, 2026

Codecov Report

❌ Patch coverage is 92.85714% with 23 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.55%. Comparing base (8570285) to head (f61a4b5).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
internal/extension/registry/inmemory_composite.go 80.48% 5 Missing and 3 partials ⚠️
internal/gatewayapi/runner/runner.go 0.00% 6 Missing ⚠️
internal/provider/kubernetes/controller.go 20.00% 3 Missing and 1 partial ⚠️
internal/extension/registry/extension_manager.go 93.75% 2 Missing and 1 partial ⚠️
...ternal/extension/registry/composite_hook_client.go 98.16% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8458      +/-   ##
==========================================
+ Coverage   74.36%   74.55%   +0.19%     
==========================================
  Files         246      249       +3     
  Lines       39292    39575     +283     
==========================================
+ Hits        29221    29507     +286     
+ Misses       8041     8034       -7     
- Partials     2030     2034       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread internal/extension/registry/composite_hook_client.go Outdated
@toffentoffen toffentoffen force-pushed the multiple-extension-managers branch from b68d616 to b69ed21 Compare March 12, 2026 17:58
@arkodg arkodg requested a review from guydc March 15, 2026 01:35
@arkodg arkodg added this to the v1.8.0-rc.1 Release milestone Mar 15, 2026
@toffentoffen toffentoffen force-pushed the multiple-extension-managers branch 2 times, most recently from eb460a9 to 0fe85de Compare March 18, 2026 09:56
Comment on lines +270 to +276
for _, gvk := range em.Resources {
extGKs = append(extGKs, schema.GroupKind{Group: gvk.Group, Kind: gvk.Kind})
}
// Include backend resources in extension group kinds for custom backend support
for _, gvk := range em.BackendResources {
extGKs = append(extGKs, schema.GroupKind{Group: gvk.Group, Kind: gvk.Kind})
}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Could it be that it was forgotten to also handle em.PolicyResources.
If so, should they be assigned to extGKs, which are assigned to Translator.ExtensionGroupKinds. Or do we need to create a different list and a new receiving property in Translator ?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think em.PolicyResources is not needed here because the Translator.ExtensionGroupKinds is only used for route custom backends and httpFilters in the code.

@toffentoffen toffentoffen force-pushed the multiple-extension-managers branch from 9c930e2 to b2469b9 Compare March 19, 2026 17:36
@nacx
Copy link
Copy Markdown
Member

nacx commented Mar 20, 2026

/retest

@guydc
Copy link
Copy Markdown
Contributor

guydc commented Mar 24, 2026

can we add some e2e tests for multiple ext-managers demonstrating chaining behavior and resource isolation?

Comment thread internal/extension/registry/composite_manager.go Outdated
Comment thread internal/extension/registry/composite_manager.go
@zhaohuabing zhaohuabing requested a review from a team April 1, 2026 03:08
@toffentoffen toffentoffen force-pushed the multiple-extension-managers branch from 1acd61e to 3437151 Compare April 12, 2026 11:09
@toffentoffen
Copy link
Copy Markdown
Contributor Author

can we add some e2e tests for multiple ext-managers demonstrating chaining behavior and resource isolation?

@guydc Would you mind taking a look and let me know if the e2e test that I've added are enough? If not not let me know we other cases we should cover.

Thanks in advance.

@toffentoffen toffentoffen force-pushed the multiple-extension-managers branch from 3437151 to 54d56d5 Compare April 13, 2026 07:27
@guydc
Copy link
Copy Markdown
Contributor

guydc commented Apr 13, 2026

Overall looks LGTM. Two asks:

  • add/adjust xds translator unit tests that test the extension manager to also use the composite manager? Test data for these lives in internal/xds/translator/testdata/in/extension-xds-ir . They mostly verify error handling from the extension manager to the translator.
  • update the extension-server doc (tasks > extensibility) to mention the new option + nuances like failOpen behavior, resource isolation, etc. A basic review is enough, no need to for a full-blown example.

@zhaohuabing
Copy link
Copy Markdown
Member

@codex

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

ℹ️ 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".

@zhaohuabing
Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@toffentoffen toffentoffen force-pushed the multiple-extension-managers branch 2 times, most recently from 6e77db9 to 559ede4 Compare April 17, 2026 16:04
@toffentoffen
Copy link
Copy Markdown
Contributor Author

Overall looks LGTM. Two asks:

  • add/adjust xds translator unit tests that test the extension manager to also use the composite manager? Test data for these lives in internal/xds/translator/testdata/in/extension-xds-ir . They mostly verify error handling from the extension manager to the translator.
  • update the extension-server doc (tasks > extensibility) to mention the new option + nuances like failOpen behavior, resource isolation, etc. A basic review is enough, no need to for a full-blown example.

Thanks for the feedback @guydc. I have added your suggestions. Hope that I understood them correctly, and the approach I took is correct. Looking forward for more feedback, and many thanks in advance

@zhaohuabing
Copy link
Copy Markdown
Member

/retest

@zhaohuabing
Copy link
Copy Markdown
Member

@codex review

Copy link
Copy Markdown

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

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: ca1a4defe4

ℹ️ 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".

if r == nil {
continue
}
if gvkSet.Has(r.GroupVersionKind()) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Match extension resources by group/kind, not full GVK

This filter uses exact GroupVersionKind matching, but the rest of extension discovery still treats resources as GroupKind (for example extension-kind registration and HasExtension checks). In multi-manager mode, a resource/policy that matches group+kind but comes from a different served version is accepted upstream, then silently dropped here, so the extension hook receives an empty context and behavior diverges from single-manager mode. This can break existing configs when CRD versions roll or multiple versions are served.

Useful? React with 👍 / 👎.

Comment thread internal/extension/registry/inmemory_composite.go Outdated
Comment thread api/v1alpha1/envoygateway_types.go
@zhaohuabing
Copy link
Copy Markdown
Member

Hi @toffentoffen Could you please fix the MultipleExtManagers test?

@toffentoffen toffentoffen force-pushed the multiple-extension-managers branch 2 times, most recently from 68f98c4 to 28516d7 Compare April 27, 2026 11:51
Comment on lines +155 to +162
lastDomain := len(req.VirtualHost.Domains) - 1
newDomain := fmt.Sprintf("%s.%s", req.VirtualHost.Domains[lastDomain], s.suffix)
s.log.Info("PostVirtualHostModify appending suffix to last domain",
slog.String("originalDomain", req.VirtualHost.Domains[lastDomain]),
slog.String("newDomain", newDomain))

req.VirtualHost.Domains = append(req.VirtualHost.Domains, newDomain)
}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This fixed the failing e2e test.
Previously it was always appending to the first domain generating domain.ext-a and domain.ext-b.
But what the multiple extensionManagers test were expecting is to chain the modifications from ext-a to ext-b, generating a domain called domain.ext-a.ext-b that the test will call.

@toffentoffen
Copy link
Copy Markdown
Contributor Author

/retest

Copy link
Copy Markdown
Contributor

@guydc guydc left a comment

Choose a reason for hiding this comment

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

LGTM, thanks

…ning

Add a new `extensionManagers` plural field to `EnvoyGatewaySpec` that allows
registering multiple extension managers with sequential chaining semantics.
Each extension's output becomes the next extension's input.

Key changes:
- Add `Name` field to `ExtensionManager` and `ExtensionManagers` list to `EnvoyGatewaySpec`
- Add `GetExtensionManagers()` helper to normalize singular/plural fields
- Add mutual exclusivity validation between singular and plural fields
- Implement `CompositeManager` wrapping multiple managers behind the `Manager` interface
- Implement `compositeXDSHookClient` with per-extension policy filtering and
  per-extension resource-type gating in `PostTranslateModifyHook`
- Merge `TranslationConfig` using OR semantics across all managers
- Add `CleanupHookConns()` to the `Manager` interface
- Unify `NewManager` factory to handle 0, 1, and N extensions

Signed-off-by: Marc Navarro Sonnenfeld <marcnavarro@tetrate.io>

# Conflicts:
#	release-notes/current.yaml

# Conflicts:
#	release-notes/current.yaml

# Conflicts:
#	release-notes/current.yaml

# Conflicts:
#	release-notes/current.yaml

# Conflicts:
#	release-notes/current.yaml
Signed-off-by: Marc Navarro Sonnenfeld <marcnavarro@tetrate.io>
Signed-off-by: Marc Navarro Sonnenfeld <marcnavarro@tetrate.io>
…esources accordingly

Signed-off-by: Marc Navarro Sonnenfeld <marcnavarro@tetrate.io>

# Conflicts:
#	internal/extension/registry/extension_manager_test.go
Signed-off-by: Marc Navarro Sonnenfeld <marcnavarro@tetrate.io>
…ager

Signed-off-by: Marc Navarro Sonnenfeld <marcnavarro@tetrate.io>
Signed-off-by: Marc Navarro Sonnenfeld <marcnavarro@tetrate.io>
…urce isolation

Enhance the simple-extension-server with a configurable --suffix flag and
resource-aware PostRouteModify to support testing multiple extension managers.
Add resilience tests that verify sequential chaining of VirtualHost mutations
and per-extension resource isolation via extensionRef filters.

Signed-off-by: Marc Navarro Sonnenfeld <marcnavarro@tetrate.io>

# Conflicts:
#	examples/simple-extension-server/go.mod
#	examples/simple-extension-server/go.sum
…ural ExtensionManagers

Mirror the existing extension-manager translator error-handling tests through
CompositeManager via a new NewInMemoryCompositeManager helper: a 1-entry
composite verifies child errors are swallowed when failOpen is true, and a
2-entry composite verifies errors are propagated with the 'extension "<name>":'
prefix when failOpen is false. Extract a shared buildManagerGVKSets helper to
avoid duplication between NewManager and the new in-memory constructor.

Also extend the extension-server docs with a "Multiple extension servers"
subsection covering sequential chaining, per-server resource isolation,
per-server failOpen, the unique name requirement, and mutual exclusivity with
the singular extensionManager field.

Signed-off-by: Marc Navarro Sonnenfeld <marcnavarro@tetrate.io>
Signed-off-by: Marc Navarro Sonnenfeld <marcnavarro@tetrate.io>
…ry composite

Two fixes in the composite-extension path:

1. CompositeManager filter now matches by group/kind only, aligning with
   runner.ExtensionGroupKinds, Manager.HasExtension, and Gateway API
   extensionRef. Exact-GVK matching could silently drop resources whose
   served version differed from the one declared in ExtensionManager.Resources,
   diverging from single-manager behavior when CRDs serve multiple versions.

2. NewInMemoryCompositeManager wires a sync.Once-guarded cleanup into every
   entry's cleanupHookConn, so CompositeManager.CleanupHookConns() (from the
   Manager interface) tears down the shared bufconn/server. The separate
   cleanup func return is removed; callers use CleanupHookConns() on the
   returned Manager.

Signed-off-by: Marc Navarro Sonnenfeld <marcnavarro@tetrate.io>
* +kubebuilder:validation:MinItems=1 on EnvoyGatewaySpec.ExtensionManagers,
  mirrored by a runtime check that rejects an explicitly-set-but-empty list
  (a nil slice still means "omitted").
* +kubebuilder:validation:XValidation on EnvoyGatewaySpec declaring that
  extensionManager and extensionManagers are mutually exclusive. The same
  constraint is already enforced at runtime in
  validateEnvoyGatewayExtensionManagers; the marker documents the schema
  and is wired up for consumers that validate against the generated OpenAPI.

Signed-off-by: Marc Navarro Sonnenfeld <marcnavarro@tetrate.io>
Signed-off-by: Marc Navarro Sonnenfeld <marcnavarro@tetrate.io>
@toffentoffen toffentoffen force-pushed the multiple-extension-managers branch from 28516d7 to f61a4b5 Compare April 27, 2026 21:47
@zhaohuabing
Copy link
Copy Markdown
Member

/retest

Copy link
Copy Markdown
Member

@zhaohuabing zhaohuabing left a comment

Choose a reason for hiding this comment

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

LGTM thanks!

@zhaohuabing zhaohuabing merged commit c68d38c into envoyproxy:main Apr 28, 2026
65 of 68 checks passed
@toffentoffen toffentoffen deleted the multiple-extension-managers branch April 28, 2026 07:50
kkk777-7 pushed a commit to kkk777-7/gateway that referenced this pull request Apr 30, 2026
…th sequential chaining (envoyproxy#8458)

* feat: add support for multiple ExtensionManagers with sequential chaining

Add a new `extensionManagers` plural field to `EnvoyGatewaySpec` that allows
registering multiple extension managers with sequential chaining semantics.
Each extension's output becomes the next extension's input.

Key changes:
- Add `Name` field to `ExtensionManager` and `ExtensionManagers` list to `EnvoyGatewaySpec`
- Add `GetExtensionManagers()` helper to normalize singular/plural fields
- Add mutual exclusivity validation between singular and plural fields
- Implement `CompositeManager` wrapping multiple managers behind the `Manager` interface
- Implement `compositeXDSHookClient` with per-extension policy filtering and
  per-extension resource-type gating in `PostTranslateModifyHook`
- Merge `TranslationConfig` using OR semantics across all managers
- Add `CleanupHookConns()` to the `Manager` interface
- Unify `NewManager` factory to handle 0, 1, and N extensions

Signed-off-by: Marc Navarro Sonnenfeld <marcnavarro@tetrate.io>

# Conflicts:
#	release-notes/current.yaml

# Conflicts:
#	release-notes/current.yaml

# Conflicts:
#	release-notes/current.yaml

# Conflicts:
#	release-notes/current.yaml

# Conflicts:
#	release-notes/current.yaml

* Fix lint issues

Signed-off-by: Marc Navarro Sonnenfeld <marcnavarro@tetrate.io>

* Add more test cases

Signed-off-by: Marc Navarro Sonnenfeld <marcnavarro@tetrate.io>

* Per-extension manager filter Resources, BackendResources, and PolicyResources accordingly

Signed-off-by: Marc Navarro Sonnenfeld <marcnavarro@tetrate.io>

# Conflicts:
#	internal/extension/registry/extension_manager_test.go

* Implement new hook method PostEndpointsModifyHook

Signed-off-by: Marc Navarro Sonnenfeld <marcnavarro@tetrate.io>

* Respect failOpen when GetPre/PostXDSHookClient errors in CompositeManager

Signed-off-by: Marc Navarro Sonnenfeld <marcnavarro@tetrate.io>

* Simplified and unified client getter and tests

Signed-off-by: Marc Navarro Sonnenfeld <marcnavarro@tetrate.io>

* Add resilience tests for multiple ExtensionManagers chaining and resource isolation

Enhance the simple-extension-server with a configurable --suffix flag and
resource-aware PostRouteModify to support testing multiple extension managers.
Add resilience tests that verify sequential chaining of VirtualHost mutations
and per-extension resource isolation via extensionRef filters.

Signed-off-by: Marc Navarro Sonnenfeld <marcnavarro@tetrate.io>

# Conflicts:
#	examples/simple-extension-server/go.mod
#	examples/simple-extension-server/go.sum

* Add CompositeManager coverage to xDS translator tests and document plural ExtensionManagers

Mirror the existing extension-manager translator error-handling tests through
CompositeManager via a new NewInMemoryCompositeManager helper: a 1-entry
composite verifies child errors are swallowed when failOpen is true, and a
2-entry composite verifies errors are propagated with the 'extension "<name>":'
prefix when failOpen is false. Extract a shared buildManagerGVKSets helper to
avoid duplication between NewManager and the new in-memory constructor.

Also extend the extension-server docs with a "Multiple extension servers"
subsection covering sequential chaining, per-server resource isolation,
per-server failOpen, the unique name requirement, and mutual exclusivity with
the singular extensionManager field.

Signed-off-by: Marc Navarro Sonnenfeld <marcnavarro@tetrate.io>

* Fix lint errors

Signed-off-by: Marc Navarro Sonnenfeld <marcnavarro@tetrate.io>

* Match extension resources by group/kind, and wire cleanup for in-memory composite

Two fixes in the composite-extension path:

1. CompositeManager filter now matches by group/kind only, aligning with
   runner.ExtensionGroupKinds, Manager.HasExtension, and Gateway API
   extensionRef. Exact-GVK matching could silently drop resources whose
   served version differed from the one declared in ExtensionManager.Resources,
   diverging from single-manager behavior when CRDs serve multiple versions.

2. NewInMemoryCompositeManager wires a sync.Once-guarded cleanup into every
   entry's cleanupHookConn, so CompositeManager.CleanupHookConns() (from the
   Manager interface) tears down the shared bufconn/server. The separate
   cleanup func return is removed; callers use CleanupHookConns() on the
   returned Manager.

Signed-off-by: Marc Navarro Sonnenfeld <marcnavarro@tetrate.io>

* Add MinItems=1 and mutual-exclusion validation on extensionManagers

* +kubebuilder:validation:MinItems=1 on EnvoyGatewaySpec.ExtensionManagers,
  mirrored by a runtime check that rejects an explicitly-set-but-empty list
  (a nil slice still means "omitted").
* +kubebuilder:validation:XValidation on EnvoyGatewaySpec declaring that
  extensionManager and extensionManagers are mutually exclusive. The same
  constraint is already enforced at runtime in
  validateEnvoyGatewayExtensionManagers; the marker documents the schema
  and is wired up for consumers that validate against the generated OpenAPI.

Signed-off-by: Marc Navarro Sonnenfeld <marcnavarro@tetrate.io>

* Fix MultiextensionManagers tests

Signed-off-by: Marc Navarro Sonnenfeld <marcnavarro@tetrate.io>

---------

Signed-off-by: Marc Navarro Sonnenfeld <marcnavarro@tetrate.io>
skos-ninja pushed a commit to skos-ninja/envoy-gateway that referenced this pull request May 1, 2026
…th sequential chaining (envoyproxy#8458)

* feat: add support for multiple ExtensionManagers with sequential chaining

Add a new `extensionManagers` plural field to `EnvoyGatewaySpec` that allows
registering multiple extension managers with sequential chaining semantics.
Each extension's output becomes the next extension's input.

Key changes:
- Add `Name` field to `ExtensionManager` and `ExtensionManagers` list to `EnvoyGatewaySpec`
- Add `GetExtensionManagers()` helper to normalize singular/plural fields
- Add mutual exclusivity validation between singular and plural fields
- Implement `CompositeManager` wrapping multiple managers behind the `Manager` interface
- Implement `compositeXDSHookClient` with per-extension policy filtering and
  per-extension resource-type gating in `PostTranslateModifyHook`
- Merge `TranslationConfig` using OR semantics across all managers
- Add `CleanupHookConns()` to the `Manager` interface
- Unify `NewManager` factory to handle 0, 1, and N extensions

Signed-off-by: Marc Navarro Sonnenfeld <marcnavarro@tetrate.io>

# Conflicts:
#	release-notes/current.yaml

# Conflicts:
#	release-notes/current.yaml

# Conflicts:
#	release-notes/current.yaml

# Conflicts:
#	release-notes/current.yaml

# Conflicts:
#	release-notes/current.yaml

* Fix lint issues

Signed-off-by: Marc Navarro Sonnenfeld <marcnavarro@tetrate.io>

* Add more test cases

Signed-off-by: Marc Navarro Sonnenfeld <marcnavarro@tetrate.io>

* Per-extension manager filter Resources, BackendResources, and PolicyResources accordingly

Signed-off-by: Marc Navarro Sonnenfeld <marcnavarro@tetrate.io>

# Conflicts:
#	internal/extension/registry/extension_manager_test.go

* Implement new hook method PostEndpointsModifyHook

Signed-off-by: Marc Navarro Sonnenfeld <marcnavarro@tetrate.io>

* Respect failOpen when GetPre/PostXDSHookClient errors in CompositeManager

Signed-off-by: Marc Navarro Sonnenfeld <marcnavarro@tetrate.io>

* Simplified and unified client getter and tests

Signed-off-by: Marc Navarro Sonnenfeld <marcnavarro@tetrate.io>

* Add resilience tests for multiple ExtensionManagers chaining and resource isolation

Enhance the simple-extension-server with a configurable --suffix flag and
resource-aware PostRouteModify to support testing multiple extension managers.
Add resilience tests that verify sequential chaining of VirtualHost mutations
and per-extension resource isolation via extensionRef filters.

Signed-off-by: Marc Navarro Sonnenfeld <marcnavarro@tetrate.io>

# Conflicts:
#	examples/simple-extension-server/go.mod
#	examples/simple-extension-server/go.sum

* Add CompositeManager coverage to xDS translator tests and document plural ExtensionManagers

Mirror the existing extension-manager translator error-handling tests through
CompositeManager via a new NewInMemoryCompositeManager helper: a 1-entry
composite verifies child errors are swallowed when failOpen is true, and a
2-entry composite verifies errors are propagated with the 'extension "<name>":'
prefix when failOpen is false. Extract a shared buildManagerGVKSets helper to
avoid duplication between NewManager and the new in-memory constructor.

Also extend the extension-server docs with a "Multiple extension servers"
subsection covering sequential chaining, per-server resource isolation,
per-server failOpen, the unique name requirement, and mutual exclusivity with
the singular extensionManager field.

Signed-off-by: Marc Navarro Sonnenfeld <marcnavarro@tetrate.io>

* Fix lint errors

Signed-off-by: Marc Navarro Sonnenfeld <marcnavarro@tetrate.io>

* Match extension resources by group/kind, and wire cleanup for in-memory composite

Two fixes in the composite-extension path:

1. CompositeManager filter now matches by group/kind only, aligning with
   runner.ExtensionGroupKinds, Manager.HasExtension, and Gateway API
   extensionRef. Exact-GVK matching could silently drop resources whose
   served version differed from the one declared in ExtensionManager.Resources,
   diverging from single-manager behavior when CRDs serve multiple versions.

2. NewInMemoryCompositeManager wires a sync.Once-guarded cleanup into every
   entry's cleanupHookConn, so CompositeManager.CleanupHookConns() (from the
   Manager interface) tears down the shared bufconn/server. The separate
   cleanup func return is removed; callers use CleanupHookConns() on the
   returned Manager.

Signed-off-by: Marc Navarro Sonnenfeld <marcnavarro@tetrate.io>

* Add MinItems=1 and mutual-exclusion validation on extensionManagers

* +kubebuilder:validation:MinItems=1 on EnvoyGatewaySpec.ExtensionManagers,
  mirrored by a runtime check that rejects an explicitly-set-but-empty list
  (a nil slice still means "omitted").
* +kubebuilder:validation:XValidation on EnvoyGatewaySpec declaring that
  extensionManager and extensionManagers are mutually exclusive. The same
  constraint is already enforced at runtime in
  validateEnvoyGatewayExtensionManagers; the marker documents the schema
  and is wired up for consumers that validate against the generated OpenAPI.

Signed-off-by: Marc Navarro Sonnenfeld <marcnavarro@tetrate.io>

* Fix MultiextensionManagers tests

Signed-off-by: Marc Navarro Sonnenfeld <marcnavarro@tetrate.io>

---------

Signed-off-by: Marc Navarro Sonnenfeld <marcnavarro@tetrate.io>
Signed-off-by: Jake Oliver <jake@truelayer.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Proposal: Support Multiple ExtensionManagers in EnvoyGateway

5 participants