validation

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2018 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package validation provides validation for Bundles

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JoinErrors

func JoinErrors(errs []error) error

JoinErrors joins a collection of errors together for convenience, returning nil if there were no errors in the slice.

Types

type BundleValidator

type BundleValidator struct {
	Bundle *bpb.ClusterBundle
}

BundleValidator validates bundles.

func NewBundleValidator

func NewBundleValidator(b *bpb.ClusterBundle) *BundleValidator

NewBundleValidator creates a new Bundle Validator

func (*BundleValidator) Validate

func (b *BundleValidator) Validate() []error

Validate validates Bundles, providing as many errors as it can.

type CustomResourceOptions

type CustomResourceOptions struct {
	// Should the validation be strict? In other words, if a Custom Resource is
	// not specified in the Bundle via a CRD and Strict is enabled, it will
	// result in an error.
	Strict bool
}

CustomResourceOptions contains options for custom resource validation.

type CustomResourceValidator

type CustomResourceValidator struct {
	// Bundle represents a Cluster Bundle
	Bundle *bpb.ClusterBundle

	// Options for validation.
	Options *CustomResourceOptions
}

CustomResourceValidator validates custom resources for Bundle customization.

func NewCustomResourceValidator

func NewCustomResourceValidator(bundle *bpb.ClusterBundle, options *CustomResourceOptions) (*CustomResourceValidator, error)

NewCustomResourceValidator creates a new CustomResourceValidator.

func (*CustomResourceValidator) Validate

func (c *CustomResourceValidator) Validate(customResource interface{}) error

Validate checks whether a custom resource conforms to the spec given in the CRD.

Jump to

Keyboard shortcuts

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