helm

package
v0.13.4 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2021 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
const MockHelmClientVersion string = "v2.15.2"

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action struct {
	Name  string
	Steps []ExecuteStep // using UnmarshalYAML so that we don't need a custom type per action
}

func (Action) GetSteps

func (a Action) GetSteps() []builder.ExecutableStep

func (Action) MakeSteps

func (a Action) MakeSteps() interface{}

MakeSteps builds a slice of Steps for data to be unmarshaled into.

func (Action) MarshalYAML

func (a Action) MarshalYAML() (interface{}, error)

MarshalYAML converts the action back to a YAML representation install:

exec:
  ...
helm:
  ...

func (*Action) UnmarshalYAML

func (a *Action) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML takes any yaml in this form ACTION: - helm: ... and puts the steps into the Action.Steps field

type BuildInput

type BuildInput struct {
	Config MixinConfig
}

BuildInput represents stdin passed to the mixin for the build command.

type ExecuteInstruction

type ExecuteInstruction struct {
	Step      `yaml:",inline"`
	Namespace string        `yaml:"namespace,omitempty"`
	Arguments []string      `yaml:"arguments,omitempty"`
	Flags     builder.Flags `yaml:"flags,omitempty"`
}

type ExecuteStep

type ExecuteStep struct {
	ExecuteInstruction `yaml:"helm"`
}

func (ExecuteStep) GetArguments

func (s ExecuteStep) GetArguments() []string

func (ExecuteStep) GetCommand

func (s ExecuteStep) GetCommand() string

func (ExecuteStep) GetFlags

func (s ExecuteStep) GetFlags() builder.Flags

type HelmOutput

type HelmOutput struct {
	Name         string `yaml:"name"`
	Secret       string `yaml:"secret,omitempty"`
	Key          string `yaml:"key,omitempty"`
	ResourceType string `yaml:"resourceType,omitempty"`
	ResourceName string `yaml:"resourceName,omitempty"`
	Namespace    string `yaml:"namespace,omitempty"`
	JSONPath     string `yaml:"jsonPath,omitempty"`
}

type InstallAction

type InstallAction struct {
	Steps []InstallStep `yaml:"install"`
}

type InstallArguments

type InstallArguments struct {
	Step `yaml:",inline"`

	Namespace string            `yaml:"namespace"`
	Name      string            `yaml:"name"`
	Chart     string            `yaml:"chart"`
	Version   string            `yaml:"version"`
	Replace   bool              `yaml:"replace"`
	Set       map[string]string `yaml:"set"`
	Values    []string          `yaml:"values"`
	Devel     bool              `yaml:"devel`
	Wait      bool              `yaml:"wait"`
}

type InstallStep

type InstallStep struct {
	InstallArguments `yaml:"helm"`
}

type Mixin

type Mixin struct {
	*context.Context

	ClientFactory kubernetes.ClientFactory
	TillerIniter
	HelmClientVersion string
	// contains filtered or unexported fields
}

Helm is the logic behind the helm mixin

func New

func New() *Mixin

New helm mixin client, initialized with useful defaults.

func (*Mixin) Build

func (m *Mixin) Build() error

func (*Mixin) Execute

func (m *Mixin) Execute() error

func (*Mixin) GetSchema

func (m *Mixin) GetSchema() (string, error)

func (*Mixin) Init

func (m *Mixin) Init() error

Init inits the Helm server (Tiller) if not running, else, ensures the Helm client matches the installed Tiller version

func (*Mixin) Install

func (m *Mixin) Install() error

func (*Mixin) PrintSchema

func (m *Mixin) PrintSchema() error

func (*Mixin) PrintVersion

func (m *Mixin) PrintVersion(opts version.Options) error

func (*Mixin) Uninstall

func (m *Mixin) Uninstall() error

Uninstall deletes a provided set of Helm releases, supplying optional flags/params

func (*Mixin) Upgrade

func (m *Mixin) Upgrade() error

Upgrade issues a helm upgrade command for a release using the provided UpgradeArguments

func (*Mixin) ValidatePayload

func (m *Mixin) ValidatePayload(b []byte) error

type MixinConfig

type MixinConfig struct {
	ClientVersion string `yaml:"clientVersion,omitempty"`
	Repositories  map[string]Repository
}

type MockTillerIniter

type MockTillerIniter struct {
	GetTillerVersion   func(m *Mixin) (string, error)
	SetupTillerRBAC    func(m *Mixin) error
	RunRBACResourceCmd func(m *Mixin, cmd *exec.Cmd) error
	InstallHelmClient  func(m *Mixin, version string) error
}

func NewMockTillerIniter

func NewMockTillerIniter() MockTillerIniter

type RealTillerIniter

type RealTillerIniter struct{}

RealTillerIniter implements the TillerIniter interface, in REAL life

type Repository

type Repository struct {
	URL string `yaml:"url,omitempty"`
}

type Step

type Step struct {
	Description string       `yaml:"description"`
	Outputs     []HelmOutput `yaml:"outputs,omitempty"`
}

type TestMixin

type TestMixin struct {
	*Mixin
	TestContext *context.TestContext
}

func NewTestMixin

func NewTestMixin(t *testing.T) *TestMixin

NewTestMixin initializes a helm mixin, with the output buffered, and an in-memory file system.

type TillerIniter

type TillerIniter interface {
	// contains filtered or unexported methods
}

TillerIniter is an interface for methods associated with Tiller interactions

type UninstallAction

type UninstallAction struct {
	Steps []UninstallStep `yaml:"uninstall"`
}

type UninstallArguments

type UninstallArguments struct {
	Step `yaml:",inline"`

	Releases []string `yaml:"releases"`
	Purge    bool     `yaml:"purge"`
}

UninstallArguments are the arguments available for the Uninstall action

type UninstallStep

type UninstallStep struct {
	UninstallArguments `yaml:"helm"`
}

UninstallStep represents the structure of an Uninstall action

type UpgradeAction

type UpgradeAction struct {
	Steps []UpgradeStep `yaml:"upgrade"`
}

type UpgradeArguments

type UpgradeArguments struct {
	Step `yaml:",inline"`

	Namespace   string            `yaml:"namespace"`
	Name        string            `yaml:"name"`
	Chart       string            `yaml:"chart"`
	Version     string            `yaml:"version"`
	Set         map[string]string `yaml:"set"`
	Values      []string          `yaml:"values"`
	Wait        bool              `yaml:"wait"`
	ResetValues bool              `yaml:"resetValues"`
	ReuseValues bool              `yaml:"reuseValues"`
}

UpgradeArguments represent the arguments available to the Upgrade step

type UpgradeStep

type UpgradeStep struct {
	UpgradeArguments `yaml:"helm"`
}

UpgradeStep represents the structure of an Upgrade step

Jump to

Keyboard shortcuts

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