packages

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

The packages package contains a library to import, parse, validate and deploy Package Operator packages. Files/OCI/etc. are imported as RawPackages, containing a Package filesystem. RawPackages can be loaded as Package, containing the package filesystem and parsed PackageManifests. Packages and a PackageRenderContext can be rendered into a PackageInstance, ready to be deployed.

Index

Constants

View Source
const (
	// Package manifest filename without file-extension.
	PackageManifestFilename = packagetypes.PackageManifestFilename
	// Package manifest lock filename without file-extension.
	PackageManifestLockFilename = packagetypes.PackageManifestLockFilename
)

Variables

View Source
var (
	// Returns a new namespace-scoped loader for the Package API.
	NewPackageDeployer = packagedeploy.NewPackageDeployer
	// Returns a new cluster-scoped loader for the ClusterPackage API.
	NewClusterPackageDeployer = packagedeploy.NewClusterPackageDeployer
)
View Source
var (
	// Exports the package as OCI (Open Container Image).
	ToOCI = packageexport.ToOCI
	// Exports the given package to an OCI tar under the given name and tags.
	ToOCIFile = packageexport.ToOCIFile
	// Exports the given package by pushing it to an OCI registry.
	ToPushedOCI = packageexport.ToPushedOCI
)
View Source
var (
	// Import a RawPackage from the given folder path.
	FromFolder = packageimport.FromFolder
	// Import a RawPackage from the given FileSystem.
	FromFS = packageimport.FromFS

	// Imports a RawPackage from the given OCI image.
	FromOCI = packageimport.FromOCI
	// Imports a RawPackage from a container image registry.
	FromRegistry = packageimport.FromRegistry

	// Creates a new registry instance to de-duplicate parallel container image pulls.
	NewRegistry = packageimport.NewRegistry
)
View Source
var (
	// Runs a go-template transformer on all .gotmpl files.
	RenderTemplates = packagerender.RenderTemplates
	// Renders all .yml and .yaml files into Kubernetes Objects.
	RenderObjects = packagerender.RenderObjects
	// Renders a ObjectSetTemplateSpec from a PackageInstance to use with ObjectSet and ObjectDeployment APIs.
	RenderObjectSetTemplateSpec = packagerender.RenderObjectSetTemplateSpec
	// Turns a Package and PackageRenderContext into a PackageInstance.
	RenderPackageInstance = packagerender.RenderPackageInstance
)
View Source
var (
	// DefaultStructuralLoader instance with the scheme pre-loaded.
	DefaultStructuralLoader = packagestructure.DefaultStructuralLoader
	// Creates a new StructuralLoaderInstance.
	NewStructuralLoader = packagestructure.NewStructuralLoader
	// Converts the internal version of an PackageManifestLock into it's v1alpha1 representation.
	ToV1Alpha1ManifestLock = packagestructure.ToV1Alpha1ManifestLock
)
View Source
var (
	// PackageManifestGroupKind is the kubernetes schema group kind of a PackageManifest.
	PackageManifestGroupKind = packagetypes.PackageManifestGroupKind
	// PackageManifestLockGroupKind is the kubernetes schema group kind of a PackageManifestLock.
	PackageManifestLockGroupKind = packagetypes.PackageManifestLockGroupKind
)
View Source
var (
	// Validates configuration against the PackageManifests OpenAPISchema.
	ValidatePackageConfiguration = packagemanifestvalidation.ValidatePackageConfiguration
	// Validates and Defaults configuration against the PackageManifests OpenAPISchema so it's ready to be used.
	AdmitPackageConfiguration = packagemanifestvalidation.AdmitPackageConfiguration

	// Validates the PackageManifest.
	ValidatePackageManifest = packagemanifestvalidation.ValidatePackageManifest
	// Validates the PackageManifestLock.
	ValidatePackageManifestLock = packagemanifestvalidation.ValidatePackageManifestLock

	// A default list of object validators that should be executed as a minimum standard.
	DefaultObjectValidators = packagevalidation.DefaultObjectValidators
	// A default list of package validators that should be executed as a minimum standard.
	DefaultPackageValidators = packagevalidation.DefaultPackageValidators

	// ValidateEachObject iterates over each object in a package and runs the given validation function.
	ValidateEachObject = packagevalidation.ValidateEachObject

	// Creates a new TemplateTestValidator instance.
	NewTemplateTestValidator = packagevalidation.NewTemplateTestValidator
)
View Source
var (
	// ErrManifestNotFound indicates that a package manifest was not found at any expected location.
	ErrManifestNotFound = packagetypes.ErrManifestNotFound

	ViolationReasonUnknownGVK                    = packagetypes.ViolationReasonUnknownGVK
	ViolationReasonPackageManifestNotFound       = packagetypes.ViolationReasonPackageManifestNotFound
	ViolationReasonPackageManifestInvalid        = packagetypes.ViolationReasonPackageManifestInvalid
	ViolationReasonPackageManifestDuplicated     = packagetypes.ViolationReasonPackageManifestDuplicated
	ViolationReasonPackageManifestLockInvalid    = packagetypes.ViolationReasonPackageManifestLockInvalid
	ViolationReasonPackageManifestLockDuplicated = packagetypes.ViolationReasonPackageManifestLockDuplicated
	ViolationReasonInvalidYAML                   = packagetypes.ViolationReasonInvalidYAML
	ViolationReasonMissingPhaseAnnotation        = packagetypes.ViolationReasonMissingPhaseAnnotation
	ViolationReasonMissingGVK                    = packagetypes.ViolationReasonMissingGVK
	ViolationReasonDuplicateObject               = packagetypes.ViolationReasonDuplicateObject
	ViolationReasonLabelsInvalid                 = packagetypes.ViolationReasonLabelsInvalid
	ViolationReasonUnsupportedScope              = packagetypes.ViolationReasonUnsupportedScope
	ViolationReasonFixtureMismatch               = packagetypes.ViolationReasonFixtureMismatch
	ViolationReasonComponentsNotEnabled          = packagetypes.ViolationReasonComponentsNotEnabled
	ViolationReasonComponentNotFound             = packagetypes.ViolationReasonComponentNotFound
	ViolationReasonInvalidComponentPath          = packagetypes.ViolationReasonInvalidComponentPath
	ViolationReasonUnknown                       = packagetypes.ViolationReasonUnknown
	ViolationReasonNestedMultiComponentPkg       = packagetypes.ViolationReasonNestedMultiComponentPkg
	ViolationReasonInvalidFileInComponentsDir    = packagetypes.ViolationReasonInvalidFileInComponentsDir
	ViolationReasonKubeconform                   = packagetypes.ViolationReasonKubeconform
)

Functions

This section is empty.

Types

type Files added in v1.9.2

type Files = packagetypes.Files

Files is an in-memory representation of the package FileSystem. It maps file paths to their contents.

type LockfileConsistencyValidator added in v1.10.0

type LockfileConsistencyValidator = packagevalidation.LockfileConsistencyValidator

Validates that the PackageManifestLock is consistent with PackageManifest.

type LockfileDigestLookupValidator added in v1.10.0

type LockfileDigestLookupValidator = packagevalidation.LockfileDigestLookupValidator

Validates that images referenced in the lockfile are still present in the registry.

type ObjectDuplicateValidator added in v1.9.2

type ObjectDuplicateValidator = packagevalidation.ObjectDuplicateValidator

Validates that Objects with the same name/namespace/kind/group must only exist once over all phases. APIVersion does not matter for the check.

type ObjectGVKValidator added in v1.9.2

type ObjectGVKValidator = packagevalidation.ObjectGVKValidator

Validates that every object has Group, Version and Kind set. e.g. apiVersion: and kind:.

type ObjectLabelsValidator added in v1.9.2

type ObjectLabelsValidator = packagevalidation.ObjectLabelsValidator

Validates that all labels are valid.

type ObjectPhaseAnnotationValidator added in v1.9.2

type ObjectPhaseAnnotationValidator = packagevalidation.ObjectPhaseAnnotationValidator

Validates that the PKO phase-annotation is set on all objects.

type ObjectValidator added in v1.9.2

type ObjectValidator = packagetypes.ObjectValidator

ObjectValidator knows how to validate objects within a Package.

type ObjectValidatorList added in v1.9.2

type ObjectValidatorList = packagevalidation.ObjectValidatorList

ObjectValidatorList runs a list of validators and joins all errors.

type Package added in v1.9.2

type Package = packagetypes.Package

Package has passed basic schema/structure admission. Exact output still depends on configuration and the install environment.

type PackageDeployer added in v1.9.2

type PackageDeployer = packagedeploy.PackageDeployer

PackageDeployer loads package contents from file, wraps it into an ObjectDeployment and deploys it.

type PackageInstance added in v1.9.2

type PackageInstance = packagetypes.PackageInstance

PackageInstance is the concrete instance of a package after rendering templates from configuration and environment information.

type PackageManifestValidator added in v1.9.2

type PackageManifestValidator = packagevalidation.PackageManifestValidator

Validates PackageManifests and PackageManifestLock.

type PackageRenderContext added in v1.9.2

type PackageRenderContext = packagetypes.PackageRenderContext

PackageRenderContext contains all data that is needed to render a Package into a PackageInstance.

type PackageScopeValidator added in v1.9.2

type PackageScopeValidator = packagevalidation.PackageScopeValidator

Validates a Package is able to be installed in the given scope.

type PackageValidator added in v1.9.2

type PackageValidator = packagetypes.PackageValidator

PackageValidator knows how to validate Packages.

type PackageValidatorList added in v1.9.2

type PackageValidatorList = packagevalidation.PackageValidatorList

PackageValidatorList runs a list of validators and joins all errors.

type RawPackage added in v1.9.2

type RawPackage = packagetypes.RawPackage

RawPackage right after import. No validation has been performed yet.

type Registry added in v1.9.2

type Registry = packageimport.Registry

Registry de-duplicates multiple parallel container image pulls.

type StructuralLoader added in v1.9.2

type StructuralLoader = packagestructure.StructuralLoader

StructuralLoader parses the raw package structure to produce something usable.

type TemplateTestValidator added in v1.9.2

type TemplateTestValidator = packagevalidation.TemplateTestValidator

Runs the template test suites.

type ValidateEachObjectFn added in v1.9.2

type ValidateEachObjectFn = packagevalidation.ValidateEachObjectFn

Function given to ValidateEachObject to validate individual objects in a package.

type ViolationError added in v1.8.4

type ViolationError = packagetypes.ViolationError

ViolationError describes the reason why and which part of a package is violating sanitation checks.

type ViolationReason added in v1.8.4

type ViolationReason = packagetypes.ViolationReason

ViolationReason describes in short how something violates violating sanitation checks.

Jump to

Keyboard shortcuts

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