types

package
v1.2.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 2, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

type Manager interface {
	// HasExtension checks to see whether a given Group and Kind has an
	// associated extension registered for it.
	//
	// If a Group and Kind is registered with an extension, then it should
	// return true, otherwise return false.
	HasExtension(g gwapiv1.Group, k gwapiv1.Kind) bool

	// GetPreXDSHookClient checks if the registered extension makes use of a particular hook type that modifies inputs
	// that are used to generate an xDS resource.
	// If the extension makes use of the hook then the XDS Hook Client is returned. If it does not support
	// the hook type then nil is returned
	GetPreXDSHookClient(xdsHookType egv1a1.XDSTranslatorHook) XDSHookClient

	// GetPostXDSHookClient checks if the registered extension makes use of a particular hook type that modifies
	// xDS resources after they are generated by Envoy Gateway.
	// If the extension makes use of the hook then the XDS Hook Client is returned. If it does not support
	// the hook type then nil is returned
	GetPostXDSHookClient(xdsHookType egv1a1.XDSTranslatorHook) XDSHookClient
}

Manager handles and maintains registered extensions and returns clients for different Hook types.

type XDSHookClient

type XDSHookClient interface {
	// PostRouteModifyHook provides a way for extensions to modify a route generated by Envoy Gateway before it is finalized.
	// Doing so allows extensions to configure/modify route fields configured by Envoy Gateway and also to configure the
	// Route's TypedPerFilterConfig which may be desirable to do things such as pass settings and information to
	// ext_authz filters.
	// PostRouteModifyHook also passes a list of Unstructured data for the externalRefs owned by the extension on the HTTPRoute that
	// created this xDS route
	// PostRouteModifyHook will only be executed if an extension is loaded and only on Routes which were generated from an HTTPRoute
	// that uses extension resources as externalRef filters.
	PostRouteModifyHook(route *route.Route, routeHostnames []string, extensionResources []*unstructured.Unstructured) (*route.Route, error)

	// PostVirtualHostModifyHook provides a way for extensions to modify a VirtualHost generated by Envoy Gateway before it is finalized.
	// An extension can also make use of this hook to generate and insert entirely new Routes not generated by Envoy Gateway.
	// PostVirtualHostModifyHook is always executed when an extension is loaded. An extension may return nil to not make any changes
	// to it.
	PostVirtualHostModifyHook(*route.VirtualHost) (*route.VirtualHost, error)

	// PostHTTPListenerModifyHook allows an extension to make changes to a Listener generated by Envoy Gateway before it is finalized.
	// PostHTTPListenerModifyHook is always executed when an extension is loaded. An extension may return nil
	// in order to not make any changes to it.
	PostHTTPListenerModifyHook(listener *listener.Listener, extensionResources []*unstructured.Unstructured) (*listener.Listener, error)

	// PostTranslateModifyHook allows an extension to modify the clusters and secrets in the xDS config.
	// This allows for inserting clusters that may change along with extension specific configuration to be dynamically created rather than
	// using custom bootstrap config which would be sufficient for clusters that are static and not prone to have their configurations changed.
	// An example of how this may be used is to inject a cluster that will be used by an ext_authz http filter created by the extension.
	// The list of clusters and secrets returned by the extension are used as the final list of all clusters and secrets
	// PostTranslateModifyHook is always executed when an extension is loaded
	PostTranslateModifyHook([]*cluster.Cluster, []*tls.Secret) ([]*cluster.Cluster, []*tls.Secret, error)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL