webhooks

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 24, 2022 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

View Source
const (
	UnknownErrorType    = "UnknownError"
	UnknownErrorMessage = "An unknown error has occurred"
)
View Source
const (
	OrgPlacementErrorType      = "OrgPlacementError"
	OrgPlacementErrorMessage   = "Organization '%s' must be placed in the root 'cf' namespace"
	SpacePlacementErrorMessage = "Organization '%s' does not exist for Space '%s'"
)

Variables

View Source
var ErrorDuplicateName = errors.New("name already used in namespace")

Functions

func AdmissionUnknownErrorReason

func AdmissionUnknownErrorReason() string

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 string) error

func (DuplicateValidator) ValidateDelete

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

func (DuplicateValidator) ValidateUpdate

func (v DuplicateValidator) ValidateUpdate(ctx context.Context, logger logr.Logger, namespace, oldName, newName string) error

type NameRegistry

type NameRegistry interface {
	RegisterName(ctx context.Context, namespace, name 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
}

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 v1alpha1.CFOrg) error

func (PlacementValidator) ValidateSpaceCreate

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

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) Marshal

func (v ValidationError) Marshal() string

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.
fake
Code generated by counterfeiter.
Code generated by counterfeiter.
fake
Code generated by counterfeiter.
Code generated by counterfeiter.
fake
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