builder

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2024 License: AGPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const ProfileMultitenant = `` /* 802-byte string literal not displayed */
View Source
const ProfileOpenShift = `` /* 501-byte string literal not displayed */

Variables

This section is empty.

Functions

func IsCompatibleVersion

func IsCompatibleVersion(fromVer, toVer string) error

IsCompatibleVersion checks if the version upgrade is compatible. It returns an error if a downgrade to a lower minor version is attempted.

func MatchVersion

func MatchVersion(dataDir, semverRange string) (string, error)

MatchVersion returns the latest version dir path that matches the given semver range.

func MkdirTempAbs

func MkdirTempAbs(dir, pattern string) (string, error)

MkdirTempAbs creates a tmp dir and returns the absolute path to the dir. This is required since certain OSes like MacOS create temporary files in e.g. `/private/var`, to which `/var` is a symlink.

func PullArtifact added in v0.5.0

func PullArtifact(ctx context.Context, ociURL, dstDir string) (string, error)

PullArtifact downloads an artifact from an OCI repository and extracts the content of the first tgz layer to the given destination directory. It returns the digest of the artifact.

Types

type ArtifactStorage added in v0.2.0

type ArtifactStorage struct {
	Class string
	Size  string
}

ArtifactStorage represents the source-controller PVC.

type ComponentImage added in v0.1.0

type ComponentImage struct {
	Name       string
	Repository string
	Tag        string
	Digest     string
}

ComponentImage represents a container image used by a component.

func ExtractComponentImages added in v0.1.0

func ExtractComponentImages(srcDir string, opts Options) ([]ComponentImage, error)

ExtractComponentImages reads the source directory and extracts the container images from the components manifests.

func ExtractComponentImagesWithDigest added in v0.5.0

func ExtractComponentImagesWithDigest(srcDir string, opts Options) (images []ComponentImage, err error)

ExtractComponentImagesWithDigest reads the source directory and extracts the container images with digest from the kustomize images patches.

type Options

type Options struct {
	Version                string
	Namespace              string
	Components             []string
	ComponentImages        []ComponentImage
	EventsAddr             string
	Registry               string
	ImagePullSecret        string
	WatchAllNamespaces     bool
	NetworkPolicy          bool
	LogLevel               string
	NotificationController string
	ClusterDomain          string
	TolerationKeys         []string
	Patches                string
	ArtifactStorage        *ArtifactStorage
	Sync                   *Sync
}

Options defines the builder configuration.

func MakeDefaultOptions

func MakeDefaultOptions() Options

MakeDefaultOptions returns the default builder configuration.

type Result

type Result struct {
	Version         string
	Digest          string
	Revision        string
	Objects         []*unstructured.Unstructured
	ComponentImages []ComponentImage
}

Result holds the build result.

func Build

func Build(srcDir, tmpDir string, options Options) (*Result, error)

Build copies the source directory to a temporary directory, generates the required manifests and runs kustomize to build the final resources. The function returns a slice of unstructured objects.

type Sync added in v0.4.0

type Sync struct {
	Kind       string
	URL        string
	Ref        string
	Path       string
	Interval   string
	PullSecret string
}

Jump to

Keyboard shortcuts

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