applicationconfiguration

package
v1.2.6 Latest Latest
Warning

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

Go to latest
Published: May 10, 2022 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TraitTypeField is the special field indicate the type of the traitDefinition
	TraitTypeField = "name"
	// TraitSpecField indicate the spec of the trait in ApplicationConfiguration
	TraitSpecField = "properties"
)
View Source
const (

	// WorkloadNamePath indicates field path of workload name
	WorkloadNamePath = "metadata.name"
)

Variables

This section is empty.

Functions

func RegisterMutatingHandler

func RegisterMutatingHandler(mgr manager.Manager)

RegisterMutatingHandler will register component mutation handler to the webhook

func RegisterValidatingHandler

func RegisterValidatingHandler(mgr manager.Manager, args controller.Args)

RegisterValidatingHandler will register application configuration validation to webhook

func ValidateRevisionNameFn

func ValidateRevisionNameFn(_ context.Context, v ValidatingAppConfig) []error

ValidateRevisionNameFn validates revisionName and componentName are assigned both.

func ValidateTraitAppliableToWorkloadFn

func ValidateTraitAppliableToWorkloadFn(_ context.Context, v ValidatingAppConfig) []error

ValidateTraitAppliableToWorkloadFn validates whether a trait is allowed to apply to the workload.

func ValidateTraitConflictFn added in v0.3.0

func ValidateTraitConflictFn(_ context.Context, v ValidatingAppConfig) []error

ValidateTraitConflictFn validates whether conflicting traits are applied to the same workload. NOTE(roywang) It returns immediately if one conflict is detected instead of returning after collecting ALL conflicts

func ValidateWorkloadNameForVersioningFn

func ValidateWorkloadNameForVersioningFn(_ context.Context, v ValidatingAppConfig) []error

ValidateWorkloadNameForVersioningFn validates workload name for version-enabled component

Types

type AppConfigValidateFunc

type AppConfigValidateFunc func(context.Context, ValidatingAppConfig) []error

AppConfigValidateFunc implements function to validate ApplicationConfiguration

func (AppConfigValidateFunc) Validate

Validate validates ApplicationConfiguration

type AppConfigValidator

type AppConfigValidator interface {
	Validate(context.Context, ValidatingAppConfig) []error
}

AppConfigValidator provides functions to validate ApplicationConfiguration

type MutatingHandler

type MutatingHandler struct {
	Client client.Client

	// Decoder decodes objects
	Decoder *admission.Decoder
}

MutatingHandler handles Component

func (*MutatingHandler) Handle

Handle handles admission requests.

func (*MutatingHandler) InjectClient

func (h *MutatingHandler) InjectClient(c client.Client) error

InjectClient injects the client into the ComponentMutatingHandler

func (*MutatingHandler) InjectDecoder

func (h *MutatingHandler) InjectDecoder(d *admission.Decoder) error

InjectDecoder injects the decoder into the ComponentMutatingHandler

func (*MutatingHandler) Mutate

Mutate sets all the default value for the Component

type ValidatingAppConfig

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

ValidatingAppConfig is used for validating ApplicationConfiguration

func (*ValidatingAppConfig) PrepareForValidation

PrepareForValidation prepares data for validations to avoiding repetitive GET/unmarshal operations

type ValidatingComponent

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

ValidatingComponent is used for validatiing ApplicationConfigurationComponent

type ValidatingHandler

type ValidatingHandler struct {
	Client client.Client
	Mapper discoverymapper.DiscoveryMapper

	// Decoder decodes objects
	Decoder *admission.Decoder

	Validators []AppConfigValidator
}

ValidatingHandler handles CloneSet

func (*ValidatingHandler) Handle

Handle validate ApplicationConfiguration Spec here

func (*ValidatingHandler) InjectClient

func (h *ValidatingHandler) InjectClient(c client.Client) error

InjectClient injects the client into the ValidatingHandler

func (*ValidatingHandler) InjectDecoder

func (h *ValidatingHandler) InjectDecoder(d *admission.Decoder) error

InjectDecoder injects the decoder into the ValidatingHandler

func (*ValidatingHandler) ValidateCreate added in v1.0.0

ValidateCreate validates the Application on creation

func (*ValidatingHandler) ValidateUpdate added in v1.0.0

func (h *ValidatingHandler) ValidateUpdate(ctx context.Context, newApp, oldApp *v1alpha2.ApplicationConfiguration) field.ErrorList

ValidateUpdate validates the Application on update

type ValidatingTrait

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

ValidatingTrait is used for validating Trait

Jump to

Keyboard shortcuts

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