Documentation
¶
Index ¶
- func GroupVersionResourceFromGVK(unstructured *unstructured.Unstructured) (gvr schema.GroupVersionResource)
- func SimpleInstaller() *simpleInstaller
- func TransformArtifactToUnstructuredList(list ArtifactList) (unstructuredList []*unstructured.Unstructured, errs []error)
- func WithInstallUnstructuredUpdaterList(install Install, updaters []WithInstallUnstructuredUpdater) []k8s.UnstructuredMiddleware
- type Artifact
- type ArtifactList
- type ArtifactMiddleware
- type ArtifactToUnstructuredListTransformer
- type ConfigGetterFunc
- type ConfigUnmarshaller
- type FilterOptions
- type Install
- type InstallConfig
- type InstallConfigSpec
- type InstallENVKey
- type Installer
- type SetOptions
- type Uninstall
- type VersionArtifactLister
- type WithInstallUnstructuredUpdater
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GroupVersionResourceFromGVK ¶
func GroupVersionResourceFromGVK(unstructured *unstructured.Unstructured) (gvr schema.GroupVersionResource)
GroupVersionResourceFromGVK returns the GroupVersionResource information from the unstructured instance
func SimpleInstaller ¶
func SimpleInstaller() *simpleInstaller
SimpleInstaller returns a new instance of simpleInstaller
func TransformArtifactToUnstructuredList ¶
func TransformArtifactToUnstructuredList(list ArtifactList) (unstructuredList []*unstructured.Unstructured, errs []error)
TransformArtifactToUnstructuredList transforms a list of Artifacts to corresponding list of unstructured instances
NOTE:
This is an implementation of ArtifactToUnstructuredListTransformer
func WithInstallUnstructuredUpdaterList ¶
func WithInstallUnstructuredUpdaterList(install Install, updaters []WithInstallUnstructuredUpdater) []k8s.UnstructuredMiddleware
WithInstallUnstructuredUpdaterList returns a list of unstructured updaters based on install specs
Types ¶
type Artifact ¶
type Artifact struct {
// GroupVersionResource helps in identifying the artifact unambiguously
GroupVersionResource schema.GroupVersionResource
// Doc represents the JSON compatible artifact
Doc string
}
Artifact has the JSON compatible artifact that will be installed or applied
func WithGVRCasTemplateListUpdaterFor070 ¶
WithGVRCasTemplateListUpdaterFor070 updates list of given artifact instances with CASTemplate based Group Version Resource information
func WithGVRRunTaskListUpdaterFor070 ¶
WithGVRRunTaskListUpdaterFor070 updates list of given artifact instances with RunTask based Group Version Resource information
type ArtifactList ¶
type ArtifactList struct {
Items []*Artifact
}
ArtifactList is the list of artifacts that will be installed or uninstalled
func CstorVolumeArtifactsFor070 ¶
func CstorVolumeArtifactsFor070() (list ArtifactList)
CstorVolumeArtifactsFor070 returns the cstor volume related artifacts corresponding to version 0.7.0
func JivaVolumeArtifactsFor070 ¶
func JivaVolumeArtifactsFor070() (list ArtifactList)
JivaVolumeArtifactsFor070 returns the jiva volume related artifacts corresponding to version 0.7.0
func ListArtifactsByVersion ¶
func ListArtifactsByVersion(version string) (ArtifactList, error)
ListArtifactsByVersion returns artifacts based on the provided version
func RegisteredArtifactsFor070 ¶
func RegisteredArtifactsFor070() (finallist ArtifactList)
type ArtifactMiddleware ¶
ArtifactMiddleware abstracts updating a given artifact
func WithGVRCasTemplateUpdaterFor070 ¶
func WithGVRCasTemplateUpdaterFor070() ArtifactMiddleware
WithGVRCasTemplateUpdaterFor070 updates the given artifact instance with CASTemplate based Group Version Resource information
func WithGVRRunTaskUpdaterFor070 ¶
func WithGVRRunTaskUpdaterFor070() ArtifactMiddleware
WithGVRRunTaskUpdaterFor070 updates the given artifact instance with RunTask based Group Version Resource information
type ArtifactToUnstructuredListTransformer ¶
type ArtifactToUnstructuredListTransformer func(list ArtifactList) ([]*unstructured.Unstructured, []error)
ArtifactToUnstructuredListTransformer abstracts transforming a list of Artifacts to corresponding list of unstructured instances
type ConfigGetterFunc ¶
type ConfigGetterFunc func(name string) (config *InstallConfig, err error)
ConfigGetterFunc abstracts fetching an instance of install config
func WithConfigMapConfigGetter ¶
func WithConfigMapConfigGetter(getter k8s.ConfigMapGetter) ConfigGetterFunc
WithConfigMapConfigGetter returns an instance of ConfigGetterFunc that is capable of fetching install config from a kubernetes ConfigMap
NOTE:
The name of the install config is also the name of the ConfigMap that embeds
this install config specifications.
type ConfigUnmarshaller ¶
type ConfigUnmarshaller func(conf string) (config *InstallConfig, err error)
ConfigUnmarshaller abstracts un-marshalling of config specifications into an instance of install config
type FilterOptions ¶
type FilterOptions struct {
// Namespace to be considered
Namespace string `json:"namespace"`
// LabelSelector to be considered
LabelSelector string `json:"labelSelector"`
}
FilterOptions is used to filter the resources based on the values specified in this structure
type Install ¶
type Install struct {
// Version to be considered to install
Version string `json:"version"`
// SetOptions will override the defaults of this install version
SetOptions SetOptions `json:"set"`
}
Install provides metadata information about one or more artifacts that need to be installed
type InstallConfig ¶
type InstallConfig struct {
Spec InstallConfigSpec `json:"spec"`
}
func UnmarshallConfig ¶
func UnmarshallConfig(conf string) (*InstallConfig, error)
UnmarshallConfig is an implementation of ConfigUnmarshaller
type InstallConfigSpec ¶
type InstallConfigSpec struct {
// Install caters to installation of artifacts that are understood by
// installer
//
// NOTE:
// Only specific artifacts can be installed
Install []Install `json:"install"`
// Uninstall caters to un-installation of artifacts that are understood
// by installer
//
// NOTE:
// Only specific resources can be un-installed
Uninstall []Uninstall `json:"uninstall"`
}
type InstallENVKey ¶
type InstallENVKey string
InstallENVKey is a typed string to represent various environment keys used for install
const ( // EnvKeyForInstallConfigName is the environment variable to get the // the install config's name EnvKeyForInstallConfigName InstallENVKey = "OPENEBS_IO_INSTALL_CONFIG_NAME" // EnvKeyForInstallConfigNamespace is the environment variable to get // the install config's namespace EnvKeyForInstallConfigNamespace InstallENVKey = InstallENVKey(string(commonenv.EnvKeyForOpenEBSNamespace)) )
type Installer ¶
type Installer interface {
Install() (errors []error)
}
Installer abstracts installation
type SetOptions ¶
type SetOptions struct {
// Namespace to be set against the artifacts before install
Namespace string `json:"namespace"`
// Labels to be set against the artifacts before install
Labels map[string]string `json:"labels"`
// Annotations to be set against the artifacts before install
Annotations map[string]string `json:"annotations"`
}
SetOptions will override this install version resource(s) with these values
type Uninstall ¶
type Uninstall struct {
// Version to be considered to un-install
Version string `json:"version"`
// FilterOptions will filter the resources to be un-installed
FilterOptions FilterOptions `json:"filter"`
}
Uninstall provides metadata information about one or more artifacts that need to be un-installed
type VersionArtifactLister ¶
type VersionArtifactLister func(version string) (ArtifactList, error)
VersionArtifactLister abstracts fetching a list of artifacts based on provided version
type WithInstallUnstructuredUpdater ¶
type WithInstallUnstructuredUpdater func(install Install) k8s.UnstructuredMiddleware
WithInstallUnstructuredUpdater abstracts updating Unstructured instance based on install specs