helm

package
v0.47.3 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2019 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MergeHelmValues

func MergeHelmValues(baseValues, userValues, vendorValues string, preserveComments bool) (string, error)

MergeHelmValues merges user edited values from state file and vendor values from upstream Helm repo. base is the original config from state user is the modified config from state vendor is the new config from current chart Value priorities: user, vendor, base

Types

type ChartFetcher

type ChartFetcher interface {
	FetchChart(
		ctx context.Context,
		asset api.HelmAsset,
		renderRoot string,
		meta api.ReleaseMetadata,
		configGroups []libyaml.ConfigGroup,
		templateContext map[string]interface{},
	) (string, error)
}

ChartFetcher fetches a chart based on an asset. it returns the location that the chart was unpacked to, usually a temporary directory

func NewFetcher

func NewFetcher(
	logger log.Logger,
	github github.Renderer,
	fs afero.Afero,
	helmCommands Commands,
) ChartFetcher

NewFetcher makes a new chart fetcher

type ClientFetcher

type ClientFetcher struct {
	Logger       log.Logger
	GitHub       github.Renderer
	FS           afero.Afero
	HelmCommands Commands
}

ClientFetcher is a ChartFetcher that does all the pulling/cloning client side

func (*ClientFetcher) FetchChart

func (f *ClientFetcher) FetchChart(
	ctx context.Context,
	asset api.HelmAsset,
	renderRoot string,
	meta api.ReleaseMetadata,
	configGroups []libyaml.ConfigGroup,
	templateContext map[string]interface{},
) (string, error)

type Commands

type Commands interface {
	Init() error
	MaybeDependencyUpdate(chartRoot string, requirements chartutil.Requirements) error
	Template(chartName string, args []string) error
	Fetch(chartRef, repoURL, version, dest, home string) error
	RepoAdd(name, url, home string) error
}

Commands are Helm commands that are available to the Ship binary.

func NewCommands

func NewCommands(
	fs afero.Afero,
	logger log.Logger,
) Commands

NewCommands returns a helmCommands struct that implements Commands.

type LocalRenderer

type LocalRenderer struct {
	Templater Templater
	Fetcher   ChartFetcher
	GitHub    github.Renderer
}

LocalRenderer can add a helm step to the plan, the step will fetch the chart to a temporary location and then run a local operation to run the helm templating

func (*LocalRenderer) Execute

func (r *LocalRenderer) Execute(
	rootFs root.Fs,
	asset api.HelmAsset,
	meta api.ReleaseMetadata,
	templateContext map[string]interface{},
	configGroups []libyaml.ConfigGroup,
) func(ctx context.Context) error

type LocalTemplater

type LocalTemplater struct {
	Commands       Commands
	Logger         log.Logger
	FS             afero.Afero
	BuilderBuilder *templates.BuilderBuilder
	Viper          *viper.Viper
	StateManager   state.Manager
	// contains filtered or unexported fields
}

LocalTemplater implements Templater by using the Commands interface from pkg/helm and creating the chart in place

func (*LocalTemplater) Template

func (f *LocalTemplater) Template(
	chartRoot string,
	rootFs root.Fs,
	asset api.HelmAsset,
	meta api.ReleaseMetadata,
	configGroups []libyaml.ConfigGroup,
	templateContext map[string]interface{},
) error

type Renderer

type Renderer interface {
	Execute(
		rootFs root.Fs,
		asset api.HelmAsset,
		meta api.ReleaseMetadata,
		templateContext map[string]interface{},
		configGroups []libyaml.ConfigGroup,
	) func(ctx context.Context) error
}

Renderer is something that can render a helm asset as part of a planner.Plan

func NewRenderer

func NewRenderer(cloner ChartFetcher, templater Templater, github github.Renderer) Renderer

NewRenderer makes a new renderer

type Templater

type Templater interface {
	Template(
		chartRoot string,
		rootFs root.Fs,
		asset api.HelmAsset,
		meta api.ReleaseMetadata,
		configGroups []libyaml.ConfigGroup,
		templateContext map[string]interface{},
	) error
}

Templater is something that can consume and render a helm chart pulled by ship. the chart should already be present at the specified path.

func NewTemplater

func NewTemplater(
	commands Commands,
	logger log.Logger,
	fs afero.Afero,
	builderBuilder *templates.BuilderBuilder,
	viper *viper.Viper,
	stateManager state.Manager,
) Templater

NewTemplater returns a configured Templater that uses vendored libhelm to execute templating/etc

Jump to

Keyboard shortcuts

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