helm

package
v0.0.0-...-e2048a1 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 38 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ExportGetValuesForHelmChart     = getValuesForHelmChart
	ExportNewHelmAction             = newHelmAction
	ExportDiffAgainstLiveObjects    = diffAgainstLiveObjects
	ExportConfigureChartPathOptions = configureChartPathOptions
	ExportGreenhouseFieldManager    = greenhouseFieldManager
	ExportDiffAgainstRelease        = diffAgainstRelease
	ExportInstallHelmRelease        = installRelease
)
View Source
var (

	// IsHelmDebug is configured via a flag and enables extensive debug logging for Helm actions.
	IsHelmDebug bool
)

Functions

func GetReleaseForHelmChartFromPlugin

func GetReleaseForHelmChartFromPlugin(_ context.Context, restClientGetter genericclioptions.RESTClientGetter, plugin *greenhousev1alpha1.Plugin) (*release.Release, error)

GetReleaseForHelmChartFromPlugin returns the Helm release for the given Plugin or an error.

func InstallOrUpgradeHelmChartFromPlugin

func InstallOrUpgradeHelmChartFromPlugin(ctx context.Context, local client.Client, restClientGetter genericclioptions.RESTClientGetter, pluginDefinition *greenhousev1alpha1.PluginDefinition, plugin *greenhousev1alpha1.Plugin) error

InstallOrUpgradeHelmChartFromPlugin installs a new or upgrades an existing Helm release for the given PluginDefinition and Plugin.

func ObjectMapFromManifest

func ObjectMapFromManifest(restClientGetter genericclioptions.RESTClientGetter, namespace, manifest string, f *ManifestObjectFilter) (map[ObjectKey]*ManifestObject, error)

ObjectMapFromManifest returns a map of objects from the manifests matching the filter or an error.

func ObjectMapFromRelease

func ObjectMapFromRelease(restClientGetter genericclioptions.RESTClientGetter, r *release.Release, f *ManifestObjectFilter) (map[ObjectKey]*ManifestObject, error)

ObjectMapFromRelease returns a map of objects from the helm release manifest matching the filter or an error.

func ResetHelmReleaseStatusToDeployed

func ResetHelmReleaseStatusToDeployed(ctx context.Context, restClientGetter genericclioptions.RESTClientGetter, plugin *greenhousev1alpha1.Plugin) error

ResetHelmReleaseStatusToDeployed resets the status of the release to deployed using a rollback.

func TemplateHelmChartFromPlugin

func TemplateHelmChartFromPlugin(ctx context.Context, local client.Client, restClientGetter genericclioptions.RESTClientGetter, pluginDefinition *greenhousev1alpha1.PluginDefinition, plugin *greenhousev1alpha1.Plugin) (string, error)

TemplateHelmChartFromPlugin returns the rendered manifest or an error.

func UninstallHelmRelease

func UninstallHelmRelease(ctx context.Context, restClientGetter genericclioptions.RESTClientGetter, plugin *greenhousev1alpha1.Plugin) (releaseNotFound bool, err error)

UninstallHelmRelease removes the Helm release for the given Plugin.

Types

type ChartLoaderFunc

type ChartLoaderFunc func(name string) (*chart.Chart, error)
var ChartLoader ChartLoaderFunc = loader.Load

type DiffObject

type DiffObject struct {
	// Name is the GVK and namespaced name of the involved Kubernetes object.
	Name,

	Diff string
}

DiffObject is a Kubernetes object where the deployed state differs from the one in the Helm chart manifest.

type DiffObjectList

type DiffObjectList []DiffObject

DiffObjectList is a list of DiffObjects.

func DiffChartToDeployedResources

func DiffChartToDeployedResources(ctx context.Context, local client.Client, restClientGetter genericclioptions.RESTClientGetter, pluginDefinition *greenhousev1alpha1.PluginDefinition, plugin *greenhousev1alpha1.Plugin) (diffs DiffObjectList, isDrift bool, err error)

DiffChartToDeployedResources returns whether the Kubernetes objects, as specified in the Helm chart manifest, differ from the deployed state.

func (DiffObjectList) String

func (d DiffObjectList) String() string

String returns the string of the DiffObjectList.

type ManifestObject

type ManifestObject struct {
	Namespace,
	Name string
	Object runtime.Object
}

ManifestObject represents an object in a Helm manifest.

type ManifestObjectFilter

type ManifestObjectFilter struct {
	APIVersion,
	Kind string
	Labels map[string]string
}

ManifestObjectFilter is used to filter for objects in a Helm manifest.

func (*ManifestObjectFilter) Matches

func (o *ManifestObjectFilter) Matches(obj *resource.Info) bool

Matches returns true if the given object matches the filter.

type ObjectKey

type ObjectKey struct {
	GVK       schema.GroupVersionKind
	Namespace string
	Name      string
}

ObjectKey is a unique key for a ManifestObject.

Jump to

Keyboard shortcuts

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