Documentation
¶
Overview ¶
Package dryrunvalidator implements the DryRunValidator component that performs dry-run reconciliation for webhook validation.
This component: - Subscribes to WebhookValidationRequest events (scatter-gather) - Creates overlay stores simulating resource changes - Performs dry-run reconciliation (rendering + validation) - Publishes WebhookValidationResponse events
The validator ensures resources are valid before they're saved to etcd, preventing invalid configurations from being admitted.
Index ¶
Constants ¶
const ( // ComponentName is the unique identifier for this component. ComponentName = "dryrun-validator" // ValidatorID identifies this validator in scatter-gather responses. ValidatorID = "dryrun" // EventBufferSize is the size of the event subscription buffer. EventBufferSize = 50 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Component ¶
type Component struct {
// contains filtered or unexported fields
}
Component implements the dry-run validator.
It subscribes to WebhookValidationRequest events, simulates resource changes using overlay stores, performs dry-run reconciliation (rendering + validation), and responds with validation results.
func New ¶
func New( eventBus *busevents.EventBus, storeManager *resourcestore.Manager, cfg *config.Config, engine templating.Engine, validationPaths *dataplane.ValidationPaths, capabilities dataplane.Capabilities, logger *slog.Logger, ) *Component
New creates a new DryRunValidator component.
Parameters:
- eventBus: The EventBus for subscribing to requests and publishing responses
- storeManager: ResourceStoreManager for accessing stores and creating overlays
- cfg: Controller configuration containing templates
- engine: Pre-compiled template engine for rendering
- validationPaths: Filesystem paths for HAProxy validation
- capabilities: HAProxy capabilities determined from local version
- logger: Structured logger
Returns:
- A new Component instance ready to be started