build

package
v2.2.3 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2024 License: Apache-2.0 Imports: 42 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() ([]*unstructured.Unstructured, 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

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

WithClientConfig sets the client configuration

func WithDryRun

func WithDryRun(dryRun bool) BuilderOptionFunc

WithDryRun sets the dry-run flag

func WithIgnore

func WithIgnore(ignore []string) BuilderOptionFunc

WithIgnore sets ignore field

func WithKustomizationFile

func WithKustomizationFile(file string) BuilderOptionFunc

WithKustomizationFile sets the kustomization file

func WithNamespace

func WithNamespace(namespace string) BuilderOptionFunc

WithNamespace sets the namespace

func WithProgressBar

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