Documentation
¶
Index ¶
Constants ¶
const ( // PolicyConditionEnforced mirrors the internal kuadrant enforced condition // type for convenience to extension authors. PolicyConditionEnforced = kuadrant.PolicyConditionEnforced // KuadrantMetricsPrefix is the prefix applied to metric bindings injected // via AddDataTo / KuadrantMetricBinding. KuadrantMetricsPrefix = "metrics.labels" )
Variables ¶
This section is empty.
Functions ¶
func KuadrantMetricBinding ¶
KuadrantMetricBinding creates a fully qualified binding name for metrics enrichment.
Types ¶
type Domain ¶
type Domain int
Domain enumerates the supported logical domains for mutator injected data.
type ExtensionBase ¶
ExtensionBase is a base struct for the extension controllers. ExtensionBase is an embeddable struct providing common fields (logger, client, scheme) and a helper Configure method for extension controllers.
type KuadrantCtx ¶
type KuadrantCtx interface {
Resolve(context.Context, Policy, string, bool) (celref.Val, error)
ResolvePolicy(context.Context, Policy, string, bool) (Policy, error)
AddDataTo(context.Context, Policy, Domain, string, string) error
ReconcileObject(context.Context, client.Object, client.Object, MutateFn) (client.Object, error)
}
KuadrantCtx is passed to ReconcileFn providing access to CEL resolution, mutator registration and object reconciliation helpers.
type MutateFn ¶
MutateFn is a function that mutates the existing object into it's desired state. MutateFn mutates the existing object into the desired state. It returns true when a change was applied requiring an update.
type Policy ¶
type Policy interface {
GetName() string
GetNamespace() string
GetObjectKind() schema.ObjectKind
GetTargetRefs() []gatewayapiv1alpha2.LocalPolicyTargetReferenceWithSectionName
}
Policy is an interface for the policy object to be implemented by the extension policy. Policy is the common interface a policy object must implement for the extension controller. Implementations are usually thin adapters over generated protobuf or Kubernetes types.
type ReconcileFn ¶
type ReconcileFn func(ctx context.Context, request reconcile.Request, kuadrant KuadrantCtx) (reconcile.Result, error)
ReconcileFn defines the signature of an extension reconcile function.