Documentation
¶
Overview ¶
Package proposalvalidator validates hypothetical configuration changes.
Index ¶
- Constants
- type Component
- type Service
- func (c *Service) ValidateSync(ctx context.Context, overlays map[string]*stores.StoreOverlay) (*pipeline.PipelineResult, *validation.ValidationResult)
- func (c *Service) ValidateSyncWithAdmissionSubject(ctx context.Context, overlays map[string]*stores.StoreOverlay, ...) (*pipeline.PipelineResult, *validation.ValidationResult)
- type ServiceConfig
Constants ¶
const ( ComponentName = "proposalvalidator" EventBufferSize = busevents.StandardSubscriberBuffer )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Component ¶
Component adapts proposal-validation requests to the validation service.
func New ¶
func New(eventBus *busevents.EventBus, cfg *ServiceConfig) *Component
New subscribes to proposal-validation requests during construction.
func (*Component) HandleEvent ¶
HandleEvent implements component.EventHandler: it processes incoming events.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service validates proposed changes against the current stores.
func NewService ¶
func NewService(cfg *ServiceConfig) *Service
NewService creates a validator without an event subscription or lifecycle.
func (*Service) ValidateSync ¶
func (c *Service) ValidateSync(ctx context.Context, overlays map[string]*stores.StoreOverlay) (*pipeline.PipelineResult, *validation.ValidationResult)
ValidateSync admits unchanged invalid output only after an exact baseline comparison.
func (*Service) ValidateSyncWithAdmissionSubject ¶
func (c *Service) ValidateSyncWithAdmissionSubject(ctx context.Context, overlays map[string]*stores.StoreOverlay, storeAliases []string, namespace, name string) (*pipeline.PipelineResult, *validation.ValidationResult)
ValidateSyncWithAdmissionSubject validates one admitted object across every configured store alias affected by the request.
type ServiceConfig ¶
type ServiceConfig struct {
Pipeline *pipeline.Pipeline
BaseStoreProvider stores.StoreProvider
// FreshStoreProvider supplies API-backed inputs when a cached render rejects admission.
FreshStoreProvider func(context.Context) (stores.StoreProvider, error)
// AcceptedStoreProvider supplies inputs that passed complete output validation.
AcceptedStoreProvider func() (stores.StoreProvider, bool)
// AdmissionStoreProvider excludes only rejected revisions from observed inputs.
AdmissionStoreProvider func(context.Context, stores.StoreProvider) (stores.StoreProvider, bool, error)
// ObservedStoreProvider preserves the reconciliation input revision family.
ObservedStoreProvider func(context.Context, stores.StoreProvider) (stores.StoreProvider, error)
// CurrentFilesProvider pins one published baseline across both renders.
CurrentFilesProvider func() (map[string]string, error)
Logger *slog.Logger
}
ServiceConfig supplies the validation pipeline and its inputs.