package utils

import "sigs.k8s.io/kustomize/api/internal/utils"

Index

Constants

const (
	// build annotations
	BuildAnnotationPreviousKinds      = konfig.ConfigAnnoDomain + "/previousKinds"
	BuildAnnotationPreviousNames      = konfig.ConfigAnnoDomain + "/previousNames"
	BuildAnnotationPrefixes           = konfig.ConfigAnnoDomain + "/prefixes"
	BuildAnnotationSuffixes           = konfig.ConfigAnnoDomain + "/suffixes"
	BuildAnnotationPreviousNamespaces = konfig.ConfigAnnoDomain + "/previousNamespaces"
	BuildAnnotationsRefBy             = konfig.ConfigAnnoDomain + "/refBy"
	BuildAnnotationsGenBehavior       = konfig.ConfigAnnoDomain + "/generatorBehavior"
	BuildAnnotationsGenAddHashSuffix  = konfig.ConfigAnnoDomain + "/needsHashSuffix"

	// the following are only for patches, to specify whether they can change names
	// and kinds of their targets
	BuildAnnotationAllowNameChange = konfig.ConfigAnnoDomain + "/allowNameChange"
	BuildAnnotationAllowKindChange = konfig.ConfigAnnoDomain + "/allowKindChange"

	// for keeping track of origin and transformer data
	OriginAnnotationKey      = "config.kubernetes.io/origin"
	TransformerAnnotationKey = "alpha.config.kubernetes.io/transformations"

	Enabled = "enabled"
)

Functions

func IsErrTimeout

func IsErrTimeout(err error) bool

func MakeResIds

func MakeResIds(n *yaml.RNode) ([]resid.ResId, error)

MakeResIds returns all of an RNode's current and previous Ids

func NewErrTimeOut

func NewErrTimeOut(d time.Duration, c string) *errTimeOut

func PrevIds

func PrevIds(n *yaml.RNode) ([]resid.ResId, error)

PrevIds returns all of an RNode's previous Ids

func SameEndingSubSlice

func SameEndingSubSlice(shortest, longest []string) bool

SameEndingSubSlice returns true if the slices end the same way, e.g. {"a", "b", "c"}, {"b", "c"} => true {"a", "b", "c"}, {"a", "b"} => false If one slice is empty and the other is not, return false.

func StringSliceContains

func StringSliceContains(slice []string, str string) bool

StringSliceContains returns true if the slice has the string.

func StringSliceIndex

func StringSliceIndex(slice []string, str string) int

StringSliceIndex returns the index of the str, else -1.

func TimedCall

func TimedCall(description string, d time.Duration, fn func() error) error

TimedCall runs fn, failing if it doesn't complete in the given duration. The description is used in the timeout error message.

Source Files

annotations.go errtimeout.go makeResIds.go stringslice.go timedcall.go

Version
v0.20.0 (latest)
Published
Jun 28, 2025
Platform
linux/amd64
Imports
7 packages
Last checked
5 hours ago

Tools for package owners.