Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EnsureSingleSeedValidator ¶
EnsureSingleSeedValidator ensures that only the seed with the given Name and Namespace can be created.
func (EnsureSingleSeedValidator) Validate ¶
func (e EnsureSingleSeedValidator) Validate(_ context.Context, seed *kubermaticv1.Seed, op admissionv1beta1.Operation) error
type Server ¶
func (*Server) NeedLeaderElection ¶
type ValidateFunc ¶
type ValidateFunc func(ctx context.Context, seed *kubermaticv1.Seed, op admissionv1beta1.Operation) error
ValidateFunc validates a Seed resource On DELETE, the only set fields of seed are Name and Namespace as admissionReview.Request.Object is unset
func CombineSeedValidateFuncs ¶
func CombineSeedValidateFuncs(funcs ...ValidateFunc) ValidateFunc
CombineSeedValidateFuncs combines two or more SeedValidateFunc by running them sequentially in the order they are given and returning an error at the first validation failure.
func SingleSeedValidateFunc ¶
func SingleSeedValidateFunc(namespace string) ValidateFunc
SingleSeedValidateFunc returns a SeedValidateFunc which ensures that a single Seed named with the default seed name in the given namespace is created. This validator is used for Kubermatic Community Edition.
type Validator ¶
type Validator struct {
// contains filtered or unexported fields
}
func NewDefaultSeedValidator ¶
func NewDefaultSeedValidator( workerName string, seedsGetter provider.SeedsGetter, seedClientGetter provider.SeedClientGetter, ) (*Validator, error)
func (*Validator) Validate ¶
func (sv *Validator) Validate(ctx context.Context, seed *kubermaticv1.Seed, op admissionv1beta1.Operation) error
Validate returns an error if the given seed does not pass all validation steps.
type WebhookOpts ¶
func (*WebhookOpts) AddFlags ¶
func (opts *WebhookOpts) AddFlags(fs *flag.FlagSet)
func (*WebhookOpts) Server ¶
func (opts *WebhookOpts) Server( ctx context.Context, log *zap.SugaredLogger, namespace string, validateFunc ValidateFunc, migrationModeEnabled bool) (*Server, error)
Server returns a Server that validates AdmissionRequests for Seed CRs. When migrationModeEnabled is enabled, only creating new seeds is allowed, not changing or deleting existing.