Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BindingForPluginAndRoute ¶
func BindingForPluginAndRoute( ctx context.Context, logger logr.Logger, cl client.Client, httpRoute *gwtypes.HTTPRoute, pRef *gwtypes.ParentReference, cp *commonv1alpha1.ControlPlaneRef, pluginName string, routeName string, ) (kongPluginBinding *configurationv1alpha1.KongPluginBinding, err error)
BindingForPluginAndRoute creates or updates a KongPluginBinding for the given plugin and route.
The function performs the following operations: 1. Generates the KongPluginBinding name using the namegen package 2. Checks if a KongPluginBinding with that name already exists in the cluster 3. If it exists, updates the KongPluginBinding annotations to include the current HTTPRoute 4. If it doesn't exist, creates a new KongPluginBinding 5. Returns the KongPluginBinding resource for use by the caller
Parameters:
- ctx: The context for API calls and cancellation
- logger: Logger for structured logging
- cl: Kubernetes client for API operations
- httpRoute: The HTTPRoute resource from which the KongPluginBinding is derived
- pRef: The parent reference (Gateway) for the HTTPRoute
- cp: The control plane reference for the KongPluginBinding
- pluginName: The name of the KongPlugin to bind
- routeName: The name of the KongRoute to bind to
Returns:
- kongPluginBinding: The created or updated KongPluginBinding resource
- err: Any error that occurred during the process
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.