Documentation ¶
Overview ¶
Package validate implements offline schema validation of Crossplane resources.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SchemaValidation ¶
func SchemaValidation(resources []*unstructured.Unstructured, crds []*extv1.CustomResourceDefinition, skipSuccessLogs bool, w io.Writer) error
SchemaValidation validates the resources against the given CRDs.
Types ¶
type Cache ¶
type Cache interface { Store(schemas [][]byte, path string) error Flush() error Init() error Load() ([]*unstructured.Unstructured, error) Exists(image string) (string, error) }
Cache defines an interface for caching schemas.
type Cmd ¶
type Cmd struct { // Arguments. Extensions string `arg:"" help:"Extensions source which can be a file, directory, or '-' for standard input."` Resources string `arg:"" help:"Resources source which can be a file, directory, or '-' for standard input."` // Flags. Keep them in alphabetical order. CacheDir string `` /* 149-byte string literal not displayed */ CleanCache bool `help:"Clean the cache directory before downloading package schemas."` SkipSuccessResults bool `help:"Skip printing success results."` // contains filtered or unexported fields }
Cmd arguments and flags for render subcommand.
type FileLoader ¶
type FileLoader struct {
// contains filtered or unexported fields
}
FileLoader implements the Loader interface for reading from a file and converting input to unstructured objects.
func (*FileLoader) Load ¶
func (f *FileLoader) Load() ([]*unstructured.Unstructured, error)
Load reads the contents from a file.
type FolderLoader ¶
type FolderLoader struct {
// contains filtered or unexported fields
}
FolderLoader implements the Loader interface for reading from a folder.
func (*FolderLoader) Load ¶
func (f *FolderLoader) Load() ([]*unstructured.Unstructured, error)
Load reads the contents from all files in a folder.
type ImageFetcher ¶
ImageFetcher defines an interface for fetching images.
type Loader ¶
type Loader interface {
Load() ([]*unstructured.Unstructured, error)
}
Loader interface defines the contract for different input sources.
type LocalCache ¶
type LocalCache struct {
// contains filtered or unexported fields
}
LocalCache implements the Cache interface.
func (*LocalCache) Exists ¶
func (c *LocalCache) Exists(image string) (string, error)
Exists checks if the cache contains the image and returns the path if it doesn't exist.
func (*LocalCache) Init ¶
func (c *LocalCache) Init() error
Init creates the cache directory if it doesn't exist.
func (*LocalCache) Load ¶
func (c *LocalCache) Load() ([]*unstructured.Unstructured, error)
Load loads the schemas from the cache directory.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager defines a Manager for preparing Crossplane packages for validation.
func NewManager ¶
NewManager returns a new Manager.
func (*Manager) CacheAndLoad ¶
CacheAndLoad finds and caches dependencies and loads them as CRDs.
func (*Manager) PrepExtensions ¶
func (m *Manager) PrepExtensions(extensions []*unstructured.Unstructured) error
PrepExtensions converts the unstructured XRDs/CRDs to CRDs and extract package images to add as a dependency.
type StdinLoader ¶
type StdinLoader struct{}
StdinLoader implements the Loader interface for reading from stdin.
func (*StdinLoader) Load ¶
func (s *StdinLoader) Load() ([]*unstructured.Unstructured, error)
Load reads the contents from stdin.