Documentation ¶
Index ¶
- Variables
- func IsNotImplemented(err error) bool
- func IsReleaseNotFound(err error) bool
- func MustRegister(name string, factory Factory)
- func Register(name string, factory Factory) error
- type Factory
- type Installer
- type InstallerOption
- type InstallerOptionFunc
- type InstallerOptions
- type Release
- type ReleaseStatus
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNotImplemented is the error returned if a method is not implemented. ErrNotImplemented = errors.New("installer: not implemented") // ErrReleaseNotFound indicates that a component release is not found. ErrReleaseNotFound = errors.New("installer: release not found") )
Functions ¶
func IsNotImplemented ¶
IsNotImplemented returns true if the specified error is ErrNotImplemented.
func IsReleaseNotFound ¶
IsReleaseNotFound returns true if the specified error is ErrReleaseNotFound.
func MustRegister ¶
MustRegister registers a Factory by name and panics if an error occurs.
Types ¶
type Factory ¶
type Factory func(options *InstallerOptions) (Installer, error)
Factory is a function that returns an Installer interface. An error is returned if the installer fails to initialize, nil otherwise.
func GetFactory ¶
GetFactory returns a Factory by name.
type Installer ¶
type Installer interface { // Get returns details of a component release by name. Get(name oceanv1alpha1.OceanComponentName) (*Release, error) // Install installs a component to a cluster. Install(component *oceanv1alpha1.OceanComponent) (*Release, error) // Uninstall uninstalls a component from a cluster. Uninstall(component *oceanv1alpha1.OceanComponent) error // Upgrade upgrades a component to a cluster. Upgrade(component *oceanv1alpha1.OceanComponent) (*Release, error) // IsUpgrade determines whether a component release is an upgrade. IsUpgrade(component *oceanv1alpha1.OceanComponent, release *Release) bool }
Installer defines the interface of a component installer.
func GetInstance ¶
func GetInstance(name string, options ...InstallerOption) (Installer, error)
GetInstance returns an instance of installer by name.
type InstallerOption ¶
type InstallerOption interface { // MutateInstallerOptions applies this configuration to the given InstallerOptions. MutateInstallerOptions(options *InstallerOptions) }
InstallerOption is some configuration that modifies options for an Installer.
func WithClientGetter ¶
func WithClientGetter(getter genericclioptions.RESTClientGetter) InstallerOption
WithClientGetter sets the given RESTClientGetter.
func WithNamespace ¶
func WithNamespace(namespace string) InstallerOption
WithNamespace sets the given namespace.
type InstallerOptionFunc ¶
type InstallerOptionFunc func(options *InstallerOptions)
InstallerOptionFunc is a convenience type like http.HandlerFunc.
func (InstallerOptionFunc) MutateInstallerOptions ¶
func (f InstallerOptionFunc) MutateInstallerOptions(options *InstallerOptions)
MutateInstallerOptions implements the InstallerOption interface.
type InstallerOptions ¶
type InstallerOptions struct { Namespace string ClientGetter genericclioptions.RESTClientGetter Log log.Logger }
type Release ¶
type Release struct { // Name is the name of the release. Name string `json:"name,omitempty"` // Version is a SemVer 2 conformant version string of the release. Version string `json:"version,omitempty"` // AppVersion is the version of the application enclosed inside of this release. AppVersion string `json:"appVersion,omitempty"` // Status is the current state of the release. Status ReleaseStatus `json:"status,omitempty"` // Description is human-friendly "log entry" about this release. Description string `json:"description,omitempty"` // Values is the set of extra values added to the release. Values map[string]interface{} `json:"values,omitempty"` }
Release describes a deployment of a component. For Helm-based components, it represents a Helm release (i.e. a chart installed into a cluster).
type ReleaseStatus ¶
type ReleaseStatus string
ReleaseStatus is the status of a release.
const ( // ReleaseStatusUnknown indicates that a release is in an uncertain state. ReleaseStatusUnknown ReleaseStatus = "Unknown" // ReleaseStatusDeployed indicates that a release has been deployed to Kubernetes. ReleaseStatusDeployed ReleaseStatus = "Deployed" // ReleaseStatusUninstalled indicates that a release has been uninstalled from Kubernetes. ReleaseStatusUninstalled ReleaseStatus = "Uninstalled" // ReleaseStatusFailed indicates that the release was not successfully deployed. ReleaseStatusFailed ReleaseStatus = "Failed" // ReleaseStatusProgressing indicates that a release is in progress. ReleaseStatusProgressing ReleaseStatus = "Progressing" )
These are valid release statuses.
func (ReleaseStatus) String ¶
func (x ReleaseStatus) String() string