Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

k8s gateway extensions: allow customizing translator #9471

Open
wants to merge 51 commits into
base: main
Choose a base branch
from

Conversation

stevenctl
Copy link
Contributor

Description

API changes

The only API is an internal code API to allow GME to take control of the Gateway translation.

Changed CreatePluginRegistry to GetPluginRegistry. AFAICT there is no need to recreate the registry each time but I can rever tthis if needed.

	// GetPluginRegistry exposes the plugins supported by this implementation.
	GetPluginRegistry() registry.PluginRegistry

Added: GetTranslator to allow conditionally switching the translation logic based on the type of gateway.

	// GetTranslator allows an extnsion to provide custom translation for
	// different gateway classes.
	GetTranslator(*apiv1.Gateway) translator.K8sGwTranslator

Context

See slack conversation here

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • [] I have added tests that prove my fix is effective or that my feature works

@github-actions github-actions bot added the keep pr updated signals bulldozer to keep pr up to date with base branch label May 9, 2024
Copy link

github-actions bot commented May 9, 2024

Visit the preview URL for this PR (updated for commit a4ac9a2):

https://gloo-edge--pr9471-stevenctl-allow-cust-yvxfx2b9.web.app

(expires Tue, 02 Jul 2024 18:55:25 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 77c2b86e287749579b7ff9cadb81e099042ef677

// GetEnvoyImage returns the envoy image and tag used by the proxy deployment.
// GetTranslator allows an extnsion to provide custom translation for
// different gateway classes.
GetTranslator(*apiv1.Gateway) translator.K8sGwTranslator
Copy link
Contributor

Choose a reason for hiding this comment

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

should this take in the GatewayClass instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It leaves some flexibility to look at labels/annotations if needed. I'm not sure further restricting it gives much of an advantage.

Copy link
Member

@EItanya EItanya left a comment

Choose a reason for hiding this comment

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

Changes LGTM, just want confirmation about the registry creation semantics for portal

// CreatePluginRegistry returns the PluginRegistry
CreatePluginRegistry(ctx context.Context) registry.PluginRegistry
// GetPluginRegistry exposes the plugins supported by this implementation.
GetPluginRegistry() registry.PluginRegistry
Copy link
Member

Choose a reason for hiding this comment

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

@jmhbh or @ilackarms would know better if this needs to be created every time, I don't think so but I defer to them.

EItanya
EItanya previously approved these changes May 23, 2024
@stevenctl stevenctl force-pushed the stevenctl/allow-custom-translator branch from 8428f9e to 840cb77 Compare June 11, 2024 19:22
changelog-bot and others added 30 commits June 19, 2024 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
keep pr updated signals bulldozer to keep pr up to date with base branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants