chartutil

package
v1.14.0 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// HelmChartsDir is the relative directory within a SDK project where Helm charts are stored.
	HelmChartsDir = "helm-charts"
)

Variables

This section is empty.

Functions

func LoadChart added in v1.6.0

func LoadChart(opts Options) (*chart.Chart, error)

LoadChart creates a new helm chart for the project based on the passed opts. It returns a chart.Chart that references the newly created chart or an error.

If opts.Chart is a local file, it verifies that it is a valid helm chart archive and returns its chart.Chart representation.

If opts.Chart is a local directory, it verifies that it is a valid helm chart directory and returns its chart.Chart representation.

For any other value of opts.Chart, it attempts to fetch the helm chart from a remote repository.

If opts.Repo is not specified, the following chart reference formats are supported:

  • <repoName>/<chartName>: Fetch the helm chart named chartName from the helm chart repository named repoName, as specified in the $HELM_HOME/repositories/repositories.yaml file.

  • <url>: Fetch the helm chart archive at the specified URL.

If opts.Repo is specified, only one chart reference format is supported:

  • <chartName>: Fetch the helm chart named chartName in the helm chart repository specified by opts.Repo

If opts.Version is not set, it will fetch the latest available version of the helm chart. Otherwise, it will fetch the specified version. opts.Version is not used when opts.Chart itself refers to a specific version, for example when it is a local path or a URL.

func NewChart added in v1.6.0

func NewChart(name string) (*chart.Chart, error)

NewChart creates a new helm chart for the project from helm's default template. It returns a chart.Chart that references the newly created chart or an error.

func ScaffoldChart added in v1.6.0

func ScaffoldChart(chrt *chart.Chart, projectDir string) (*chart.Chart, string, error)

ScaffoldChart scaffolds the provided chart.Chart to a known directory relative to projectDir

It also fetches the dependencies and reloads the chart.Chart

It returns the reloaded chart, the relative path, or an error.

Types

type Options added in v1.6.0

type Options struct {
	// Chart is a chart reference for a local or remote chart.
	Chart string

	// Repo is a URL to a custom chart repository.
	Repo string

	// Version is the version of the chart to fetch.
	Version string
}

Options is used to configure how a Helm chart is scaffolded for a new Helm operator project.

Jump to

Keyboard shortcuts

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