internal

package
v0.6.4 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2025 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LabelManagedBy     = "app.kubernetes.io/managed-by"
	LabelYokeRelease   = "app.kubernetes.io/yoke-release"
	LabelYokeReleaseNS = "app.kubernetes.io/yoke-release-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"
	KeyResources             = "resources"
)

Variables

This section is empty.

Functions

func AddYokeMetadata

func AddYokeMetadata(resources []*unstructured.Unstructured, release, ns 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 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 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 IsWarning

func IsWarning(err error) bool

func MustParseInt

func MustParseInt(value string) int

func MustParseTime

func MustParseTime(value string) time.Time

func MustUnstructuredObject added in v0.4.1

func MustUnstructuredObject(value any) map[string]any

func Namespace

func Namespace(resource *unstructured.Unstructured) string

func RandomString

func RandomString() 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(value any) (map[string]any, 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 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"`
	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 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
x

Jump to

Keyboard shortcuts

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