kioutil

package
v0.10.13 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2021 License: Apache-2.0 Imports: 7 Imported by: 85

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreatePathAnnotationValue added in v0.0.6

func CreatePathAnnotationValue(dir string, m yaml.ResourceMeta) string

CreatePathAnnotationValue creates a default path annotation value for a Resource. The path prefix will be dir.

func DefaultPathAndIndexAnnotation added in v0.0.6

func DefaultPathAndIndexAnnotation(dir string, nodes []*yaml.RNode) error

DefaultPathAndIndexAnnotation sets a default path or index value on any nodes missing the annotation

func DefaultPathAnnotation added in v0.0.6

func DefaultPathAnnotation(dir string, nodes []*yaml.RNode) error

DefaultPathAnnotation sets a default path annotation on any Reources missing it.

func ErrorIfMissingAnnotation

func ErrorIfMissingAnnotation(nodes []*yaml.RNode, keys ...AnnotationKey) error

ErrorIfMissingAnnotation validates the provided annotations are present on the given resources

func GetFileAnnotations

func GetFileAnnotations(rn *yaml.RNode) (string, string, error)

func Map

func Map(nodes []*yaml.RNode, fn func(*yaml.RNode) (*yaml.RNode, error)) ([]*yaml.RNode, error)

Map invokes fn for each element in nodes.

func MapMeta

func MapMeta(nodes []*yaml.RNode, fn func(*yaml.RNode, yaml.ResourceMeta) (*yaml.RNode, error)) (
	[]*yaml.RNode, error)

func SortNodes

func SortNodes(nodes []*yaml.RNode) error

SortNodes sorts nodes in place: - by PathAnnotation annotation - by IndexAnnotation annotation

Types

type AnnotationKey

type AnnotationKey = string
const (
	// IndexAnnotation records the index of a specific resource in a file or input stream.
	IndexAnnotation AnnotationKey = "config.kubernetes.io/index"

	// PathAnnotation records the path to the file the Resource was read from
	PathAnnotation AnnotationKey = "config.kubernetes.io/path"
)

Jump to

Keyboard shortcuts

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