builder

package
v0.98.2 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package builder is responsible for building fully rendered kubernetes api objects from various input directories. A directory may contain a platform spec or a component spec.

Index

Constants

View Source
const (
	KubernetesObjects = core_v1alpha3.KubernetesObjectsKind
	// Helm is the value of the kind field of holos build output indicating helm
	// values and helm command information.
	Helm = core_v1alpha3.HelmChartKind
	// Skip is the value when the instance should be skipped
	Skip = "Skip"
	// KustomizeBuild is the value of the kind field of cue output indicating
	// holos should process the component using kustomize build to render output.
	KustomizeBuild = v1alpha1.KustomizeBuildKind
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

type Builder struct {
	// contains filtered or unexported fields
}

func New

func New(opts ...Option) *Builder

New returns a new *Builder configured by opts Option.

func (*Builder) Cluster

func (b *Builder) Cluster() string

Cluster returns the cluster name of the component instance being built.

func (*Builder) Discriminate added in v0.98.0

func (b *Builder) Discriminate(ctx context.Context) (tm holos.TypeMeta, err error)

func (*Builder) Platform

func (b *Builder) Platform(ctx context.Context, cfg *client.Config) (*core_v1alpha2.Platform, error)

Platform builds a platform TODO: Refactor, lift up into NewPlatform RunE.

func (*Builder) Run deprecated

func (b *Builder) Run(ctx context.Context, cfg *client.Config) (results []*render.Result, err error)

Run builds the cue entrypoint into zero or more Results. Exactly one CUE package entrypoint is expected in the args slice. The platform config is provided to the entrypoint through a json encoded string tag named platform_config. The resulting cue.Value is unified with all user data files at the path "#UserData".

Deprecated: Use holos.Builder instead

func (*Builder) Unify deprecated added in v0.91.0

func (b *Builder) Unify(ctx context.Context, cfg *client.Config) (bd holos.BuildData, err error)

Unify returns a cue.Value representing the kind of build holos is meant to execute. This function unifies a cue package entrypoint with platform.config.json and user data json files located recursively within the userdata directory at the cue module root.

Deprecated: use Discriminate instead.

type Option

type Option func(*config)

An Option configures a Builder

func Cluster

func Cluster(name string) Option

Cluster configures the cluster name for the holos component instance.

func Entrypoints

func Entrypoints(args []string) Option

Entrypoints configures the leaf directories Builder builds.

func Tags added in v0.96.0

func Tags(tags []string) Option

Tags configures tags to pass to cue when building the instance.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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