xpkg

package
v0.5.0-rc.0 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2021 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Overview

Package xpkg contains utilities for building and linting UXP packages.

Index

Constants

View Source
const (
	// MetaFile is the name of a Crossplane package metadata file.
	MetaFile string = "crossplane.yaml"

	// StreamFile is the name of the file in a Crossplane package image that
	// contains its YAML stream.
	StreamFile string = "package.yaml"

	// StreamFileMode determines the permissions on the stream file.
	StreamFileMode os.FileMode = 0o644

	// XpkgExtension is the extension for compiled Crossplane packages.
	XpkgExtension string = ".xpkg"

	// XpkgMatchPattern is the match pattern for identifying compiled Crossplane packages.
	XpkgMatchPattern string = "*" + XpkgExtension
)

Variables

This section is empty.

Functions

func Build

Build compiles a Crossplane package from an on-disk package.

func BuildMetaScheme

func BuildMetaScheme() (*runtime.Scheme, error)

BuildMetaScheme builds the default scheme used for identifying metadata in a Crossplane package.

func BuildObjectScheme

func BuildObjectScheme() (*runtime.Scheme, error)

BuildObjectScheme builds the default scheme used for identifying objects in a Crossplane package.

func BuildPath

func BuildPath(path, name string) string

BuildPath builds a path for a compiled Crossplane package. If file name has extension it will be replaced.

func FindXpkgInDir

func FindXpkgInDir(fs afero.Fs, root string) (string, error)

FindXpkgInDir finds compiled Crossplane packages in a directory.

func FriendlyID

func FriendlyID(name, hash string) string

FriendlyID builds a valid DNS label string made up of the name of a package and its image digest.

func IsCRD

func IsCRD(o runtime.Object) error

IsCRD checks that an object is a CustomResourceDefinition.

func IsComposition

func IsComposition(o runtime.Object) error

IsComposition checks that an object is a Composition.

func IsConfiguration

func IsConfiguration(o runtime.Object) error

IsConfiguration checks that an object is a Configuration meta type.

func IsProvider

func IsProvider(o runtime.Object) error

IsProvider checks that an object is a Provider meta type.

func IsXRD

func IsXRD(o runtime.Object) error

IsXRD checks that an object is a CompositeResourceDefinition.

func NewConfigurationLinter

func NewConfigurationLinter() parser.Linter

NewConfigurationLinter is a convenience function for creating a package linter for configurations.

func NewProviderLinter

func NewProviderLinter() parser.Linter

NewProviderLinter is a convenience function for creating a package linter for providers.

func OneMeta

func OneMeta(pkg *parser.Package) error

OneMeta checks that there is only one meta object in the package.

func PackageValidSemver

func PackageValidSemver(o runtime.Object) error

PackageValidSemver checks that the package uses valid semver ranges.

func ToDNSLabel

func ToDNSLabel(s string) string

ToDNSLabel converts the string to a valid DNS label.

func TryConvert

func TryConvert(obj runtime.Object, candidates ...conversion.Hub) (runtime.Object, bool)

TryConvert converts the supplied object to the first supplied candidate that does not return an error. Returns the converted object and true when conversion succeeds, or the original object and false if it does not.

func TryConvertToPkg

func TryConvertToPkg(obj runtime.Object, candidates ...conversion.Hub) (pkgmetav1.Pkg, bool)

TryConvertToPkg converts the supplied object to a pkgmeta.Pkg, if possible.

Types

This section is empty.

Jump to

Keyboard shortcuts

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