resources

package
v0.0.0-...-b6b2d9b Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DescribeErrorCases

func DescribeErrorCases[T core_model.Resource](generator func() T, cases ...TableEntry)

DescribeErrorCases creates a Ginkgo table test for the given entries, where each entry is a ResourceValidationCase that contains an invalid resource YAML and the corresponding validation error.

func DescribeValidCases

func DescribeValidCases[T core_model.Resource](generator func() T, cases ...TableEntry)

DescribeValidCases creates a Ginkgo table test for the given entries, where each entry is a valid YAML resource. It ensures that each entry can be successfully validated.

func ErrorCase

func ErrorCase(description string, err validators.Violation, yaml string) TableEntry

ErrorCase is a helper that generates a table entry for DescribeErrorCases.

func ErrorCases

func ErrorCases(description string, errs []validators.Violation, yaml string) TableEntry

func Global

func Global() registry.TypeRegistry

Types

type ResourceGenerator

type ResourceGenerator interface {
	New() core_model.Resource
}

ResourceGenerator creates a resource of a pre-defined type.

type ResourceValidationCase

type ResourceValidationCase struct {
	Resource   string
	Violations []validators.Violation
}

ResourceValidationCase captures a resource YAML and any corresponding validation error.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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