internal

package
v0.20.5 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2026 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LabelManagedBy               = "app.kubernetes.io/managed-by"
	DeprecatedLabelYokeRelease   = "app.kubernetes.io/yoke-release"
	DeprecatedLabelYokeReleaseNS = "app.kubernetes.io/yoke-release-namespace"
	AnnotationYokeRelease        = "instance.atc.yoke.cd/release"
	AnnotationYokeNamespace      = "instance.atc.yoke.cd/namespace"
)
View Source
const (
	LabelKind                = "internal.yoke/kind"
	LabelRelease             = "internal.yoke/release"
	AnnotationSourceURL      = "internal.yoke/source-url"
	AnnotationSourceChecksum = "internal.yoke/source-checksum"
	AnnotationCreatedAt      = "internal.yoke/created-at"
	AnnotationActiveAt       = "internal.yoke/active-at"
	AnnotationResourceCount  = "internal.yoke/resources"
	AnnotationReleaseName    = "internal.yoke/release-name"
	KeyResources             = "resources"
	KeyLockedBy              = "lockedBy"
)

Variables

View Source
var Info, _ = debug.ReadBuildInfo()

Functions

func AddYokeMetadata

func AddYokeMetadata(resources []*unstructured.Unstructured, release, ns, manager string)

func Canonical

func Canonical(resource *unstructured.Unstructured) string

func CanonicalMap

func CanonicalMap(resources []*unstructured.Unstructured) map[string]*unstructured.Unstructured

func CanonicalNameList

func CanonicalNameList(resources []*unstructured.Unstructured) []string

func CanonicalObjectMap

func CanonicalObjectMap(resources []*unstructured.Unstructured) map[string]any

func CanonicalWithoutVersion added in v0.7.3

func CanonicalWithoutVersion(resource *unstructured.Unstructured) string

func ChecksumFromPath added in v0.20.5

func ChecksumFromPath(value string) string

func Colorize

func Colorize(value string) string

func CutArgs

func CutArgs(args []string) ([]string, []string)

func Debug

func Debug(ctx context.Context) ansi.Terminal

func DebugTimer

func DebugTimer(ctx context.Context, msg string) func()

func DropProperties added in v0.11.3

func DropProperties(resource *unstructured.Unstructured, props [][]string) *unstructured.Unstructured

func Find

func Find[S ~[]E, E any](slice S, fn func(E) bool) (E, bool)

func FindAll added in v0.6.0

func FindAll[S ~[]E, E any](slice S, fn func(E) bool) []E

func GetAnnotation added in v0.14.2

func GetAnnotation(resource *unstructured.Unstructured, key string) string

func GetFlightConditions added in v0.13.0

func GetFlightConditions(resource *unstructured.Unstructured) []metav1.Condition

func GetFlightReadyCondition added in v0.13.0

func GetFlightReadyCondition(resource *unstructured.Unstructured) *metav1.Condition

func GetLabel added in v0.17.0

func GetLabel(resource *unstructured.Unstructured, label string) string

func GetOwner added in v0.11.3

func GetOwner(resource *unstructured.Unstructured) string

func GetYokeVersion added in v0.17.3

func GetYokeVersion() string

func IsCRD added in v0.14.0

func IsCRD(resource *unstructured.Unstructured) bool

func IsNamespace added in v0.14.0

func IsNamespace(resource *unstructured.Unstructured) bool

func IsPinnableReference added in v0.20.4

func IsPinnableReference(ref string) bool

func IsWarning

func IsWarning(err error) bool

func JSONReader added in v0.18.4

func JSONReader(value any) io.Reader

func MatchResource added in v0.12.8

func MatchResource(resource *unstructured.Unstructured, matcher string) bool

func MatcherContains added in v0.16.8

func MatcherContains(parent, child string) bool

func Must added in v0.16.0

func Must(err error)

func Must2 added in v0.16.0

func Must2[T any](value T, err error) T

func MustParseInt

func MustParseInt(value string) int

func MustParseTime

func MustParseTime(value string) time.Time

func MustUnstructuredObject added in v0.4.1

func MustUnstructuredObject[T any](value any) T

func Namespace

func Namespace(resource *unstructured.Unstructured) string

func OwnerFrom added in v0.12.8

func OwnerFrom(release, ns string) string

func ParseRef added in v0.20.0

func ParseRef(ref string) (ns, gk, name string)

func RandomString

func RandomString() string

func RemoveAdditions added in v0.11.3

func RemoveAdditions[T any](expected, actual T) T

RemoveAdditions removes fields from actual that are not in expected. it removes the additional properties in place and returns "actual" back. Values passed to removeAdditions are expected to be generic json compliant structures: map[string]any, []any, or scalars.

func RemoveYokeMetadata added in v0.14.0

func RemoveYokeMetadata(resources []*unstructured.Unstructured)

func ResourceRef added in v0.17.0

func ResourceRef(resource *unstructured.Unstructured) string

func ResourcesAreEqual added in v0.11.3

func ResourcesAreEqual(a, b *unstructured.Unstructured) bool

func ResourcesAreEqualWithStatus added in v0.13.0

func ResourcesAreEqualWithStatus(a, b *unstructured.Unstructured) bool

func SHA1 added in v0.16.0

func SHA1(data []byte) []byte

func SHA1HexFromString added in v0.18.0

func SHA1HexFromString(data string) string

func SHA1HexString added in v0.14.3

func SHA1HexString(data []byte) string

func SHA256 added in v0.20.5

func SHA256(data []byte) []byte

func SHA256HexString added in v0.20.5

func SHA256HexString(data []byte) string

func Stderr

func Stderr(ctx context.Context) io.Writer

func Stdin

func Stdin(ctx context.Context) io.Reader

func Stdout

func Stdout(ctx context.Context) io.Writer

func ToUnstructured added in v0.4.1

func ToUnstructured(value any) (*unstructured.Unstructured, error)

func UnstructuredObject added in v0.4.1

func UnstructuredObject[T any](value any) (T, error)

func WithDebugFlag

func WithDebugFlag(ctx context.Context, debug *bool) context.Context

func WithStderr

func WithStderr(ctx context.Context, w io.Writer) context.Context

func WithStdin

func WithStdin(ctx context.Context, r io.Reader) context.Context

func WithStdio

func WithStdio(ctx context.Context, out, err io.Writer, in io.Reader) context.Context

func WithStdout

func WithStdout(ctx context.Context, w io.Writer) context.Context

func WriteYAML

func WriteYAML(filename string, value any) (err error)

Types

type Globs added in v0.20.2

type Globs []string

func (Globs) Match added in v0.20.2

func (globs Globs) Match(value string) bool

func (*Globs) OpenAPISchema added in v0.20.2

func (globs *Globs) OpenAPISchema() *apiextensionsv1.JSONSchemaProps

type List

type List[T any] []T

func (*List[T]) UnmarshalJSON

func (value *List[T]) UnmarshalJSON(data []byte) error

type Release added in v0.6.0

type Release struct {
	Name      string     `json:"release"`
	Namespace string     `json:"namespace"`
	History   []Revision `json:"history"`
}

func (Release) ActiveIndex added in v0.6.0

func (release Release) ActiveIndex() int

func (Release) ActiveRevision added in v0.6.0

func (release Release) ActiveRevision() Revision

func (*Release) Add added in v0.6.0

func (release *Release) Add(revision Revision)

type Revision

type Revision struct {
	Name      string    `json:"-"`
	Namespace string    `json:"-"`
	Source    Source    `json:"source"`
	LockedBy  string    `json:"lockedBy"`
	CreatedAt time.Time `json:"createdAt"`
	ActiveAt  time.Time `json:"-"`
	Resources int       `json:"resources"`
}

type Source

type Source struct {
	Ref      string `json:"ref"`
	Checksum string `json:"checksum"`
}

func SourceFrom

func SourceFrom(ref string, wasm []byte) (src Source)

type Stage added in v0.8.0

type Stage []*unstructured.Unstructured

type Stages added in v0.8.0

type Stages []Stage

func ParseStages added in v0.12.5

func ParseStages(data []byte) (stages Stages, err error)

func (Stages) Flatten added in v0.8.0

func (stages Stages) Flatten() []*unstructured.Unstructured

type Warning

type Warning string

func (Warning) Error

func (warning Warning) Error() string

func (Warning) Is

func (Warning) Is(err error) bool

Directories

Path Synopsis
atc
k8s
module
module serves to manipulate wasm module binaries and interact with them.
module serves to manipulate wasm module binaries and interact with them.
x

Jump to

Keyboard shortcuts

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