common

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2020 License: Apache-2.0 Imports: 10 Imported by: 29

Documentation

Index

Constants

View Source
const (
	// InventoryLabel is the label stored on the ConfigMap
	// inventory object. The value of the label is a unique
	// identifier (by default a UUID), representing the set of
	// objects applied at the same time as the inventory object.
	// This inventory object is used for pruning and deletion.
	InventoryLabel = "cli-utils.sigs.k8s.io/inventory-id"
	// InventoryHash defines an annotation which stores the hash of
	// the set of objects applied at the same time as the inventory
	// object. This annotation is set on the inventory object at the
	// time of the apply. The hash is computed from the sorted strings
	// of the applied object's metadata (ObjMetadata). The hash is
	// used as a suffix of the inventory object name. Example:
	//   inventory-1e5824fb
	InventoryHash = "cli-utils.sigs.k8s.io/inventory-hash"
	// Resource lifecycle annotation key for "on-remove" operations.
	OnRemoveAnnotation = "cli-utils.sigs.k8s.io/on-remove"
	// Resource lifecycle annotation value to prevent deletion.
	OnRemoveKeep = "keep"
)

Variables

This section is empty.

Functions

func DemandOneDirectory

func DemandOneDirectory(paths []string) (genericclioptions.FileNameFlags, error)

DemandOneDirectoryOrStdin processes "paths" to ensure the single argument in the array is a directory. Returns FileNameFlags populated with the directory (recursive flag set), or the StdIn dash. An empty array gets treated as StdIn (adding dash to the array). Returns an error if more than one element in the array or the filepath is not a directory.

func ExpandPackageDir

ExpandPackageDir expands the one package directory entry in the flags to all the config file paths recursively. Excludes the inventory object (since this object is specially processed). Used for the diff command, so it will not always show a diff of the inventory object. Must be called AFTER DemandOneDirectory.

func FilterInputFile added in v0.13.0

func FilterInputFile(in io.Reader, tmpDir string) error

FilterInputFile copies the resource config on stdin into a file at the tmpDir, filtering the inventory object. It is the responsibility of the caller to clean up the tmpDir. Returns an error if one occurs.

Types

This section is empty.

Jump to

Keyboard shortcuts

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