Documentation ¶
Index ¶
- func ConfirmInternalAnnotationUnchanged(r1 *yaml.RNode, r2 *yaml.RNode, exclusions ...AnnotationKey) error
- func CopyInternalAnnotations(src *yaml.RNode, dst *yaml.RNode, exclusions ...AnnotationKey) error
- func CopyLegacyAnnotations(rn *yaml.RNode) error
- func CreatePathAnnotationValue(dir string, m yaml.ResourceMeta) string
- func DefaultPathAndIndexAnnotation(dir string, nodes []*yaml.RNode) error
- func DefaultPathAnnotation(dir string, nodes []*yaml.RNode) error
- func ErrorIfMissingAnnotation(nodes []*yaml.RNode, keys ...AnnotationKey) error
- func GetFileAnnotations(rn *yaml.RNode) (string, string, error)
- func GetIdAnnotation(rn *yaml.RNode) string
- func GetInternalAnnotations(rn *yaml.RNode) map[string]string
- func Map(nodes []*yaml.RNode, fn func(*yaml.RNode) (*yaml.RNode, error)) ([]*yaml.RNode, error)
- func MapMeta(nodes []*yaml.RNode, ...) ([]*yaml.RNode, error)
- func SortNodes(nodes []*yaml.RNode) error
- type AnnotationKey
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfirmInternalAnnotationUnchanged ¶ added in v0.13.0
func ConfirmInternalAnnotationUnchanged(r1 *yaml.RNode, r2 *yaml.RNode, exclusions ...AnnotationKey) error
ConfirmInternalAnnotationUnchanged compares the annotations of the RNodes that begin with the prefix `internal.config.kubernetes.io`, throwing an error if they differ. It takes a parameter exclusions, which is a list of annotation keys to ignore.
func CopyInternalAnnotations ¶ added in v0.13.0
CopyInternalAnnotations copies the annotations that begin with the prefix `internal.config.kubernetes.io` from the source RNode to the destination RNode. It takes a parameter exclusions, which is a list of annotation keys to ignore.
func CopyLegacyAnnotations ¶ added in v0.12.0
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
DefaultPathAndIndexAnnotation sets a default path or index value on any nodes missing the annotation
func DefaultPathAnnotation ¶ added in v0.0.6
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 GetIdAnnotation ¶ added in v0.13.1
func GetInternalAnnotations ¶ added in v0.13.0
GetInternalAnnotations returns a map of all the annotations of the provided RNode that satisfies one of the following: 1) begin with the prefix `internal.config.kubernetes.io` 2) is one of `config.kubernetes.io/path`, `config.kubernetes.io/index` and `config.k8s.io/id`.
Types ¶
type AnnotationKey ¶
type AnnotationKey = string
const ( // IndexAnnotation records the index of a specific resource in a file or input stream. IndexAnnotation AnnotationKey = internalPrefix + "index" // PathAnnotation records the path to the file the Resource was read from PathAnnotation AnnotationKey = internalPrefix + "path" // SeqIndentAnnotation records the sequence nodes indentation of the input resource SeqIndentAnnotation AnnotationKey = internalPrefix + "seqindent" // IdAnnotation records the id of the resource to map inputs to outputs IdAnnotation AnnotationKey = internalPrefix + "id" // Deprecated: Use IndexAnnotation instead. LegacyIndexAnnotation AnnotationKey = "config.kubernetes.io/index" // Deprecated: use PathAnnotation instead. LegacyPathAnnotation AnnotationKey = "config.kubernetes.io/path" // Deprecated: use IdAnnotation instead. LegacyIdAnnotation = "config.k8s.io/id" // InternalAnnotationsMigrationResourceIDAnnotation is used to uniquely identify // resources during round trip to and from a function execution. We will use it // to track the internal annotations and reconcile them if needed. InternalAnnotationsMigrationResourceIDAnnotation = internalPrefix + "annotations-migration-resource-id" )