seed

package
v2.14.9+incompatible Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2020 License: Apache-2.0 Imports: 18 Imported by: 22

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EnsureSingleSeedValidator

type EnsureSingleSeedValidator struct {
	Name      string
	Namespace string
}

EnsureSingleSeedValidator ensures that only the seed with the given Name and Namespace can be created.

func (EnsureSingleSeedValidator) Validate

type Server

type Server struct {
	*http.Server
	// contains filtered or unexported fields
}

func (*Server) NeedLeaderElection

func (s *Server) NeedLeaderElection() bool

func (*Server) Start

func (s *Server) Start(_ <-chan struct{}) error

Start implements sigs.k8s.io/controller-runtime/pkg/manager.Runnable

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

Validate returns an error if the given seed does not pass all validation steps.

type WebhookOpts

type WebhookOpts struct {
	ListenAddress string
	CertFile      string
	KeyFile       string
}

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.

Jump to

Keyboard shortcuts

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