Documentation ¶
Index ¶
- Constants
- Variables
- func MakeNotificationChannel(ctx context.Context, client validation.GlooValidationServiceClient) (<-chan struct{}, error)
- func NewValidator(cfg ValidatorConfig) *validator
- func UnmarshalResource(kubeJson []byte, resource resources.Resource) error
- type GlooValidatorFunc
- type ProxyReports
- type Reports
- type UpstreamReports
- type Validator
- type ValidatorConfig
Constants ¶
View Source
const GatewayGroup = "gateway.solo.io"
View Source
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."
)
Variables ¶
View Source
var ( NotReadyErr = errors.Errorf("validation is not yet available. Waiting for first snapshot") HasNotReceivedFirstSync = eris.New("proxy validation called before the validation server received its first sync of resources") WrappedUnmarshalErr = func(err error) error { return errors.Wrapf(err, unmarshalErrMsg) } GlooValidationResponseLengthError = func(reports []*gloovalidation.GlooValidationReport) error { return errors.Errorf("Expected Gloo validation response to contain 1 report, but contained %d", len(reports)) } )
Functions ¶
func MakeNotificationChannel ¶ added in v1.2.8
func MakeNotificationChannel(ctx context.Context, client validation.GlooValidationServiceClient) (<-chan struct{}, error)
func NewValidator ¶
func NewValidator(cfg ValidatorConfig) *validator
func UnmarshalResource ¶ added in v1.13.0
UnmarshalResource is the same as the solo-kit pkg/utils/protoutils.Unmarshal() except it does not set the status of the resource since validation does not write the resources, this is ok. Validation will only store the state of a resource to the copy of the snapshot.
Types ¶
type GlooValidatorFunc ¶ added in v1.13.0
type GlooValidatorFunc = func(ctx context.Context, proxy *gloov1.Proxy, resource resources.Resource, delete bool, ) ([]*gloovalidation.GlooValidationReport, error)
type ProxyReports ¶ added in v0.20.3
type ProxyReports []*validation.ProxyReport
type Reports ¶ added in v1.9.0
type Reports struct { Proxies []*gloov1.Proxy ProxyReports *ProxyReports }
func (*Reports) GetProxies ¶ added in v1.9.0
type UpstreamReports ¶ added in v1.9.0
type UpstreamReports []*validation.ResourceReport
type Validator ¶
type Validator interface { gloov1snap.ApiSyncer // ValidateList will validate a list of resources ValidateList(ctx context.Context, ul *unstructured.UnstructuredList, dryRun bool) (*Reports, *multierror.Error) // ValidateModifiedGvk validate the creation or update of a resource. ValidateModifiedGvk(ctx context.Context, gvk schema.GroupVersionKind, resource resources.Resource, dryRun bool) (*Reports, error) // ValidateDeletedGvk validate the deletion of a resource. ValidateDeletedGvk(ctx context.Context, gvk schema.GroupVersionKind, resource resources.Resource, dryRun bool) error }
type ValidatorConfig ¶ added in v0.20.3
type ValidatorConfig struct { Translator translator.Translator GlooValidator GlooValidatorFunc ExtensionValidator syncerValidation.Validator AllowWarnings bool }
Click to show internal directories.
Click to hide internal directories.