Documentation
¶
Index ¶
- func ApplyExtensions[t ExtendableT](ctx context.Context, cl client.Client, o t, konnectEnabled bool, ...) (stop bool, res ctrl.Result, err error)
- func GetAllDataPlaneMetricExtensionsForControlPlane(ctx context.Context, cl client.Client, controlplane *gwtypes.ControlPlane) ([]operatorv1alpha1.DataPlaneMetricsExtension, error)
- func GetAllDataPlaneMetricsExtensionRefsForControlPlane(controlplane *gwtypes.ControlPlane) []commonv1alpha1.ExtensionRef
- func MergeExtensions[extendable Extendable](defaultExtensions []commonv1alpha1.ExtensionRef, extended extendable) []commonv1alpha1.ExtensionRef
- func MergeExtensionsForDataPlane(defaultExtensions, extensions []commonv1alpha1.ExtensionRef) []commonv1alpha1.ExtensionRef
- type Extendable
- type ExtendableT
- type Processor
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 ¶
type ExtendableT interface { client.Object Extendable k8sutils.ConditionsAware *operatorv1beta1.DataPlane | *gwtypes.ControlPlane | *operatorv2beta1.GatewayConfiguration }
ExtendableT is the interface implemented by the objects which implementation can be extended through extensions.