helm

package
v0.0.0-...-0cee181 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2022 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertMapI2MapS

func ConvertMapI2MapS(v interface{}) interface{}

ConvertMapI2MapS walks the given dynamic object recursively, and converts maps with interface{} key type to maps with string key type. This function comes handy if you want to marshal a dynamic object into JSON where maps with interface{} key type are not allowed.

Recursion is implemented into values of the following types:

-map[interface{}]interface{}
-map[string]interface{}
-[]interface{}

When converting map[interface{}]interface{} to map[string]interface{}, fmt.Sprint() with default formatting is used to convert the key to a string key.

func FetchValue

func FetchValue(f interface{}, keys []string) (interface{}, error)

Fetches the value from provided keys

func New

func New(options *ClientOptions) (*clientImpl, error)

New returns a new Helm client with the provided options

Types

type ChartMetadata

type ChartMetadata struct {
	APIVersion   string `yaml:"apiVersion"`
	AppVersion   string `yaml:"appVersion"`
	Dependencies []struct {
		Condition  string `yaml:"condition"`
		Name       string `yaml:"name"`
		Repository string `yaml:"repository"`
		Version    string `yaml:"version"`
	} `yaml:"dependencies"`
	Description string `yaml:"description"`
	Name        string `yaml:"name"`
	Type        string `yaml:"type"`
	Version     string `yaml:"version"`
}

type ChartSpec

type ChartSpec struct {
	ReleaseName     string `json:"release"`
	ChartName       string `json:"chart"`
	Namespace       string `json:"namespace"`
	CreateNamespace bool   `json:"createNamespace"`

	// use string instead of map[string]interface{}
	// https://github.com/kubernetes-sigs/kubebuilder/issues/528#issuecomment-466449483
	// and https://github.com/kubernetes-sigs/controller-tools/pull/317
	// +optional
	ValuesYaml string `json:"valuesYaml,omitempty"`

	// files passed using --values / -f
	ValuesFiles []string `json:"valuesFiles,omitempty"`

	// +optional
	Version string `json:"version,omitempty"`

	// +optional
	DisableHooks bool `json:"disableHooks,omitempty"`

	// +optional
	Replace bool `json:"replace,omitempty"`

	// +optional
	Wait bool `json:"wait,omitempty"`

	// +optional
	Timeout time.Duration `json:"timeout,omitempty"`

	// +optional
	GenerateName bool `json:"generateName,omitempty"`

	// +optional
	NameTemplate string `json:"NameTemplate,omitempty"`

	// +optional
	Atomic bool `json:"atomic,omitempty"`

	// +optional
	SkipCRDs bool `json:"skipCRDs,omitempty"`

	// +optional
	UpgradeCRDs bool `json:"upgradeCRDs,omitempty"`

	// +optional
	SubNotes bool `json:"subNotes,omitempty"`

	// +optional
	Force bool `json:"force,omitempty"`

	// +optional
	ResetValues bool `json:"resetValues,omitempty"`

	// +optional
	ReuseValues bool `json:"reuseValues,omitempty"`

	// +optional
	Recreate bool `json:"recreate,omitempty"`

	// +optional
	MaxHistory int `json:"maxHistory,omitempty"`

	// +optional
	CleanupOnFail bool `json:"cleanupOnFail,omitempty"`

	// +optional
	DryRun bool `json:"dryRun,omitempty"`
}

ChartSpec defines the values of a helm chart

func (*ChartSpec) GetValuesMap

func (spec *ChartSpec) GetValuesMap() (map[string]interface{}, error)

GetValuesMap returns the mapped out values of a chart

type Client

type Client interface {
	AddOrUpdateChartRepo(rehistryName, repoURL string) error
	InstallOrUpgradeChart(ctx context.Context, spec *ChartSpec) (*release.Release, error)
	GetAllReleaseValues(name string) (map[string]interface{}, error)
	GetReleaseValues(name string) (map[string]interface{}, error)
	GetChartValues(name string) ([]byte, error)
	UninstallRelease(spec *ChartSpec) error
	GetDeployedChartMetadata(releaseName, namespace string) (*DeployedChartMetadata, error)
	ExportValuesFieldFromRelease(releaseName string, keys []string) (interface{}, error)
	ExportValuesFieldFromChart(chart string, customValuesFile string, keys []string) (interface{}, error)
	GetChartMetadata(chart string) (*ChartMetadata, error)
	GetValuesYamlFromChart(chart, file string) (interface{}, error)
	Close()
}

func NewClient

func NewClient(namespace string) Client

type ClientOptions

type ClientOptions struct {
	Namespace        string
	RepositoryConfig string
	RepositoryCache  string
	Debug            bool
	Linting          bool
	DebugLog         action.DebugLog
}

Options defines the options of a client

type DeployedChartMetadata

type DeployedChartMetadata struct {
	Name       string `json:"name"`
	Namespace  string `json:"namespace"`
	Revision   string `json:"revision"`
	Updated    string `json:"updated"`
	Status     string `json:"status"`
	Chart      string `json:"chart"`
	AppVersion string `json:"app_version"`
	Version    string
}

type ValuesOptions

type ValuesOptions struct {
	ValueFiles         []string
	StringValues       []string
	Values             []string
	ValuesYamlIndented map[string]interface{}
	FileValues         []string
}

func (*ValuesOptions) MergeValues

func (opts *ValuesOptions) MergeValues(p getter.Providers) (map[string]interface{}, error)

MergeValues merges values from files specified via -f/--values and directly via --set, --set-string, or --set-file, marshaling them to YAML

Jump to

Keyboard shortcuts

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