chart

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2019 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Include

func Include(chartFilter []string, chartName string) bool

Include returns true if chartName is included in chartFilter or if chartFilter is empty.

func LabelSelector added in v0.0.2

func LabelSelector(c *Chart) string

LabelSelector builds valid label selector for a *resource.Builder that selects all resources associated to the chart. See doc of const LabelChartName for more information.

func LoadValues

func LoadValues(files ...string) (map[interface{}]interface{}, error)

LoadValues loads yaml files and stores the contents of provided files into a map. The contents are merged left to right, and will overwrite keys present in files that are loaded earlier. This makes it possible to layer values files.

func Render

func Render(config *Config) (map[string]string, error)

Render takes a chart config and renders the chart. It returns a map of template filepaths and their rendered contents.

func ValuesForChart

func ValuesForChart(chartName string, values map[interface{}]interface{}) (map[interface{}]interface{}, error)

ValuesForChart extracts the necessary parts of the values for given chart.

Types

type Chart

type Chart struct {
	Config    *Config
	Resources []runtime.Object
	Hooks     hook.Map
}

Chart is a rendered chart with the config used for rendering, a list of chart resources and a map of chart hooks.

type Config

type Config struct {
	Dir       string
	Name      string
	Namespace string
	Values    map[interface{}]interface{}
}

Config is the configuration for rendering a chart.

type HookExecutor

type HookExecutor interface {
	// ExecHooks takes a chart and executes all hooks of type hookType that are
	// defined in the chart. Depending on the configuration of the hooks it may
	// returns errors if hooks fail or not. Should return all other errors that
	// occur while hook execution.
	ExecHooks(c *Chart, hookType string) error
}

HookExecutor executes chart lifecycle hooks

func NewHookExecutor added in v0.0.2

func NewHookExecutor(
	streams genericclioptions.IOStreams,
	client dynamic.Interface,
	mapper meta.RESTMapper,
	printer printers.ContextPrinter,
	dryRun bool,
) HookExecutor

NewHookExecutor creates a new HookExecutor.

type NoopHookExecutor added in v0.0.2

type NoopHookExecutor struct{}

NoopHookExecutor does not execute any hooks.

func (*NoopHookExecutor) ExecHooks added in v0.0.2

func (e *NoopHookExecutor) ExecHooks(*Chart, string) error

ExecHooks implements HookExecutor.

type Processor

type Processor struct {
	Decoder resources.Decoder
}

Processor type processes a chart config and renders the contained resources. It will also perform post-processing on these resources.

func NewDefaultProcessor

func NewDefaultProcessor() *Processor

NewDefaultProcessor creates a new *Processor value.

func NewProcessor

func NewProcessor(d resources.Decoder) *Processor

NewProcessor creates a new *Processor values which uses given decoder to decode rendered chart templates.

func (*Processor) Process

func (p *Processor) Process(config *Config) (*Chart, error)

Process takes a chart config, renders and processes it.

type ReverseVisitor

type ReverseVisitor struct {
	Visitor Visitor
}

ReverseVisitor wraps a Visitor and visits all charts in the reverse order.

func NewReverseVisitor

func NewReverseVisitor(visitor Visitor) *ReverseVisitor

NewReverseVisitor creates a new *ReverseVisitor which wraps visitor.

func (*ReverseVisitor) Visit

func (v *ReverseVisitor) Visit(fn VisitorFunc) error

Visit implements Visitor.

type Visitor

type Visitor interface {
	// Visit accepts a function that is called for every chart the visitor
	// encounters.
	Visit(fn VisitorFunc) error
}

Visitor is a type that visits charts.

func NewVisitor

func NewVisitor(p *Processor, o VisitorOptions) Visitor

NewVisitor creates a new *Visitor which uses given *Processor and VisitorOptions to process charts.

type VisitorFunc

type VisitorFunc func(chart *Chart, err error) error

VisitorFunc is the signature of a function that is called for every chart that is encountered by the visitor.

type VisitorOptions

type VisitorOptions struct {
	ValueFiles  []string
	ChartDir    string
	ChartFilter []string
	Namespace   string
	Recursive   bool
}

VisitorOptions configure the charts the visitor should visit.

Jump to

Keyboard shortcuts

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