Help us shape the future of Go! Take the 2026 Go Developer Survey

utils

package
v0.12.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const TRUE string = "true"

Variables

This section is empty.

Functions

func AllowedValuesErrorMessage

func AllowedValuesErrorMessage(allowed api.SelectorAllowedListSpec, err string) string

func DefaultAllowedValuesErrorMessage

func DefaultAllowedValuesErrorMessage(allowed api.DefaultAllowedListSpec, err string) string

func ErroredResponse

func ErroredResponse(err error) *admission.Response

func GetDeviceClassByName

func GetDeviceClassByName(ctx context.Context, c client.Client, name string) (*resources.DeviceClass, error)

Get DeviceClass by name (Does not return error if not found).

func GetGatewayClassClassByObjectName

func GetGatewayClassClassByObjectName(ctx context.Context, c client.Client, gatewayClassName gatewayv1.ObjectName) (*gatewayv1.GatewayClass, error)

Get GatewayClassClass by name (Does not return error if not found).

func GetIngressClassByName

func GetIngressClassByName(ctx context.Context, version *version.Version, c client.Client, ingressClassName *string) (client.Object, error)

Get IngressClass by name (Does not return error if not found).

func GetK8sVersion

func GetK8sVersion() (*version.Version, error)

func GetNamespaceTenant

getNamespaceTenant returns namespace owner tenant.

func GetPriorityClassByName

func GetPriorityClassByName(ctx context.Context, c client.Client, name string) (*schedulev1.PriorityClass, error)

Get PriorityClass by name (Does not return error if not found).

func GetStorageClassByName

func GetStorageClassByName(ctx context.Context, c client.Client, name string) (*storagev1.StorageClass, error)

Get StorageClass by name (Does not return error if not found).

func InCapsuleGroups

func InCapsuleGroups(configuration configuration.Configuration, handlers ...webhook.Handler) webhook.Handler

func IsDefaultIngressClass

func IsDefaultIngressClass(class client.Object) bool

func IsDefaultPriorityClass

func IsDefaultPriorityClass(class *schedulev1.PriorityClass) bool

IsDefaultPriorityClass checks if the given PriorityClass is cluster default.

func IsDefaultStorageClass

func IsDefaultStorageClass(class client.Object) bool

IsDefaultStorageClass checks if the given StorageClass is cluster default.

func NodeWebhookSupported

func NodeWebhookSupported(currentVersion *version.Version) (bool, error)

func SelectionListWithDefaultErrorMessage

func SelectionListWithDefaultErrorMessage(allowed api.SelectionListWithDefaultSpec, err string) string

Types

type TypedTenantHandler

type TypedTenantHandler[T client.Object] struct {
	Factory  newObjectFunc[T]
	Handlers []webhook.TypedHandlerWithTenant[T]
}

func (*TypedTenantHandler[T]) OnCreate

func (h *TypedTenantHandler[T]) OnCreate(c client.Client, decoder admission.Decoder, recorder record.EventRecorder) webhook.Func

func (*TypedTenantHandler[T]) OnDelete

func (h *TypedTenantHandler[T]) OnDelete(c client.Client, decoder admission.Decoder, recorder record.EventRecorder) webhook.Func

func (*TypedTenantHandler[T]) OnUpdate

func (h *TypedTenantHandler[T]) OnUpdate(c client.Client, decoder admission.Decoder, recorder record.EventRecorder) webhook.Func

Jump to

Keyboard shortcuts

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