packages

package
v1.8.2 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ViolationReasonPackageManifestNotFound       = "PackageManifest not found"
	ViolationReasonPackageManifestUnknownGVK     = "PackageManifest unknown GVK"
	ViolationReasonPackageManifestConversion     = "PackageManifest conversion"
	ViolationReasonPackageManifestInvalid        = "PackageManifest invalid"
	ViolationReasonPackageManifestDuplicated     = "PackageManifest present multiple times"
	ViolationReasonPackageManifestLockUnknownGVK = "PackageManifestLock unknown GVK"
	ViolationReasonPackageManifestLockConversion = "PackageManifestLock conversion"
	ViolationReasonPackageManifestLockInvalid    = "PackageManifestLock invalid"
	ViolationReasonPackageManifestLockDuplicated = "PackageManifestLock present multiple times"
	ViolationReasonInvalidYAML                   = "Invalid YAML"
	ViolationReasonMissingPhaseAnnotation        = "Missing " + manifestsv1alpha1.PackagePhaseAnnotation + " Annotation"
	ViolationReasonMissingGVK                    = "GroupVersionKind not set"
	ViolationDuplicateObject                     = "Duplicate Object"
	ViolationReasonLabelsInvalid                 = "Labels invalid"
	ViolationReasonUnsupportedScope              = "Package unsupported scope"
	ViolationReasonFixtureMismatch               = "File mismatch against fixture"
)
View Source
const (
	// Default location for the PackageManifest file.
	PackageManifestFile = "manifest.yaml"

	// Default location for the PackageManifestLock file.
	PackageManifestLockFile = "manifest.lock.yaml"

	// Files suffix for all go template files that need pre-processing.
	// .gotmpl is the suffix that is being used by the go language server gopls.
	// https://go-review.googlesource.com/c/tools/+/363360/7/gopls/doc/features.md#29
	TemplateFileSuffix = ".gotmpl"

	// ImageFilePrefixPath defines under which subfolder files within a package container should be located.
	ImageFilePrefixPath = "package"
)

Variables

View Source
var (
	// PackageManifestFileNames to probe for.
	PackageManifestFileNames = []string{"manifest.yaml", "manifest.yml"}
	PackageManifestGroupKind = schema.GroupKind{Group: manifestsv1alpha1.GroupVersion.Group, Kind: "PackageManifest"}

	PackageManifestLockFileNames = []string{"manifest.lock.yaml"}
	PackageManifestLockGroupKind = schema.GroupKind{Group: manifestsv1alpha1.GroupVersion.Group, Kind: "PackageManifestLock"}
)

Functions

func IsManifestFile

func IsManifestFile(path string) bool

Is the it the manifest file.

func IsManifestLockFile

func IsManifestLockFile(path string) bool

Is the it the manifest file.

func IsTemplateFile

func IsTemplateFile(path string) bool

Is path suffixed by .gotmpl.

func IsYAMLFile

func IsYAMLFile(path string) bool

Is path suffixed by .yml or .yaml.

func NewInvalidAggregate

func NewInvalidAggregate(errorList ...error) error

func StripTemplateSuffix

func StripTemplateSuffix(path string) string

StripTemplateSuffix removes a .gotmpl suffix from a string if present.

Types

type InvalidError

type InvalidError struct {
	Violations []Violation
}

func NewInvalidError

func NewInvalidError(violations ...Violation) *InvalidError

func (*InvalidError) Error

func (e *InvalidError) Error() string

type Violation

type Violation struct {
	Reason  string
	Details string

	Location *ViolationLocation
}

func (Violation) String

func (v Violation) String() string

type ViolationLocation

type ViolationLocation struct {
	Path          string
	DocumentIndex *int
}

func (*ViolationLocation) String

func (l *ViolationLocation) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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