kioutil

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2021 License: Apache-2.0 Imports: 7 Imported by: 86

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyLegacyAnnotations added in v0.12.0

func CopyLegacyAnnotations(rn *yaml.RNode) error

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 = "internal.config.kubernetes.io/index"

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

	// SeqIndentAnnotation records the sequence nodes indentation of the input resource
	SeqIndentAnnotation AnnotationKey = "internal.config.kubernetes.io/seqindent"

	// IdAnnotation records the id of the resource to map inputs to outputs
	IdAnnotation = "internal.config.kubernetes.io/id"

	// LegacyIndexAnnotation is the deprecated annotation key for resource index
	LegacyIndexAnnotation AnnotationKey = "config.kubernetes.io/index"

	// LegacyPathAnnotation is the deprecated annotation key for resource path
	LegacyPathAnnotation AnnotationKey = "config.kubernetes.io/path"

	// LegacyIdAnnotation is the deprecated annotation key for resource ids
	LegacyIdAnnotation = "config.k8s.io/id"
)

Jump to

Keyboard shortcuts

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