plugin

package
v2.1.11 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

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:

  1. 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).
  2. 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.
  3. Retrieves the KongPlugin referenced by each ExtensionRef filter.
  4. 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.

Jump to

Keyboard shortcuts

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