action

package
v0.0.0-...-eef33a9 Latest Latest
Warning

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

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

Documentation

Overview

Package action contains the logic for each action that Helm can perform.

This is a library for calling top-level Helm actions like 'install', 'upgrade', or 'list'. Actions approximately match the command line invocations that the Helm client uses.

Index

Constants

ListAll is a convenience for enabling all list filters

Variables

View Source
var Timestamper = time.Now

Timestamper is a function capable of producing a timestamp.Timestamper.

By default, this is a time.Time function. This can be overridden for testing, though, so that timestamps are predictable.

Functions

func GetVersionSet

func GetVersionSet(client discovery.ServerGroupsInterface) (chartutil.VersionSet, error)

GetVersionSet retrieves a set of available k8s API versions

Types

type ChartExport

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

ChartExport performs a chart export operation.

func NewChartExport

func NewChartExport(cfg *Configuration) *ChartExport

NewChartExport creates a new ChartExport object with the given configuration.

func (*ChartExport) Run

func (a *ChartExport) Run(out io.Writer, ref string) error

Run executes the chart export operation

type ChartList

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

ChartList performs a chart list operation.

func NewChartList

func NewChartList(cfg *Configuration) *ChartList

NewChartList creates a new ChartList object with the given configuration.

func (*ChartList) Run

func (a *ChartList) Run(out io.Writer) error

Run executes the chart list operation

type ChartPull

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

ChartPull performs a chart pull operation.

func NewChartPull

func NewChartPull(cfg *Configuration) *ChartPull

NewChartPull creates a new ChartPull object with the given configuration.

func (*ChartPull) Run

func (a *ChartPull) Run(out io.Writer, ref string) error

Run executes the chart pull operation

type ChartPush

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

ChartPush performs a chart push operation.

func NewChartPush

func NewChartPush(cfg *Configuration) *ChartPush

NewChartPush creates a new ChartPush object with the given configuration.

func (*ChartPush) Run

func (a *ChartPush) Run(out io.Writer, ref string) error

Run executes the chart push operation

type ChartRemove

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

ChartRemove performs a chart remove operation.

func NewChartRemove

func NewChartRemove(cfg *Configuration) *ChartRemove

NewChartRemove creates a new ChartRemove object with the given configuration.

func (*ChartRemove) Run

func (a *ChartRemove) Run(out io.Writer, ref string) error

Run executes the chart remove operation

type ChartSave

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

ChartSave performs a chart save operation.

func NewChartSave

func NewChartSave(cfg *Configuration) *ChartSave

NewChartSave creates a new ChartSave object with the given configuration.

func (*ChartSave) Run

func (a *ChartSave) Run(out io.Writer, path string, ref string) error

Run executes the chart save operation

type Configuration

type Configuration struct {
	// Discovery contains a discovery client
	Discovery discovery.DiscoveryInterface

	// Releases stores records of releases.
	Releases *storage.Storage

	// KubeClient is a Kubernetes API client.
	KubeClient environment.KubeClient

	// RegistryClient is a client for working with registries
	RegistryClient *registry.Client

	Capabilities *chartutil.Capabilities

	Log func(string, ...interface{})
}

Configuration injects the dependencies that all actions share.

func (*Configuration) Now

func (c *Configuration) Now() time.Time

Now generates a timestamp

If the configuration has a Timestamper on it, that will be used. Otherwise, this will use time.Now().

type Install

type Install struct {
	DryRun       bool
	DisableHooks bool
	Replace      bool
	Wait         bool
	Devel        bool
	DepUp        bool
	Timeout      int64
	Namespace    string
	ReleaseName  string
	// contains filtered or unexported fields
}

Install performs an installation operation.

func NewInstall

func NewInstall(cfg *Configuration) *Install

NewInstall creates a new Install object with the given configuration.

func (*Install) Run

func (i *Install) Run(chrt *chart.Chart, rawValues map[string]interface{}) (*release.Release, error)

Run executes the installation

If DryRun is set to true, this will prepare the release, but not install it

type List

type List struct {
	// All ignores the limit/offset
	All bool
	// AllNamespaces searches across namespaces
	AllNamespaces bool
	// Sort indicates the sort to use
	//
	// see pkg/releaseutil for several useful sorters
	Sort Sorter
	// StateMask accepts a bitmask of states for items to show.
	// The default is ListDeployed
	StateMask ListStates
	// Limit is the number of items to return per Run()
	Limit int
	// Offset is the starting index for the Run() call
	Offset int
	// Filter is a filter that is applied to the results
	Filter string
	// contains filtered or unexported fields
}

List is the action for listing releases.

It provides, for example, the implementation of 'helm list'.

func NewList

func NewList(cfg *Configuration) *List

NewList constructs a new *List

func (*List) Run

func (a *List) Run() ([]*release.Release, error)

Run executes the list command, returning a set of matches.

type ListStates

type ListStates uint

ListStates represents zero or more status codes that a list item may have set

Because this is used as a bitmask filter, more than one one bit can be flipped in the ListStates.

const (
	// ListDeployed filters on status "deployed"
	ListDeployed ListStates = 1 << iota
	// ListUninstalled filters on status "uninstalled"
	ListUninstalled
	// ListUninstalling filters on status "uninstalling" (uninstall in progress)
	ListUninstalling
	// ListPendingInstall filters on status "pending" (deployment in progress)
	ListPendingInstall
	// ListPendingUpgrade filters on status "pending_upgrade" (upgrade in progress)
	ListPendingUpgrade
	// ListPendingRollback filters on status "pending_rollback" (rollback in progres)
	ListPendingRollback
	// ListSuperseded filters on status "superseded" (historical release version that is no longer deployed)
	ListSuperseded
	// ListFailed filters on status "failed" (release version not deployed because of error)
	ListFailed
	// ListUnknown filters on an unknown status
	ListUnknown
)

func (ListStates) FromName

func (s ListStates) FromName(str string) ListStates

FromName takes a state name and returns a ListStates representation.

Currently, there are only names for individual flipped bits, so the returned ListStates will only match one of the constants. However, it is possible that this behavior could change in the future.

type Sorter

type Sorter uint

Sorter is a top-level sort

const (
	// ByDate sorts by date
	ByDate Sorter = iota
	// ByNameAsc sorts by ascending lexicographic order
	ByNameAsc
	// ByNameDesc sorts by descending lexicographic order
	ByNameDesc
)

Jump to

Keyboard shortcuts

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