Documentation
¶
Index ¶
- Constants
- Variables
- func CreateActionConfig(includeRelease bool, releaseName string, releaseStatus release.Status, ...) (*action.Configuration, error)
- func GetConfigMapOverrides(log vzlog.VerrazzanoLogger, client client.Client, ...) (string, error)
- func GetHelmReleaseStatus(releaseName string, namespace string) (string, error)
- func GetInstallOverridesYAML(log vzlog.VerrazzanoLogger, client client.Client, overrides []ValueOverrides, ...) ([]string, error)
- func GetRelease(log vzlog.VerrazzanoLogger, releaseName string, namespace string) (*release.Release, error)
- func GetReleaseAppVersion(releaseName string, namespace string) (string, error)
- func GetReleaseStatus(log vzlog.VerrazzanoLogger, releaseName string, namespace string) (status string, err error)
- func GetReleaseStringValues(log vzlog.VerrazzanoLogger, valueKeys []string, releaseName string, ...) (map[string]string, error)
- func GetReleaseValues(log vzlog.VerrazzanoLogger, valueKeys []string, releaseName string, ...) (map[string]interface{}, error)
- func GetSecretOverrides(log vzlog.VerrazzanoLogger, client client.Client, ...) (string, error)
- func GetValues(log vzlog.VerrazzanoLogger, releaseName string, namespace string) ([]byte, error)
- func GetValuesMap(log vzlog.VerrazzanoLogger, releaseName string, namespace string) (map[string]interface{}, error)
- func HelmValueFileConstructor(kvs []KeyValue) (string, error)
- func IsReleaseDeployed(releaseName string, namespace string) (found bool, err error)
- func IsReleaseFailed(releaseName string, namespace string) (bool, error)
- func IsReleaseInstalled(releaseName string, namespace string) (found bool, err error)
- func SetActionConfigFunction(f ActionConfigFnType)
- func SetChartInfoFunction(f ChartInfoFnType)
- func SetDefaultActionConfigFunction()
- func SetDefaultChartInfoFunction()
- func SetDefaultLoadChartFunction()
- func SetLoadChartFunction(f LoadChartFnType)
- func Uninstall(log vzlog.VerrazzanoLogger, releaseName string, namespace string, dryRun bool) (err error)
- func Upgrade(log vzlog.VerrazzanoLogger, releaseName string, namespace string, ...) (*release.Release, error)
- func UpgradeRelease(log vzlog.VerrazzanoLogger, releaseOpts *HelmReleaseOpts, wait bool, ...) (*release.Release, error)
- type ActionConfigFnType
- type ChartInfo
- type ChartInfoFnType
- type ChartStatusFnType
- type CreateReleaseFnType
- type HelmOverrides
- type HelmReleaseOpts
- type KeyValue
- type LoadChartFnType
- type ValueOverrides
Constants ¶
const ReleaseNotFound = "NotFound"
Helm chart status values: unknown, deployed, uninstalled, superseded, failed, uninstalling, pending-install, pending-upgrade or pending-rollback
const ReleaseStatusDeployed = "deployed"
const ReleaseStatusFailed = "failed"
const ReleaseStatusPendingInstall = "pending-install"
const ReleaseStatusUnknown = "unknown"
Variables ¶
var Debug bool
Debug is set from a platform-operator arg and sets the helm --debug flag
Functions ¶
func CreateActionConfig ¶
func CreateActionConfig(includeRelease bool, releaseName string, releaseStatus release.Status, log vzlog.VerrazzanoLogger, createReleaseFn CreateReleaseFnType) (*action.Configuration, error)
func GetConfigMapOverrides ¶
func GetConfigMapOverrides(log vzlog.VerrazzanoLogger, client client.Client, selector *v1.ConfigMapKeySelector, namespace string) (string, error)
GetConfigMapOverrides takes a ConfigMap selector and returns the YAML data and handles k8s api errors appropriately
func GetHelmReleaseStatus ¶
GetHelmReleaseStatus extracts the Helm deployment status of the specified chart from the JSON output as a string
func GetInstallOverridesYAML ¶
func GetInstallOverridesYAML(log vzlog.VerrazzanoLogger, client client.Client, overrides []ValueOverrides, mlcNamespace string) ([]string, error)
GetInstallOverridesYAML takes the list of ValuesFrom and returns a string array of YAMLs
func GetRelease ¶
func GetRelease(log vzlog.VerrazzanoLogger, releaseName string, namespace string) (*release.Release, error)
GetRelease will run 'helm get all' command and return the output from the command.
func GetReleaseAppVersion ¶
GetReleaseAppVersion - public function to execute releaseAppVersionFn
func GetReleaseStatus ¶
func GetReleaseStatus(log vzlog.VerrazzanoLogger, releaseName string, namespace string) (status string, err error)
GetReleaseStatus returns the helmRelease status
func GetReleaseStringValues ¶
func GetReleaseStringValues(log vzlog.VerrazzanoLogger, valueKeys []string, releaseName string, namespace string) (map[string]string, error)
GetReleaseStringValues - Returns a subset of Helm helmRelease values as a map of strings
func GetReleaseValues ¶
func GetReleaseValues(log vzlog.VerrazzanoLogger, valueKeys []string, releaseName string, namespace string) (map[string]interface{}, error)
GetReleaseValues - Returns a subset of Helm helmRelease values as a map of objects
func GetSecretOverrides ¶
func GetSecretOverrides(log vzlog.VerrazzanoLogger, client client.Client, selector *v1.SecretKeySelector, namespace string) (string, error)
GetSecretOverrides takes a Secret selector and returns the YAML data and handles k8s api errors appropriately
func GetValues ¶
GetValues will run 'helm get values' command and return the output from the command.
func GetValuesMap ¶
func GetValuesMap(log vzlog.VerrazzanoLogger, releaseName string, namespace string) (map[string]interface{}, error)
GetValuesMap will run 'helm get values' command and return the output from the command.
func HelmValueFileConstructor ¶
HelmValueFileConstructor creates a YAML file from a set of key value pairs
func IsReleaseDeployed ¶
IsReleaseDeployed returns true if the helmRelease is deployed
func IsReleaseFailed ¶
IsReleaseFailed Returns true if the chart helmRelease state is marked 'failed'
func IsReleaseInstalled ¶
IsReleaseInstalled returns true if the helmRelease is installed
func SetActionConfigFunction ¶
func SetActionConfigFunction(f ActionConfigFnType)
func SetChartInfoFunction ¶
func SetChartInfoFunction(f ChartInfoFnType)
SetChartInfoFunction Override the chart info function for unit testing
func SetDefaultActionConfigFunction ¶
func SetDefaultActionConfigFunction()
SetDefaultActionConfigFunction Resets the action config function
func SetDefaultChartInfoFunction ¶
func SetDefaultChartInfoFunction()
SetDefaultChartInfoFunction Reset the chart info function
func SetDefaultLoadChartFunction ¶
func SetDefaultLoadChartFunction()
func SetLoadChartFunction ¶
func SetLoadChartFunction(f LoadChartFnType)
func Uninstall ¶
func Uninstall(log vzlog.VerrazzanoLogger, releaseName string, namespace string, dryRun bool) (err error)
Uninstall will uninstall the helmRelease in the specified namespace using helm uninstall
func Upgrade ¶
func Upgrade(log vzlog.VerrazzanoLogger, releaseName string, namespace string, chartDir string, wait bool, dryRun bool, overrides []HelmOverrides) (*release.Release, error)
Upgrade will upgrade a Helm helmRelease with the specified charts. The override files array are in order with the first files in the array have lower precedence than latter files.
func UpgradeRelease ¶
func UpgradeRelease(log vzlog.VerrazzanoLogger, releaseOpts *HelmReleaseOpts, wait bool, dryRun bool) (*release.Release, error)
Types ¶
type ActionConfigFnType ¶
type ActionConfigFnType func(log vzlog.VerrazzanoLogger, settings *cli.EnvSettings, namespace string) (*action.Configuration, error)
type ChartInfo ¶
type ChartInfo struct { APIVersion string Description string Name string Version string AppVersion string }
ChartInfo contains Helm Chart.yaml data
func GetChartInfo ¶
GetChartInfo - public entry point
type ChartInfoFnType ¶
ChartInfoFnType - Package-level var and functions to allow overriding getReleaseState for unit test purposes
type ChartStatusFnType ¶
ChartStatusFnType - Package-level var and functions to allow overriding GetChartStatus for unit test purposes
type CreateReleaseFnType ¶
type HelmOverrides ¶
type HelmOverrides struct { SetOverrides string // for --set SetStringOverrides string // for --set-string SetFileOverrides string // for --set-file FileOverride string // for -f }
HelmOverrides contains all the overrides that gets passed to the helm cli runner
func LoadOverrideFiles ¶
func LoadOverrideFiles(log vzlog.VerrazzanoLogger, client ctrlclient.Client, releaseName string, mlcNamespace string, moduleOverrides []ValueOverrides) ([]HelmOverrides, error)
LoadOverrideFiles loads the helm overrides into a set of files for a release. Return a list of Helm overrides which contain the filenames
type HelmReleaseOpts ¶
type KeyValue ¶
type KeyValue struct { Key string Value string SetString bool // for --set-string SetFile bool // for --set-file IsFile bool // for -f }
keyVal defines the Key, Value pair used to override a single helm Value
type ValueOverrides ¶
type ValueOverrides struct { // Selector for ConfigMap containing override data. // +optional ConfigMapRef *corev1.ConfigMapKeySelector `json:"configMapRef,omitempty"` // Selector for Secret containing override data. // +optional SecretRef *corev1.SecretKeySelector `json:"secretRef,omitempty"` // Configure overrides using inline YAML. // +optional Values *apiextensionsv1.JSON `json:"values,omitempty"` }
ValueOverrides identifies overrides for a Helm release.