Back to

Package validation

Latest Go to latest

The latest major version is .

Published: Oct 16, 2020 | License: Apache-2.0 | Module:



const (
	InvalidSnapshotErrMessage = "validation is disabled due to an invalid resource which has been written to storage. " +
		"Please correct any Rejected resources to re-enable validation."


var (
	NotReadyErr = errors.Errorf("validation is not yet available. Waiting for first snapshot")

	RouteTableDeleteErr = func(parentVirtualServices, parentRouteTables []core.ResourceRef) error {
		return errors.Errorf("" /* 183 byte string literal not displayed */, parentVirtualServices, parentRouteTables)
	VirtualServiceDeleteErr = func(parentGateways []core.ResourceRef) error {
		return errors.Errorf("" /* 146 byte string literal not displayed */, parentGateways)

	WrappedUnmarshalErr = func(err error) error {
		return errors.Wrapf(err, unmarshalErrMsg)

func MakeNotificationChannel

func MakeNotificationChannel(ctx context.Context, client validation.ProxyValidationServiceClient) (<-chan struct{}, error)

func NewConnectionRefreshingValidationClient

func NewConnectionRefreshingValidationClient(constructValidationClient func() (validation.ProxyValidationServiceClient, error)) (*connectionRefreshingValidationClient, error)

func NewValidator

func NewValidator(cfg ValidatorConfig) *validator

type ClientConstructor

type ClientConstructor func() (client validation.ProxyValidationServiceClient, e error)

func RetryOnUnavailableClientConstructor

func RetryOnUnavailableClientConstructor(ctx context.Context, serverAddress string) ClientConstructor

the constructor returned here is not threadsafe; call from a lock

type ProxyReports

type ProxyReports map[*gloov1.Proxy]*validation.ProxyReport

type Validator

type Validator interface {
	ValidateList(ctx context.Context, ul *unstructured.UnstructuredList, dryRun bool) (ProxyReports, *multierror.Error)
	ValidateGateway(ctx context.Context, gw *v1.Gateway, dryRun bool) (ProxyReports, error)
	ValidateVirtualService(ctx context.Context, vs *v1.VirtualService, dryRun bool) (ProxyReports, error)
	ValidateDeleteVirtualService(ctx context.Context, vs core.ResourceRef, dryRun bool) error
	ValidateRouteTable(ctx context.Context, rt *v1.RouteTable, dryRun bool) (ProxyReports, error)
	ValidateDeleteRouteTable(ctx context.Context, rt core.ResourceRef, dryRun bool) error

type ValidatorConfig

type ValidatorConfig struct {
	// contains filtered or unexported fields

func NewValidatorConfig

func NewValidatorConfig(translator translator.Translator, validationClient validation.ProxyValidationServiceClient, writeNamespace string, ignoreProxyValidationFailure, allowWarnings bool) ValidatorConfig

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier