utils

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateRuntimeObject

func CreateRuntimeObject(ctx context.Context, client ctrlruntimeclient.Client, obj ctrlruntimeclient.Object, waitForResult bool) error

func CreateRuntimeObjectsFromYAMLFiles

func CreateRuntimeObjectsFromYAMLFiles(params RuntimeYamlParams) error

CreateRuntimeObjectsFromYAMLFiles reads YAML files, decodes them into Kubernetes objects, and creates them using the provided client. It handles multi-document YAML files (separated by "---").

func DeleteRuntimeObject

func DeleteRuntimeObject(ctx context.Context, client ctrlruntimeclient.Client, obj ctrlruntimeclient.Object, waitForResult bool) error

func DeleteRuntimeObjectsFromYAMLFiles

func DeleteRuntimeObjectsFromYAMLFiles(params RuntimeYamlParams) error

func GetCRDFixturePath

func GetCRDFixturePath() string

func GetIntTestNamespace

func GetIntTestNamespace(levelsUp int) (string, error)

func RuntimeFromBytes

func RuntimeFromBytes(ctrlclient ctrlruntimeclient.Client, manifest []byte) (runtime.Object, *schema.GroupVersionKind, error)

RuntimeFromBytes returns a list of Kubernetes runtime objects from their yaml templates.

func WaitFor

func WaitFor(ctx context.Context, interval time.Duration, timeout time.Duration, callback func() bool) bool

WaitFor is a convenience wrapper that makes simple, "brute force" waiting loops easier to write.

Types

type RuntimeYamlParams

type RuntimeYamlParams struct {
	Ctx               context.Context
	CrtlruntimeClient ctrlruntimeclient.Client
	Dir               string
	Namespace         string
	ManifestNames     []string
	WaitForResult     bool // Flag to wait for object to be created/deleted
}

Jump to

Keyboard shortcuts

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