helpers

package
v1.76.13 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2026 License: Apache-2.0 Imports: 10 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 ClusterIsBootstrapped added in v1.75.0

func ClusterIsBootstrapped(input *go_hook.HookInput) bool

ClusterIsBootstrapped checks whether the cluster has completed initial bootstrapping.

Returns:

  • bool: true if the cluster is bootstrapped, else false

func GetValue

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

func IngressClientCA added in v1.75.0

func IngressClientCA(input *go_hook.HookInput) (*x509.Certificate, error)

IngressClientCA retrieves the ingress CA certificate from the hook input values.

Returns:

  • *x509.Certificate: the decoded CA certificate, or nil if it doesn't exist or is empty
  • error: decoding error if the certificate is malformed

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