Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PluginsForRule ¶ added in v2.1.8
func PluginsForRule( ctx context.Context, logger logr.Logger, cl client.Client, httpRoute *gwtypes.HTTPRoute, rule gwtypes.HTTPRouteRule, pRef *gwtypes.ParentReference, ) ([]configurationv1.KongPlugin, error)
PluginsForRule creates or retrieves the KongPlugins for all filters of the given HTTPRoute rule.
Workflow:
- Translates the rule's built-in filters into plugin configurations, merging filters that map to the same Kong plugin type into a single configuration. This is required because Kong enforces a unique-plugin-per-entity constraint: a route cannot have two plugins of the same type bound to it (e.g. URLRewrite and RequestHeaderModifier both map to request-transformer).
- For each resulting plugin configuration: - Derives the KongPlugin name using namegen (from the contributing filters). - Builds a new KongPlugin resource with appropriate name, namespace, labels, annotations, and config. - Calls translator.VerifyAndUpdate to handle existing plugin reconciliation.
- Retrieves the KongPlugin referenced by each ExtensionRef filter.
- Returns all plugins.
Self-managed plugin:
A plugin referenced via ExtensionRef. These are returned as-is without rebuild, annotation modification, or existence checks. The user is responsible for managing the plugin lifecycle.
Parameters:
- ctx: Context for API calls.
- logger: Structured logger.
- cl: Kubernetes client.
- httpRoute: Source HTTPRoute.
- rule: The HTTPRouteRule being processed.
- pRef: Parent (Gateway) reference.
Returns:
- kongPlugins: The translated plugin(s).
- err: Any error encountered.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.