krusty

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2019 License: Apache-2.0 Imports: 12 Imported by: 140

Documentation

Overview

Package krusty holds a very high level API to kustomize. The functions here should be similar to the CLI api.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Kustomizer

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

Kustomizer performs kustomizations. It's meant to behave similarly to the kustomize CLI, and can be used instead of performing an exec to a kustomize CLI subprocess. To use, load a filesystem with kustomization files (any number of overlays and bases), then make a Kustomizer injected with the given fileystem, then call Build.

func MakeKustomizer

func MakeKustomizer(fSys filesys.FileSystem, o *Options) *Kustomizer

MakeKustomizer returns an instance of Kustomizer.

func (*Kustomizer) Run

func (b *Kustomizer) Run(path string) (resmap.ResMap, error)

Run performs a kustomization.

It uses its internal filesystem reference to read the file at the given path argument, interpret it as a kustomization.yaml file, perform the kustomization it represents, and return the resulting resources.

Any files referenced by the kustomization must be present in the internal filesystem. One may call Run any number of times, on any number of internal paths (e.g. the filesystem may contain multiple overlays, and Run can be called on each of them).

type Options

type Options struct {
	// When true, sort the resources before emitting them,
	// per a particular sort order.  When false, don't do the
	// sort, and instead respect the depth-first resource input
	// order as specified by the kustomization file(s).
	DoLegacyResourceSort bool

	// Restrictions on what can be loaded from the file system.
	// See type definition.
	LoadRestrictions types.LoadRestrictions

	// Create an inventory object for pruning.
	DoPrune bool

	// Options related to kustomize plugins.
	PluginConfig *types.PluginConfig
}

Options holds high-level kustomize configuration options, e.g. are plugins enabled, should the loader be restricted to the kustomization root, etc.

func MakeDefaultOptions

func MakeDefaultOptions() *Options

MakeDefaultOptions returns a default instance of Options.

Jump to

Keyboard shortcuts

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