Documentation ¶
Index ¶
- Constants
- func RegisterMutatingHandler(mgr manager.Manager)
- func RegisterValidatingHandler(mgr manager.Manager, args controller.Args)
- func ValidateRevisionNameFn(_ context.Context, v ValidatingAppConfig) []error
- func ValidateTraitAppliableToWorkloadFn(_ context.Context, v ValidatingAppConfig) []error
- func ValidateTraitConflictFn(_ context.Context, v ValidatingAppConfig) []error
- func ValidateWorkloadNameForVersioningFn(_ context.Context, v ValidatingAppConfig) []error
- type AppConfigValidateFunc
- type AppConfigValidator
- type MutatingHandler
- func (h *MutatingHandler) Handle(ctx context.Context, req admission.Request) admission.Response
- func (h *MutatingHandler) InjectClient(c client.Client) error
- func (h *MutatingHandler) InjectDecoder(d *admission.Decoder) error
- func (h *MutatingHandler) Mutate(ctx context.Context, obj *v1alpha2.ApplicationConfiguration) error
- type ValidatingAppConfig
- type ValidatingComponent
- type ValidatingHandler
- func (h *ValidatingHandler) Handle(ctx context.Context, req admission.Request) admission.Response
- func (h *ValidatingHandler) InjectClient(c client.Client) error
- func (h *ValidatingHandler) InjectDecoder(d *admission.Decoder) error
- func (h *ValidatingHandler) ValidateCreate(ctx context.Context, obj *v1alpha2.ApplicationConfiguration) field.ErrorList
- func (h *ValidatingHandler) ValidateUpdate(ctx context.Context, newApp, oldApp *v1alpha2.ApplicationConfiguration) field.ErrorList
- type ValidatingTrait
Constants ¶
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" )
const (
// WorkloadNamePath indicates field path of workload name
WorkloadNamePath = "metadata.name"
)
Variables ¶
This section is empty.
Functions ¶
func RegisterMutatingHandler ¶
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 ¶
func (fn AppConfigValidateFunc) Validate(ctx context.Context, v ValidatingAppConfig) []error
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) 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 ¶
func (h *MutatingHandler) Mutate(ctx context.Context, obj *v1alpha2.ApplicationConfiguration) error
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 ¶
func (v *ValidatingAppConfig) PrepareForValidation(ctx context.Context, c client.Reader, dm discoverymapper.DiscoveryMapper, ac *v1alpha2.ApplicationConfiguration) error
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) 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
func (h *ValidatingHandler) ValidateCreate(ctx context.Context, obj *v1alpha2.ApplicationConfiguration) field.ErrorList
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