chartutil

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2021 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// HelmChartsDir is the relative directory within an SDK project where Helm
	// charts are stored.
	HelmChartsDir string = "helm-charts"

	// DefaultGroup is the Kubernetes CRD API Group used for fetched
	// charts when the --group flag is not specified
	DefaultGroup string = "charts"

	// DefaultVersion is the Kubernetes CRD API Version used for fetched
	// charts when the --version flag is not specified
	DefaultVersion string = "v1alpha1"
)

Variables

This section is empty.

Functions

func CreateChart

func CreateChart(cfg config.Config, opts CreateOptions) (r *resource.Resource, c *chart.Chart, err error)

CreateChart creates a new helm chart based on the passed opts.

It returns a scaffold.Resource that can be used by the caller to create other related files. opts.ResourceAPIVersion and opts.ResourceKind are used to create the resource and must be specified if opts.Chart is empty.

If opts.Chart is not empty, opts.ResourceAPIVersion and opts.Kind can be left unset: opts.ResourceAPIVersion defaults to "charts.helm.k8s.io/v1alpha1" and opts.ResourceKind is deduced from the specified opts.Chart.

CreateChart also returns the newly created chart.Chart.

If opts.Chart is empty, CreateChart creates the default chart from helm's default template.

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

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

For any other value of opts.Chart, CreateChart 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, CreateChart will fetch the latest available version of the helm chart. Otherwise, CreateChart 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.

CreateChart returns an error if an error occurs creating the resource.Resource or loading the chart.Chart.

Types

type CreateOptions

type CreateOptions struct {
	GVK schema.GroupVersionKind

	// 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

	// CRDVersion is the version of the `apiextensions.k8s.io` API which will be used to generate the CRD.
	CRDVersion string

	// Domain is the domain of the project
	Domain string
}

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

func (CreateOptions) NewResource added in v1.5.0

func (opts CreateOptions) NewResource(cfg config.Config) *resource.Resource

Jump to

Keyboard shortcuts

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