utils

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
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"
)

Variables

This section is empty.

Functions

func IsErrTimeout

func IsErrTimeout(err error) bool

func MakeResIds added in v0.8.11

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 added in v0.8.11

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

PrevIds returns all of an RNode's previous Ids

func SameEndingSubSlice added in v0.8.11

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 added in v0.8.11

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

StringSliceContains returns true if the slice has the string.

func StringSliceIndex added in v0.8.11

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.

Types

This section is empty.

Jump to

Keyboard shortcuts

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