Documentation ¶
Index ¶
- Constants
- type DuplicateValidator
- func (v DuplicateValidator) ValidateCreate(ctx context.Context, logger logr.Logger, ...) *ValidationError
- func (v DuplicateValidator) ValidateDelete(ctx context.Context, logger logr.Logger, namespace, oldName string) *ValidationError
- func (v DuplicateValidator) ValidateUpdate(ctx context.Context, logger logr.Logger, ...) *ValidationError
- type NameRegistry
- type NameValidator
- type NamespaceValidator
- type PlacementValidator
- 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, newName, duplicateNameError string) *ValidationError
func (DuplicateValidator) ValidateDelete ¶
func (v DuplicateValidator) ValidateDelete(ctx context.Context, logger logr.Logger, namespace, oldName string) *ValidationError
func (DuplicateValidator) ValidateUpdate ¶
func (v DuplicateValidator) ValidateUpdate(ctx context.Context, logger logr.Logger, namespace, oldName, newName, duplicateNameError string) *ValidationError
type NameRegistry ¶
type NameValidator ¶ added in v0.2.0
type NameValidator interface { ValidateCreate(ctx context.Context, logger logr.Logger, namespace, newName, duplicateNameError string) *ValidationError ValidateUpdate(ctx context.Context, logger logr.Logger, namespace, oldName, newName, duplicateNameError string) *ValidationError ValidateDelete(ctx context.Context, logger logr.Logger, namespace, oldName string) *ValidationError }
type NamespaceValidator ¶ added in v0.2.0
type NamespaceValidator interface { ValidateOrgCreate(org korifiv1alpha1.CFOrg) *ValidationError ValidateSpaceCreate(space korifiv1alpha1.CFSpace) *ValidationError }
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) *ValidationError
func (PlacementValidator) ValidateSpaceCreate ¶
func (v PlacementValidator) ValidateSpaceCreate(space korifiv1alpha1.CFSpace) *ValidationError
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.