webhooks

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2024 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

View Source
const (
	UnknownErrorType                   = "UnknownError"
	UnknownErrorMessage                = "An unknown error has occurred"
	ImmutableFieldErrorType            = "ImmutableFieldError"
	ImmutableFieldErrorMessageTemplate = "'%s' field is immutable"
)
View Source
const (
	OrgPlacementErrorType      = "OrgPlacementError"
	OrgPlacementErrorMessage   = "Organization '%s' must be placed in the root 'cf' namespace"
	SpacePlacementErrorType    = "SpacePlacementError"
	SpacePlacementErrorMessage = "Organization '%s' does not exist for Space '%s'"
)
View Source
const DuplicateNameErrorType = "DuplicateNameError"

Variables

This section is empty.

Functions

This section is empty.

Types

type DuplicateValidator

type DuplicateValidator struct {
	// contains filtered or unexported fields
}

func NewDuplicateValidator

func NewDuplicateValidator(nameRegistry NameRegistry) *DuplicateValidator

func (DuplicateValidator) ValidateCreate

func (v DuplicateValidator) ValidateCreate(ctx context.Context, logger logr.Logger, namespace string, obj UniqueClientObject) error

func (DuplicateValidator) ValidateDelete

func (v DuplicateValidator) ValidateDelete(ctx context.Context, logger logr.Logger, namespace string, obj UniqueClientObject) error

func (DuplicateValidator) ValidateUpdate

func (v DuplicateValidator) ValidateUpdate(ctx context.Context, logger logr.Logger, namespace string, oldObj, obj UniqueClientObject) error

type NameRegistry

type NameRegistry interface {
	RegisterName(ctx context.Context, namespace, name, ownerNamespace, ownerName string) error
	DeregisterName(ctx context.Context, namespace, name string) error
	TryLockName(ctx context.Context, namespace, name string) error
	UnlockName(ctx context.Context, namespace, name string) error
	CheckNameOwnership(ctx context.Context, namespace, name, ownerNamespace, ownerName string) (bool, error)
}

type NameValidator added in v0.2.0

type NameValidator interface {
	ValidateCreate(ctx context.Context, logger logr.Logger, namespace string, obj UniqueClientObject) error
	ValidateUpdate(ctx context.Context, logger logr.Logger, namespace string, oldObj, newObj UniqueClientObject) error
	ValidateDelete(ctx context.Context, logger logr.Logger, namespace string, obj UniqueClientObject) error
}

type NamespaceValidator added in v0.2.0

type NamespaceValidator interface {
	ValidateOrgCreate(org korifiv1alpha1.CFOrg) error
	ValidateSpaceCreate(space korifiv1alpha1.CFSpace) error
}

type PlacementValidator

type PlacementValidator struct {
	// contains filtered or unexported fields
}

func NewPlacementValidator

func NewPlacementValidator(client client.Client, rootNamespace string) *PlacementValidator

func (PlacementValidator) ValidateOrgCreate

func (v PlacementValidator) ValidateOrgCreate(org korifiv1alpha1.CFOrg) error

func (PlacementValidator) ValidateSpaceCreate

func (v PlacementValidator) ValidateSpaceCreate(space korifiv1alpha1.CFSpace) error

type UniqueClientObject added in v0.8.0

type UniqueClientObject interface {
	client.Object
	UniqueName() string
	UniqueValidationErrorMessage() string
}

type ValidationError

type ValidationError struct {
	Type    string `json:"validationErrorType"`
	Message string `json:"message"`
}

func WebhookErrorToValidationError

func WebhookErrorToValidationError(err error) (ValidationError, bool)

func (ValidationError) Error

func (v ValidationError) Error() string

func (ValidationError) ExportJSONError added in v0.2.0

func (v ValidationError) ExportJSONError() error

func (ValidationError) GetMessage added in v0.2.0

func (v ValidationError) GetMessage() string

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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