Documentation ¶
Index ¶
- Constants
- type DuplicateValidator
- func (v DuplicateValidator) ValidateCreate(ctx context.Context, logger logr.Logger, namespace string, ...) error
- func (v DuplicateValidator) ValidateDelete(ctx context.Context, logger logr.Logger, namespace string, ...) error
- func (v DuplicateValidator) ValidateUpdate(ctx context.Context, logger logr.Logger, namespace string, ...) error
- type NameRegistry
- type NameValidator
- type NamespaceValidator
- type PlacementValidator
- type UniqueClientObject
- type ValidationError
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 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
Source Files ¶
Click to show internal directories.
Click to hide internal directories.