krusty

package
v0.17.1 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: Apache-2.0 Imports: 16 Imported by: 125

Documentation

Overview

Package krusty is intended as the entry point package for those seeking to add kustomize ability to other programs.

To use, follow the example of the kustomize CLI's 'build' command. Also, see the high level tests in this package, which serve a dual purpose as examples.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBuiltinPluginNames added in v0.6.9

func GetBuiltinPluginNames() []string

GetBuiltinPluginNames returns a list of builtin plugin names

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 filesystem, then call Run.

func MakeKustomizer

func MakeKustomizer(o *Options) *Kustomizer

MakeKustomizer returns an instance of Kustomizer.

func (*Kustomizer) Run

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

Run performs a kustomization.

It reads given path from the given file system, interprets 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 on the 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 {

	// Sort the resources before emitting them. Possible values:
	// - "legacy": Use a fixed order that kustomize provides for backwards
	//   compatibility.
	// - "none": Respect the depth-first resource input order as specified by the
	//   kustomization file.
	// - "unspecified": The user didn't specify any preference. Kustomize will
	//   select the appropriate default.
	Reorder ReorderOption

	// When true, a label
	//     app.kubernetes.io/managed-by: kustomize-<version>
	// is added to all the resources in the build out.
	AddManagedbyLabel bool

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

	// 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.

type ReorderOption added in v0.13.0

type ReorderOption string
const (
	ReorderOptionLegacy      ReorderOption = "legacy"
	ReorderOptionNone        ReorderOption = "none"
	ReorderOptionUnspecified ReorderOption = "unspecified"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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