initializer

package
v1.11.3 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2023 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Overview

Package initializer initializes a new installation of Crossplane.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CRDWaiter

type CRDWaiter struct {
	Names   []string
	Timeout time.Duration
	Period  time.Duration
	// contains filtered or unexported fields
}

CRDWaiter blocks the execution until all the CRDs whose names are given are deployed to the cluster.

func NewCRDWaiter

func NewCRDWaiter(names []string, timeout time.Duration, period time.Duration, log logging.Logger) *CRDWaiter

NewCRDWaiter returns a new *CRDWaiter initializer.

func (*CRDWaiter) Run

func (cw *CRDWaiter) Run(ctx context.Context, kube client.Client) error

Run continuously checks whether the list of CRDs whose names are given are present in the cluster.

type CertificateGenerator added in v1.7.0

type CertificateGenerator interface {
	Generate(domain ...string) (key []byte, crt []byte, err error)
}

CertificateGenerator can return you TLS certificate valid for given domains.

type CoreCRDs

type CoreCRDs struct {
	Path                string
	Scheme              *runtime.Scheme
	WebhookTLSSecretRef *types.NamespacedName
	// contains filtered or unexported fields
}

CoreCRDs makes sure the CRDs are installed.

func NewCoreCRDs

func NewCoreCRDs(path string, s *runtime.Scheme, opts ...CoreCRDsOption) *CoreCRDs

NewCoreCRDs returns a new *CoreCRDs.

func (*CoreCRDs) Run

func (c *CoreCRDs) Run(ctx context.Context, kube client.Client) error

Run applies all CRDs in the given directory.

type CoreCRDsOption added in v1.7.0

type CoreCRDsOption func(*CoreCRDs)

CoreCRDsOption configures CoreCRDs step.

func WithFs added in v1.7.0

func WithFs(fs afero.Fs) CoreCRDsOption

WithFs is used to configure the filesystem the CRDs will be read from. Its default is afero.OsFs.

func WithWebhookTLSSecretRef added in v1.7.0

func WithWebhookTLSSecretRef(nn types.NamespacedName) CoreCRDsOption

WithWebhookTLSSecretRef configures CoreCRDs with the TLS Secret name so that it can fetch it and inject the CA bundle to CRDs with webhook conversion strategy.

type Initializer

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

Initializer makes sure the CRDs Crossplane reconciles are ready to go before starting main Crossplane routines.

func New

func New(kube client.Client, log logging.Logger, steps ...Step) *Initializer

New returns a new *Initializer.

func (*Initializer) Init

func (c *Initializer) Init(ctx context.Context) error

Init does all operations necessary for controllers and webhooks to work.

type LockObject

type LockObject struct{}

LockObject has the initializer for creating the Lock object.

func NewLockObject

func NewLockObject() *LockObject

NewLockObject returns a new *LockObject initializer.

func (*LockObject) Run

func (lo *LockObject) Run(ctx context.Context, kube client.Client) error

Run makes sure Lock object exists.

type PackageInstaller

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

PackageInstaller has the initializer for installing a list of packages.

func NewPackageInstaller

func NewPackageInstaller(p []string, c []string) *PackageInstaller

NewPackageInstaller returns a new package installer.

func (*PackageInstaller) Run

func (pi *PackageInstaller) Run(ctx context.Context, kube client.Client) error

Run makes sure all specified packages exist.

type RootCAGenerator added in v1.7.0

type RootCAGenerator struct{}

RootCAGenerator generates a root CA and key that can be used by client and servers.

func NewRootCAGenerator added in v1.7.0

func NewRootCAGenerator() *RootCAGenerator

NewRootCAGenerator returns a new RootCAGenerator.

func (*RootCAGenerator) Generate added in v1.7.0

func (*RootCAGenerator) Generate(domains ...string) (key []byte, crt []byte, err error)

Generate creates TLS Secret with 10 years expiration date that is valid for the given domains.

type Step

type Step interface {
	Run(ctx context.Context, kube client.Client) error
}

Step is a blocking step of the initialization process.

type StoreConfigObject added in v1.7.0

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

StoreConfigObject has the initializer for creating the default secret StoreConfig.

func NewStoreConfigObject added in v1.7.0

func NewStoreConfigObject(ns string) *StoreConfigObject

NewStoreConfigObject returns a new *StoreConfigObject initializer.

func (*StoreConfigObject) Run added in v1.7.0

func (so *StoreConfigObject) Run(ctx context.Context, kube client.Client) error

Run makes sure a StoreConfig named as default exists.

type WebhookCertificateGenerator added in v1.7.0

type WebhookCertificateGenerator struct {
	SecretRef        types.NamespacedName
	ServiceNamespace string
	// contains filtered or unexported fields
}

WebhookCertificateGenerator is an initializer step that will find the given secret and fill its tls.crt and tls.key fields with a TLS certificate that is signed for *.<namespace>.svc domains so that all webhooks in that namespace can use it.

func NewWebhookCertificateGenerator added in v1.7.0

func NewWebhookCertificateGenerator(nn types.NamespacedName, svcNamespace string, log logging.Logger, opts ...WebhookCertificateGeneratorOption) *WebhookCertificateGenerator

NewWebhookCertificateGenerator returns a new WebhookCertificateGenerator.

func (*WebhookCertificateGenerator) Run added in v1.7.0

Run generates the TLS certificate valid for *.<namespace>.svc domain and updates the given secret.

type WebhookCertificateGeneratorOption added in v1.7.0

type WebhookCertificateGeneratorOption func(*WebhookCertificateGenerator)

WebhookCertificateGeneratorOption is used to configure WebhookCertificateGenerator behavior.

func WithCertificateGenerator added in v1.7.0

func WithCertificateGenerator(cg CertificateGenerator) WebhookCertificateGeneratorOption

WithCertificateGenerator sets the CertificateGenerator that WebhookCertificateGenerator uses.

type WebhookConfigurations added in v1.7.0

type WebhookConfigurations struct {
	Path             string
	Scheme           *runtime.Scheme
	TLSSecretRef     types.NamespacedName
	ServiceReference admv1.ServiceReference
	// contains filtered or unexported fields
}

WebhookConfigurations makes sure the ValidatingWebhookConfigurations and MutatingWebhookConfiguration are installed.

func NewWebhookConfigurations added in v1.7.0

func NewWebhookConfigurations(path string, s *runtime.Scheme, tlsSecretRef types.NamespacedName, svc admv1.ServiceReference, opts ...WebhookConfigurationsOption) *WebhookConfigurations

NewWebhookConfigurations returns a new *WebhookConfigurations.

func (*WebhookConfigurations) Run added in v1.7.0

Run applies all webhook ValidatingWebhookConfigurations and MutatingWebhookConfiguration in the given directory.

type WebhookConfigurationsOption added in v1.7.0

type WebhookConfigurationsOption func(*WebhookConfigurations)

WebhookConfigurationsOption configures WebhookConfigurations step.

func WithWebhookConfigurationsFs added in v1.7.0

func WithWebhookConfigurationsFs(fs afero.Fs) WebhookConfigurationsOption

WithWebhookConfigurationsFs is used to configure the filesystem the CRDs will be read from. Its default is afero.OsFs.

Jump to

Keyboard shortcuts

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