helm

package
v0.1.0-beta.10 Latest Latest
Warning

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

Go to latest
Published: May 22, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FieldTag = "helm"
)

Variables

View Source
var (
	// KubeVersion is the target version of the kubernetes.
	KubeVersion = "v1.20.0"
)

Functions

This section is empty.

Types

type LoadOptions

type LoadOptions struct {
	// ReleaseName is the name of the release.
	ReleaseName string

	// Namespace is the namespace of the release.
	Namespace string

	// ChartName is the name of the chart.
	ChartName string

	// ChartVersion is the version of the chart.
	ChartVersion string

	// FromCNRegion indicates whether to use the artifacts from CN region.
	FromCNRegion bool

	// ValuesOptions is the options for generating the helm values.
	ValuesOptions interface{}

	// ValuesFile is the path to the values file.
	ValuesFile string

	// EnableCache indicates whether to enable the cache.
	EnableCache bool
}

LoadOptions is the options for running LoadAndRenderChart.

type Loader

type Loader struct {
	// contains filtered or unexported fields
}

Loader is the Helm charts loader. The implementation is based on Helm SDK. The main purpose of Loader is: 1. Load the chart from remote charts and save them in cache directory. 2. Generate the manifests from the chart with the values.

func NewLoader

func NewLoader(l logger.Logger, opts ...Option) (*Loader, error)

func (*Loader) LoadAndRenderChart

func (r *Loader) LoadAndRenderChart(ctx context.Context, opts *LoadOptions) ([]byte, error)

LoadAndRenderChart loads the chart from the remote charts and render the manifests with the values.

type Option

type Option func(*Loader)

func WithHomeDir

func WithHomeDir(dir string) Option

type Values

type Values map[string]interface{}

Values is a map of helm values.

func NewFromFile

func NewFromFile(filename string) (Values, error)

NewFromFile creates a new Values from a local yaml values file.

func ToHelmValues

func ToHelmValues(input interface{}, valuesFile string) (Values, error)

ToHelmValues converts the input struct that contains special helm annotations `helm:"values"` and the local yaml values file to a map that can be used as helm values. If there is the same key in both the input struct and the local yaml values file, the value in the input struct will be used. valuesFile can be empty.

func (Values) OutputValues

func (v Values) OutputValues() ([]byte, error)

OutputValues returns the values as a yaml byte array.

Jump to

Keyboard shortcuts

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