dryrunvalidator

package
v0.1.0-alpha.9 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

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

View Source
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

func (*Component) Name

func (c *Component) Name() string

Name returns the unique identifier for this component. Implements the lifecycle.Component interface.

func (*Component) Start

func (c *Component) Start(ctx context.Context) error

Start begins the validator's event loop.

This method blocks until the context is cancelled. It processes WebhookValidationRequest events from the pre-subscribed channel.

Jump to

Keyboard shortcuts

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