Documentation ¶
Index ¶
- Variables
- func TransformEachObject(ctx context.Context, packageContent *packagecontent.Package, ...) error
- func ValidateEachObject(ctx context.Context, pkg *packagecontent.Package, ...) error
- func WithDefaults(l *Loader)
- type FilesTransformer
- type Loader
- type ObjectDuplicateValidator
- type ObjectGVKValidator
- type ObjectLabelsValidator
- type ObjectPhaseAnnotationValidator
- type Option
- type PackageAndFilesValidator
- type PackageFileTemplateContext
- type PackageFileTemplateTransformer
- type PackageScopeValidator
- type PackageTransformer
- type TemplateTestValidator
- type TransformEachObjectFn
- type Transformer
- type ValidateEachObjectFn
- type Validator
- type ValidatorList
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrDuplicateConfig = errors.New("config raw and object fields are both set")
Functions ¶
func TransformEachObject ¶
func TransformEachObject(ctx context.Context, packageContent *packagecontent.Package, transform TransformEachObjectFn) error
func ValidateEachObject ¶
func ValidateEachObject(ctx context.Context, pkg *packagecontent.Package, validate ValidateEachObjectFn) error
func WithDefaults ¶
func WithDefaults(l *Loader)
Types ¶
type FilesTransformer ¶
type FilesTransformer interface {
TransformPackageFiles(ctx context.Context, files packagecontent.Files) error
}
type ObjectDuplicateValidator ¶ added in v1.7.0
type ObjectDuplicateValidator struct{}
func (*ObjectDuplicateValidator) ValidatePackage ¶ added in v1.7.0
func (v *ObjectDuplicateValidator) ValidatePackage(_ context.Context, packageContent *packagecontent.Package) error
Objects with the same name/namespace/kind/group must only exist once over all phases. APIVersion does not matter for the check.
type ObjectGVKValidator ¶
type ObjectGVKValidator struct{}
func (*ObjectGVKValidator) ValidatePackage ¶
func (v *ObjectGVKValidator) ValidatePackage(ctx context.Context, packageContent *packagecontent.Package) error
type ObjectLabelsValidator ¶
type ObjectLabelsValidator struct{}
func (*ObjectLabelsValidator) ValidatePackage ¶
func (v *ObjectLabelsValidator) ValidatePackage(ctx context.Context, packageContent *packagecontent.Package) error
type ObjectPhaseAnnotationValidator ¶
type ObjectPhaseAnnotationValidator struct{}
func (*ObjectPhaseAnnotationValidator) ValidatePackage ¶
func (v *ObjectPhaseAnnotationValidator) ValidatePackage(ctx context.Context, packageContent *packagecontent.Package) error
type Option ¶
type Option func(l *Loader)
func WithFilesTransformers ¶
func WithFilesTransformers(transformers ...FilesTransformer) Option
func WithPackageAndFilesValidators ¶
func WithPackageAndFilesValidators(validators ...PackageAndFilesValidator) Option
func WithTransformers ¶
func WithTransformers(transformers ...Transformer) Option
func WithValidators ¶
type PackageAndFilesValidator ¶
type PackageAndFilesValidator interface {
ValidatePackageAndFiles(ctx context.Context, pkg *packagecontent.Package, files packagecontent.Files) error
}
type PackageFileTemplateContext ¶ added in v1.4.0
type PackageFileTemplateContext struct { Package manifestsv1alpha1.TemplateContextPackage `json:"package"` Config map[string]interface{} `json:"config"` Images map[string]string `json:"images"` Environment manifestsv1alpha1.PackageEnvironment `json:"environment"` }
type PackageFileTemplateTransformer ¶ added in v1.4.0
type PackageFileTemplateTransformer struct {
// contains filtered or unexported fields
}
Runs a go-template transformer on all .yml or .yaml files.
func NewTemplateTransformer ¶
func NewTemplateTransformer(tmplCtx PackageFileTemplateContext) (*PackageFileTemplateTransformer, error)
func (*PackageFileTemplateTransformer) TransformPackageFiles ¶ added in v1.4.0
func (t *PackageFileTemplateTransformer) TransformPackageFiles(ctx context.Context, fileMap packagecontent.Files) error
type PackageScopeValidator ¶
type PackageScopeValidator manifestsv1alpha1.PackageManifestScope
func (PackageScopeValidator) ValidatePackage ¶
func (scope PackageScopeValidator) ValidatePackage(_ context.Context, packageContent *packagecontent.Package) error
type PackageTransformer ¶ added in v1.4.0
func (*PackageTransformer) TransformPackage ¶ added in v1.4.0
func (t *PackageTransformer) TransformPackage(ctx context.Context, packageContent *packagecontent.Package) error
type TemplateTestValidator ¶
type TemplateTestValidator struct {
// contains filtered or unexported fields
}
func NewTemplateTestValidator ¶
func NewTemplateTestValidator( scheme *runtime.Scheme, fixturesFolderPath string, ) *TemplateTestValidator
func (TemplateTestValidator) ValidatePackageAndFiles ¶
func (v TemplateTestValidator) ValidatePackageAndFiles( ctx context.Context, pkg *packagecontent.Package, fileMap packagecontent.Files, ) error
type TransformEachObjectFn ¶
type TransformEachObjectFn func( ctx context.Context, path string, index int, packageManifest *manifestsv1alpha1.PackageManifest, obj *unstructured.Unstructured) error
type Transformer ¶
type Transformer interface {
TransformPackage(ctx context.Context, pkg *packagecontent.Package) error
}
type ValidateEachObjectFn ¶
type ValidateEachObjectFn func(ctx context.Context, path string, index int, obj unstructured.Unstructured) error
type Validator ¶
type Validator interface {
ValidatePackage(ctx context.Context, pkg *packagecontent.Package) error
}
type ValidatorList ¶
type ValidatorList []Validator
Runs a list of Validator over the given content.
func (ValidatorList) ValidatePackage ¶
func (l ValidatorList) ValidatePackage(ctx context.Context, pkg *packagecontent.Package) error
Click to show internal directories.
Click to hide internal directories.