utils

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: Apache-2.0 Imports: 26 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 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 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 IsCapsuleUser

func IsCapsuleUser(ctx context.Context, req admission.Request, clt client.Client, userGroups []string) bool

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 IsTenantOwner

func IsTenantOwner(owners capsulev1beta2.OwnerListSpec, userInfo authenticationv1.UserInfo) bool

func NodeWebhookSupported

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

func TenantByStatusNamespace

func TenantByStatusNamespace(ctx context.Context, c client.Client, namespace string) (*capsulev1beta2.Tenant, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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