project

package
v2.3.1 Latest Latest
Warning

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

Go to latest
Published: May 25, 2026 License: Apache-2.0 Imports: 53 Imported by: 0

Documentation

Overview

Package project contains logic for building Crossplane projects.

Index

Constants

View Source
const (
	// ConfigurationTag is the tag used for the configuration image in the built
	// package.
	ConfigurationTag = "configuration"
)

Variables

This section is empty.

Functions

func AnnotateImage

func AnnotateImage(i v1.Image) (v1.Image, error)

AnnotateImage reads in the layers of the given v1.Image and annotates the xpkg layers with their corresponding annotations, returning a new v1.Image containing the annotation details.

func ApplyResources

func ApplyResources(ctx context.Context, cl client.Client, resources []runtime.RawExtension) error

ApplyResources installs arbitrary resources to the target control plane.

func BuildIndex

func BuildIndex(imgs ...v1.Image) (v1.ImageIndex, []v1.Image, error)

BuildIndex applies annotations to each of the given images and then generates an index for them. The annotated images are returned so that a caller can push them before pushing the index, since the passed images may not match the annotated images.

func EmbeddedFunctionsToDaemon

func EmbeddedFunctionsToDaemon(ctx context.Context, imageMap ImageTagMap) ([]pkgv1.Function, error)

EmbeddedFunctionsToDaemon loads each compatible image in the ImageTagMap into the Docker daemon and returns Function manifests.

func InstallConfiguration

func InstallConfiguration(ctx context.Context, cl client.Client, cfgName string, tag name.Tag, logger logging.Logger) error

InstallConfiguration installs a Configuration package on the target control plane and waits for it and all its dependencies to become healthy.

func LoadFunctionDependencies

func LoadFunctionDependencies(resolver Resolver, proj *devv1alpha1.Project) ([]pkgv1.Function, error)

LoadFunctionDependencies loads function manifests from a project's dependencies, resolving version constraints using the provided resolver.

func SortImages

func SortImages(imgMap ImageTagMap, repo string) (cfgImage v1.Image, fnImages map[name.Repository][]v1.Image, err error)

SortImages analyzes an image map produced by the project builder and picks out the configuration and function images from it. The function images are grouped together by function, so that multi-arch indexes can be produced based on the returned map.

Types

type BuildOption

type BuildOption func(o *buildOptions)

BuildOption configures a build.

func BuildWithEventChannel

func BuildWithEventChannel(ch async.EventChannel) BuildOption

BuildWithEventChannel provides a channel for sending progress events during the build.

func BuildWithLogger

func BuildWithLogger(l logging.Logger) BuildOption

BuildWithLogger provides a logger for progress updates during the build.

func BuildWithProjectBasePath

func BuildWithProjectBasePath(path string) BuildOption

BuildWithProjectBasePath sets the real on-disk base path of the project. This path will be used for following symlinks. If not set it will be inferred from the project FS, which works only when the project FS is an afero.BasePathFs.

type Builder

type Builder interface {
	// Build builds a project into a set of packages. It returns a map
	// containing images that were built from the project. The returned map will
	// always include one image with the ConfigurationTag, which is the
	// configuration package built from the APIs found in the project.
	Build(ctx context.Context, project *devv1alpha1.Project, projectFS afero.Fs, opts ...BuildOption) (ImageTagMap, error)
}

Builder is able to build a project into a set of packages.

func NewBuilder

func NewBuilder(opts ...BuilderOption) Builder

NewBuilder returns a new project builder.

type BuilderOption

type BuilderOption func(b *realBuilder)

BuilderOption configures a builder.

func BuildWithDependencyManager

func BuildWithDependencyManager(m *dependency.Manager) BuilderOption

BuildWithDependencyManager sets the dependency manager that will be used to ensure schemas are present for the project's declared dependencies before building functions.

func BuildWithFunctionIdentifier

func BuildWithFunctionIdentifier(i functions.Identifier) BuilderOption

BuildWithFunctionIdentifier sets the function identifier that will be used to find function builders for any functions in a project.

func BuildWithMaxConcurrency

func BuildWithMaxConcurrency(n uint) BuilderOption

BuildWithMaxConcurrency sets the maximum concurrency for building embedded functions.

func BuildWithSchemaManager

func BuildWithSchemaManager(m *manager.Manager) BuilderOption

BuildWithSchemaManager sets the schema manager that will be used to generate language-specific schemas from XRDs before building functions.

type ImageTagMap

type ImageTagMap map[name.Tag]v1.Image

ImageTagMap is a map of container image tags to images.

type PushOption

type PushOption func(o *pushOptions)

PushOption configures a push.

func PushWithEventChannel

func PushWithEventChannel(ch async.EventChannel) PushOption

PushWithEventChannel provides a channel to which progress updates will be written during the push. It is the caller's responsibility to manage the lifecycle of this channel.

func PushWithTag

func PushWithTag(tag string) PushOption

PushWithTag sets the tag to be used for the pushed packages.

type Pusher

type Pusher interface {
	// Push pushes a set of packages built from a project to a registry and
	// returns the tag to which the configuration package was pushed.
	Push(ctx context.Context, project *devv1alpha1.Project, imgMap ImageTagMap, opts ...PushOption) (name.Tag, error)
}

Pusher is able to push a set of packages built from a project to a registry.

func NewPusher

func NewPusher(opts ...PusherOption) Pusher

NewPusher returns a new project Pusher.

type PusherOption

type PusherOption func(p *realPusher)

PusherOption configures a pusher.

func PushWithAuthKeychain

func PushWithAuthKeychain(kc authn.Keychain) PusherOption

PushWithAuthKeychain provides a registry credential source to be used by the push.

func PushWithMaxConcurrency

func PushWithMaxConcurrency(n uint) PusherOption

PushWithMaxConcurrency sets the maximum concurrency for pushing packages.

func PushWithTransport

func PushWithTransport(t http.RoundTripper) PusherOption

PushWithTransport sets the HTTP transport to be used by the pusher.

type Resolver

type Resolver interface {
	ResolveRef(ref string) (name.Reference, error)
}

A Resolver resolves a CLI-style package reference to an OCI reference.

Directories

Path Synopsis
Package certs generates certificates for the local dev registry.
Package certs generates certificates for the local dev registry.
Package controlplane manages local development control planes.
Package controlplane manages local development control planes.
Package functions contains functions for building embedded functions.
Package functions contains functions for building embedded functions.
Package helm implements a helm chart installer.
Package helm implements a helm chart installer.
Package projectfile reads and writes Crossplane project files.
Package projectfile reads and writes Crossplane project files.

Jump to

Keyboard shortcuts

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