plugin

package
v2.2.7 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2026 License: Apache-2.0 Imports: 22 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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.

func RequestTerminationForBackendNotFound added in v2.2.0

func RequestTerminationForBackendNotFound(
	ctx context.Context,
	logger logr.Logger,
	cl client.Client,
	httpRoute *gwtypes.HTTPRoute,
	pRef *gwtypes.ParentReference,
	serviceName string,
) (*configurationv1.KongPlugin, error)

RequestTerminationForBackendNotFound creates a plugin that converts Kong's default 503 for backend-less services into the Gateway API conformance-required 500 response.

func ResolveConfig added in v2.2.6

func ResolveConfig(ctx context.Context, cl client.Client, plugin *configurationv1.KongPlugin) (json.RawMessage, error)

ResolveConfig returns the effective configuration of the given KongPlugin, resolving the Secret references declared in spec.configFrom and spec.configPatches. The two are mutually exclusive, enforced by the KongPlugin CRD validation rules. With neither set, spec.config is returned as-is.

Types

This section is empty.

Jump to

Keyboard shortcuts

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