util

package
v0.2.8 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2025 License: MIT Imports: 17 Imported by: 2

Documentation

Index

Constants

View Source
const (
	// ServiceAccountTLSOption is the listener TLS Option key used to specify the service account
	ServiceAccountTLSOption = "kubernetes.azure.com/tls-cert-service-account"
)
View Source
const WiSaClientIdAnnotation = "azure.workload.identity/client-id"

WiSaClientIdAnnotation is the annotation key used to specify the client ID for Workload Identity on a ServiceAccount for Workload Identity

Variables

This section is empty.

Functions

func AddGatewayServiceAccountIndex added in v0.2.8

func AddGatewayServiceAccountIndex(indexer client.FieldIndexer, indexName string) error

AddGatewayServiceAccountIndex adds an index to the Gateway resource based on the service account specified in the TLS options of the listeners

func FilterMap added in v0.2.5

func FilterMap[K comparable, V comparable](m map[K]V, keep func(K, V) bool) map[K]V

FilterMap filters a map, only keeping the key-value pairs that pass the keep function

func FindOwnerKind

func FindOwnerKind(owners []metav1.OwnerReference, kind string) string

func GenerateGatewayGetter added in v0.2.8

func GenerateGatewayGetter(mgr ctrl.Manager, serviceAccountIndexName string) handler.MapFunc

GenerateGatewayGetter returns a handler.MapFunc that retrieves all Gateways associated with a given ServiceAccount

func GetServiceAccountWorkloadIdentityClientId added in v0.2.8

func GetServiceAccountWorkloadIdentityClientId(ctx context.Context, k8sclient client.Client, saName, saNamespace string) (string, error)

func Int32Ptr

func Int32Ptr(i int32) *int32

func Int64Ptr

func Int64Ptr(i int64) *int64

func Jitter

func Jitter(base time.Duration, ratio float64) time.Duration

func Keys added in v0.2.2

func Keys[K comparable, v any](m map[K]v) []K

Keys returns the keys in a map

func MergeMaps added in v0.0.2

func MergeMaps[M ~map[K]V, K comparable, V any](src ...M) M

func NewObject added in v0.2.8

func NewObject[T any]() T

NewObject creates a new instance of the type T

func ReverseMap added in v0.2.2

func ReverseMap[K comparable, V comparable](m map[K]V) map[V]K

ReverseMap creates a map with the values in the map pointing to the keys, effectively reversing it

func ToPtr added in v0.1.0

func ToPtr[T any](t T) *T

func Upsert

func Upsert(ctx context.Context, c client.Client, res client.Object) error

Types

type IngressManager added in v0.2.8

type IngressManager interface {
	IsManaging(ing *netv1.Ingress) (bool, error)
}

IngressManager returns a boolean indicating whether the Ingress is being managed by us

func NewIngressManagerFromFn added in v0.2.8

func NewIngressManagerFromFn(IsManaging func(ing *netv1.Ingress) (bool, error)) IngressManager

NewIngressManagerFromFn returns an IngressManager from a function that determines whether the Ingress is being managed by us

type UserError added in v0.2.5

type UserError struct {
	Err         error
	UserMessage string
}

func NewUserError added in v0.2.5

func NewUserError(err error, msg string) UserError

func (UserError) Error added in v0.2.5

func (b UserError) Error() string

for internal use

func (UserError) UserError added in v0.2.5

func (b UserError) UserError() string

for user facing messages

Jump to

Keyboard shortcuts

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