build

package
v0.41.2 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2023 License: Apache-2.0 Imports: 41 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

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

Builder builds yaml manifests It retrieves the kustomization object from the k8s cluster and overlays the manifests with the resources specified in the resourcesPath

func NewBuilder

func NewBuilder(name, resources string, opts ...BuilderOptionFunc) (*Builder, error)

NewBuilder returns a new Builder It takes a kustomization name and a path to the resources It also takes a list of BuilderOptionFunc to configure the builder One of the options is WithClientConfig, that must be provided for the builder to work with the k8s cluster One other option is WithKustomizationFile, that must be provided for the builder to work with a local kustomization file. If the kustomization file is not provided, the builder will try to retrieve the kustomization object from the k8s cluster. WithDryRun sets the dry-run flag, and needs to be provided if the builder is used for a dry-run. This flag works in conjunction with WithKustomizationFile, because the kustomization object is not retrieved from the k8s cluster when the dry-run flag is set.

func (*Builder) Build

func (b *Builder) Build() ([]byte, error)

Build builds the yaml manifests from the kustomization object and overlays the manifests with the resources specified in the resourcesPath It expects a kustomization.yaml file in the resourcesPath, and it will generate a kustomization.yaml file if it doesn't exist

func (*Builder) Cancel

func (b *Builder) Cancel() error

Cancel cancels the build It restores a clean reprository

func (*Builder) Diff

func (b *Builder) Diff() (string, bool, error)

func (*Builder) Manager

func (b *Builder) Manager() (*ssa.ResourceManager, error)

type BuilderOptionFunc

type BuilderOptionFunc func(b *Builder) error

BuilderOptionFunc is a function that configures a Builder

func WithClientConfig added in v0.37.0

func WithClientConfig(rcg *genericclioptions.ConfigFlags, clientOpts *runclient.Options) BuilderOptionFunc

WithClientConfig sets the client configuration

func WithDryRun added in v0.37.0

func WithDryRun(dryRun bool) BuilderOptionFunc

WithDryRun sets the dry-run flag

func WithKustomizationFile added in v0.29.0

func WithKustomizationFile(file string) BuilderOptionFunc

WithKustomizationFile sets the kustomization file

func WithNamespace added in v0.38.0

func WithNamespace(namespace string) BuilderOptionFunc

WithNamespace sets the namespace

func WithProgressBar added in v0.27.1

func WithProgressBar() BuilderOptionFunc

func WithTimeout

func WithTimeout(timeout time.Duration) BuilderOptionFunc

WithTimeout sets the timeout for the builder

Jump to

Keyboard shortcuts

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