helpers

package
v1.73.3 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RegistryServiceName      = "registry"
	RegistryServiceNamespace = "d8-system"
)

Variables

View Source
var (
	NamespaceSelector = &types.NamespaceSelector{
		NameSelector: &types.NameSelector{
			MatchNames: []string{"d8-system"},
		},
	}

	RegistryServiceDNSName = fmt.Sprintf("%s.%s.svc", RegistryServiceName, RegistryServiceNamespace)
)
View Source
var (
	ErrNoSnapshot        = errors.New("no snapshot found or too many snapshots")
	ErrSnapshotTypeError = errors.New("snapshot cannot be converted to requested type")
)
View Source
var (
	ErrNoValue = errors.New("value not found")
)

Functions

func AssessDeploymentStatus

func AssessDeploymentStatus(deployment *appsv1.Deployment) (string, bool)

AssessDeploymentStatus evaluates whether a Deployment has reached its desired state.

func ComputeHash

func ComputeHash(values ...any) (string, error)

func CredsFromDockerCfg

func CredsFromDockerCfg(rawCfg []byte, host string) (string, string, error)

func DockerCfgFromCreds

func DockerCfgFromCreds(username, password, host string) ([]byte, error)

func GetValue

func GetValue[TValue any](input *go_hook.HookInput, path string) (TValue, error)

func RegistryAddressAndPathFromImagesRepo

func RegistryAddressAndPathFromImagesRepo(imgRepo string) (string, string)

func SnapshotToList

func SnapshotToList[TValue any](input *go_hook.HookInput, name string) ([]TValue, error)

func SnapshotToMap

func SnapshotToMap[TKey comparable, TValue any](input *go_hook.HookInput, name string) (map[TKey]TValue, error)

func SnapshotToSingle

func SnapshotToSingle[TValue any](input *go_hook.HookInput, name string) (TValue, error)

func TrimWithEllipsis

func TrimWithEllipsis(value string) string

Types

type KeyValue

type KeyValue[TKey comparable, TValue any] struct {
	Key   TKey
	Value TValue
}

func NewKeyValue

func NewKeyValue[TKey comparable, TValue any](key TKey, value TValue) KeyValue[TKey, TValue]

type ValuesAccessor

type ValuesAccessor[TValue any] interface {
	Set(value TValue)
	Get() TValue
	Clear()
}

func NewValuesAccessor

func NewValuesAccessor[TValue any](input *go_hook.HookInput, path string) ValuesAccessor[TValue]

Jump to

Keyboard shortcuts

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