handlerspi

package
v0.0.0-...-a7b7215 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: UPL-1.0 Imports: 3 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChartVersion

type ChartVersion struct {
	Name              string `json:"name"`
	DefaultVersion    string `json:"defaultVersion,omitempty"`
	SupportedVersions string `json:"supportedVersions,omitempty"`
}

ChartVersion contains the helm chart version

type HandlerContext

type HandlerContext struct {
	ctrlclient.Client
	Log    vzlog.VerrazzanoLogger
	DryRun bool
	CR     interface{}
	HelmInfo
}

HandlerContext contains the handler contexts for the API handler methods

type HelmChart

type HelmChart struct {
	Name    string `json:"name"`
	Version string `json:"version,omitempty"`
	Path    string `json:"path,omitempty"`
}

HelmChart contains the local HelmChart information

type HelmChartRepository

type HelmChartRepository struct {
	Name              string `json:"name"`
	URI               string `json:"uri"`
	CredentialsSecret string `json:"credentialsSecret,omitempty"`
}

HelmChartRepository contains the HelmRelease information

type HelmInfo

type HelmInfo struct {
	// HelmRelease contains Helm release information
	*HelmRelease
}

HelmInfo contains all the information need to manage the of Helm releases

type HelmRelease

type HelmRelease struct {
	Name       string              `json:"name"`
	Namespace  string              `json:"namespace,omitempty"`
	ChartInfo  HelmChart           `json:"chart,omitempty"`
	Repository HelmChartRepository `json:"repo,omitempty"`
}

HelmRelease contains the HelmRelease information

type MigrationHandler

type MigrationHandler interface {
	// UpdateStatusIfAlreadyInstalled updates the status if the Module has already been installed
	// without a Module CR by some external actor (such as Verrazzano).
	UpdateStatusIfAlreadyInstalled(context HandlerContext) result.Result
}

MigrationHandler is used when migrating from non-modules on a cluster to modules

type ModuleHandlerInfo

type ModuleHandlerInfo struct {
	DeleteActionHandler  StateMachineHandler
	InstallActionHandler StateMachineHandler
	UpdateActionHandler  StateMachineHandler
	UpgradeActionHandler StateMachineHandler

	// MigrationHandler is used when migrating from non-modules on a cluster to modules. This is optional.
	MigrationHandler
}

ModuleHandlerInfo contains the Module handler interfaces.

type StateMachineHandler

type StateMachineHandler interface {
	// GetWorkName returns the work name
	GetWorkName() string

	// IsWorkNeeded returns true if work is needed for the Module
	IsWorkNeeded(context HandlerContext) (bool, result.Result)

	// CheckDependencies checks if dependencies are ready
	CheckDependencies(context HandlerContext) result.Result

	// PreWorkUpdateStatus does the pre-work status update
	PreWorkUpdateStatus(context HandlerContext) result.Result

	// PreWork does pre-work
	PreWork(context HandlerContext) result.Result

	// DoWorkUpdateStatus does the work status update
	DoWorkUpdateStatus(context HandlerContext) result.Result

	// DoWork does the work
	DoWork(context HandlerContext) result.Result

	// IsWorkDone returns true if work is done
	IsWorkDone(context HandlerContext) (bool, result.Result)

	// PostWorkUpdateStatus does the post-work status update
	PostWorkUpdateStatus(context HandlerContext) result.Result

	// PostWork does  post-work
	PostWork(context HandlerContext) result.Result

	// WorkCompletedUpdateStatus does the completed work status update
	WorkCompletedUpdateStatus(context HandlerContext) result.Result
}

StateMachineHandler is the interface called by the state machine to do module related work

Jump to

Keyboard shortcuts

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