setup

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDoguStepGenerator added in v0.4.0

func NewDoguStepGenerator(client kubernetes.Interface, clusterConfig *rest.Config, dogus context.Dogus, registry remote.Registry, namespace string) (*doguStepGenerator, error)

NewDoguStepGenerator creates a new generator capable of generating dogu installation steps.

func NewResourcePatchStep added in v0.16.0

func NewResourcePatchStep(phase patch.Phase, patcher resourcePatcher, patches []patch.ResourcePatch) *resourcePatchStep

NewResourcePatchStep creates a new setup step which patches arbitrary Kubernetes resources according the given setup phase.

func NewValidatorStep added in v0.4.0

func NewValidatorStep(registry remote.Registry, setupCtx *appcontext.SetupContext) *setupValidatorStep

NewValidatorStep creates a new setup step to validate the setup configuration.

func SetupAPI

func SetupAPI(ctx context.Context, router ginRoutes, clusterConfig *rest.Config, k8sClient kubernetes.Interface, setupContextBuilder *appcontext.SetupContextBuilder)

SetupAPI setups the REST API for configuration information

Types

type Executor

type Executor struct {
	// SetupContext contains information about the current context.
	SetupContext *appcontext.SetupContext
	// ClientSet is the actual k8s client responsible for the k8s API communication.
	ClientSet kubernetes.Interface
	// ClusterConfig is the current rest config used to create a kubernetes clients.
	ClusterConfig *rest.Config
	// Steps contains all necessary steps for the setup
	Steps []ExecutorStep
	// Registry is the dogu registry
	Registry remote.Registry
}

Executor is responsible to perform the actual steps of the setup.

func NewExecutor

func NewExecutor(clusterConfig *rest.Config, k8sClient kubernetes.Interface, setupCtx *appcontext.SetupContext) (*Executor, error)

NewExecutor creates a new setup executor with the given app configuration.

func (*Executor) PerformSetup

func (e *Executor) PerformSetup(ctx context.Context) (err error, errCausingAction string)

PerformSetup starts the setup and executes all registered setup steps

func (*Executor) RegisterComponentSetupSteps added in v0.4.0

func (e *Executor) RegisterComponentSetupSteps() error

RegisterComponentSetupSteps adds all setup steps responsible to install vital components into the ecosystem.

func (*Executor) RegisterDataSetupSteps added in v0.4.0

func (e *Executor) RegisterDataSetupSteps(etcdRegistry registry.Registry) error

RegisterDataSetupSteps adds all setup steps responsible to read, write, or verify data needed by the setup.

func (*Executor) RegisterDoguInstallationSteps added in v0.4.0

func (e *Executor) RegisterDoguInstallationSteps() error

RegisterDoguInstallationSteps creates install steps for the dogu install list

func (*Executor) RegisterLoadBalancerFQDNRetrieverSteps added in v0.16.0

func (e *Executor) RegisterLoadBalancerFQDNRetrieverSteps() error

RegisterLoadBalancerFQDNRetrieverSteps registers the steps for creating a loadbalancer retrieving the fqdn

func (*Executor) RegisterSSLGenerationStep added in v0.4.0

func (e *Executor) RegisterSSLGenerationStep() error

RegisterSSLGenerationStep registers all ssl steps

func (*Executor) RegisterSetupSteps added in v0.18.0

func (e *Executor) RegisterSetupSteps(steps ...ExecutorStep)

RegisterSetupSteps adds a new step to the setup

func (*Executor) RegisterValidationStep added in v0.4.0

func (e *Executor) RegisterValidationStep() error

RegisterValidationStep registers all validation steps

type ExecutorStep

type ExecutorStep interface {
	// GetStepDescription returns the description of the setup step. The Executor prints the description of every step
	// when executing the setup.
	GetStepDescription() string
	// PerformSetupStep is called for every registered step when executing the setup.
	PerformSetupStep(ctx context.Context) error
}

ExecutorStep describes a valid step in the setup.

type SetupExecutor added in v0.4.0

type SetupExecutor interface {
	// RegisterLoadBalancerFQDNRetrieverSteps registers the FQDN retriever step
	RegisterLoadBalancerFQDNRetrieverSteps() error
	// RegisterSSLGenerationStep registers all ssl steps
	RegisterSSLGenerationStep() error
	// RegisterValidationStep registers all validation steps
	RegisterValidationStep() error
	// RegisterComponentSetupSteps adds all setup steps responsible to install vital components into the ecosystem.
	RegisterComponentSetupSteps() error
	// RegisterDataSetupSteps adds all setup steps responsible to read, write, or verify data needed by the setup.
	RegisterDataSetupSteps(registry.Registry) error
	// RegisterDoguInstallationSteps creates install steps for the dogu install list
	RegisterDoguInstallationSteps() error
	// PerformSetup starts the setup and executes all registered setup steps
	PerformSetup(ctx context.Context) (error, string)
}

SetupExecutor is uses to register all necessary steps and executes them

type Starter added in v0.4.0

type Starter struct {
	EtcdRegistry  registry.Registry
	ClientSet     kubernetes.Interface
	ClusterConfig *rest.Config
	SetupContext  *appcontext.SetupContext
	Namespace     string
	SetupExecutor SetupExecutor
}

Starter is used to init and start the setup process

func NewStarter added in v0.4.0

func NewStarter(ctx context.Context, clusterConfig *rest.Config, k8sClient kubernetes.Interface, setupContextBuilder *appcontext.SetupContextBuilder) (*Starter, error)

NewStarter creates a new setup starter struct which one inits registries and starts the setup process

func (*Starter) StartSetup added in v0.4.0

func (s *Starter) StartSetup(ctx context.Context) error

StartSetup creates necessary k8s config and client, register steps and executes them

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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