extensions

package
v1.6.1-0...-486f9dc Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyExtensions

func ApplyExtensions[t ExtendableT](ctx context.Context, cl client.Client, o t, konnectEnabled bool, processor Processor) (stop bool, res ctrl.Result, err error)

ApplyExtensions patches the spec of extensible resources (DataPlane, ControlPlane, GatewayConfiguration) by applying customizations from their referenced extensions. The actual extension logic is implemented by the provided ExtensionProcessor, which handles the resource-specific extension application. If extensions are referenced, it adds appropriate conditions to the resource status to indicate the status of extension processing. It returns 3 values:

  • stop: a boolean indicating if the caller must return. It's true when the resource status has been patched.
  • res: a ctrl.Result indicating if the resource should be requeued. If the error was unexpected (e.g., because of an API server error), the resource should be requeued. For misconfiguration errors, the resource does not need to be requeued, and feedback is provided via resource status conditions.
  • err: an error in case of failure.

func GetAllDataPlaneMetricExtensionsForControlPlane

func GetAllDataPlaneMetricExtensionsForControlPlane(
	ctx context.Context, cl client.Client, controlplane *gwtypes.ControlPlane,
) ([]operatorv1alpha1.DataPlaneMetricsExtension, error)

GetAllDataPlaneMetricExtensionsForControlPlane returns all DataPlaneMetricsExtensions that are referenced in the ControlPlane's spec.extensions.

func GetAllDataPlaneMetricsExtensionRefsForControlPlane

func GetAllDataPlaneMetricsExtensionRefsForControlPlane(controlplane *gwtypes.ControlPlane) []commonv1alpha1.ExtensionRef

GetAllDataPlaneMetricsExtensionRefsForControlPlane gets all DataPlaneMetricsExtension refs set in the ControlPlane's spec.

func MergeExtensions

func MergeExtensions[
	extendable Extendable,
](
	defaultExtensions []commonv1alpha1.ExtensionRef,
	extended extendable,
) []commonv1alpha1.ExtensionRef

MergeExtensions merges the default extensions with the extensions from the provided extendable object. The provided extensions take precedence over the default extensions: in case the user provides an extension that is also present in the default extensions, the user's extension will be used.

func MergeExtensionsForDataPlane

func MergeExtensionsForDataPlane(
	defaultExtensions, extensions []commonv1alpha1.ExtensionRef,
) []commonv1alpha1.ExtensionRef

MergeExtensionsForDataPlane is a wrapper around MergeExtensions for places where we do not have an actual object to work on.

Types

type Extendable

type Extendable interface {
	GetExtensions() []commonv1alpha1.ExtensionRef
}

Extendable is an interface that provides access to the extensions of an object.

type ExtendableT

ExtendableT is the interface implemented by the objects which implementation can be extended through extensions.

type Processor

type Processor interface {
	// Process the extension for the given object.
	Process(ctx context.Context, cl client.Client, obj client.Object) (bool, error)
}

Processor defines how to process extensions for a specific resource type.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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