helm

package
v1.1.27 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2021 License: Apache-2.0 Imports: 76 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TrackTerminationModeAnnoName = "werf.io/track-termination-mode"

	FailModeAnnoName                  = "werf.io/fail-mode"
	FailuresAllowedPerReplicaAnnoName = "werf.io/failures-allowed-per-replica"

	LogRegexAnnoName      = "werf.io/log-regex"
	LogRegexForAnnoPrefix = "werf.io/log-regex-for-"

	SkipLogsAnnoName              = "werf.io/skip-logs"
	SkipLogsForContainersAnnoName = "werf.io/skip-logs-for-containers"
	ShowLogsOnlyForContainers     = "werf.io/show-logs-only-for-containers"
	ShowLogsUntilAnnoName         = "werf.io/show-logs-until"

	ShowEventsAnnoName = "werf.io/show-service-messages"
)

Variables

View Source
var (
	HelmSettings                helm_env.EnvSettings
	HelmReleaseStorageNamespace string
	HelmReleaseStorageType      string

	WerfTemplateEngine     = NewWerfEngine()
	WerfTemplateEngineName = "werfGoTpl"

	DefaultReleaseStorageNamespace = "kube-system"

	ConfigMapStorage = "configmap"
	SecretStorage    = "secret"

	LoadChartfileFunc = func(chartPath string) (*chart.Chart, error) {
		return chartutil.Load(chartPath)
	}

	ErrNoSuccessfullyDeployedReleaseRevisionFound = errors.New("no DEPLOYED release revision found")
)
View Source
var WerfEngineHelpers = `` /* 4470-byte string literal not displayed */

Functions

func Delete

func Delete(ctx context.Context, releaseName string, opts DeleteOptions) error

func DeployHelmChart

func DeployHelmChart(ctx context.Context, chartPath, releaseName, namespace string, opts ChartOptions) (err error)

func Get

func Get(ctx context.Context, out io.Writer, releaseName string, opts GetOptions) error

func History

func History(out io.Writer, releaseName string, opts HistoryOptions) error

func Init

func Init(ctx context.Context, options InitOptions) error

func Lint

func Lint(ctx context.Context, out io.Writer, chartPath, namespace string, values []string, secretValues []map[string]interface{}, set, setString []string, opts LintOptions) error

func Ls

func Ls(ctx context.Context, out io.Writer, filter string, opts LsOptions) error

func PurgeHelmRelease

func PurgeHelmRelease(ctx context.Context, releaseName, namespace string, withHooks bool) error

func ReleaseInstall

func ReleaseInstall(ctx context.Context, chartPath, releaseName, namespace string, values []string, secretValues []map[string]interface{}, set, setString []string, threeWayMergeMode ThreeWayMergeModeType, opts ReleaseInstallOptions) error

func ReleaseRollback

func ReleaseRollback(releaseName string, revision int32, threeWayMergeMode ThreeWayMergeModeType, opts ReleaseRollbackOptions) error

func ReleaseUpdate

func ReleaseUpdate(ctx context.Context, chartPath, releaseName string, values []string, secretValues []map[string]interface{}, set, setString []string, threeWayMergeMode ThreeWayMergeModeType, opts ReleaseUpdateOptions) error

func Render

func Render(ctx context.Context, out io.Writer, chartPath, releaseName, namespace string, values []string, secretValues []map[string]interface{}, set, setString []string, opts RenderOptions) error

func Rollback

func Rollback(ctx context.Context, releaseName string, revision int32, opts RollbackOptions) error

func SetReleaseLogSecretValuesToMask

func SetReleaseLogSecretValuesToMask(secretValuesToMask []string)

func WerfTemplateEngineWithExtraAnnotationsAndLabels

func WerfTemplateEngineWithExtraAnnotationsAndLabels(extraAnnotations, extraLabels map[string]string, f func() error) error

Types

type ChartOptions

type ChartOptions struct {
	Timeout time.Duration

	DryRun            bool
	Debug             bool
	ThreeWayMergeMode ThreeWayMergeModeType

	ChartValuesOptions
}

type ChartTemplates

type ChartTemplates []Template

func GetTemplatesFromChart

func GetTemplatesFromChart(ctx context.Context, chartPath, releaseName, namespace string, values []string, secretValues []map[string]interface{}, set, setString []string) (ChartTemplates, error)

func GetTemplatesFromReleaseRevision

func GetTemplatesFromReleaseRevision(releaseName string, revision int32) (ChartTemplates, error)

func (ChartTemplates) ByKind

func (templates ChartTemplates) ByKind(kind string) []Template

func (ChartTemplates) DaemonSets

func (templates ChartTemplates) DaemonSets() []Template

func (ChartTemplates) Deployments

func (templates ChartTemplates) Deployments() []Template

func (ChartTemplates) Jobs

func (templates ChartTemplates) Jobs() []Template

func (ChartTemplates) Pods

func (templates ChartTemplates) Pods() []Template

func (ChartTemplates) StatefulSets

func (templates ChartTemplates) StatefulSets() []Template

type ChartValuesOptions

type ChartValuesOptions struct {
	SecretValues []map[string]interface{}
	Set          []string
	SetString    []string
	Values       []string
}

type ClientGetterFromConfigData added in v1.1.23

type ClientGetterFromConfigData struct {
	Context          string
	ConfigDataBase64 string

	ClientConfig clientcmd.ClientConfig
}

func NewClientGetterFromConfigData added in v1.1.23

func NewClientGetterFromConfigData(context, configDataBase64 string) (*ClientGetterFromConfigData, error)

func (*ClientGetterFromConfigData) ToDiscoveryClient added in v1.1.23

func (getter *ClientGetterFromConfigData) ToDiscoveryClient() (discovery.CachedDiscoveryInterface, error)

func (*ClientGetterFromConfigData) ToRESTConfig added in v1.1.23

func (getter *ClientGetterFromConfigData) ToRESTConfig() (*rest.Config, error)

func (*ClientGetterFromConfigData) ToRESTMapper added in v1.1.23

func (getter *ClientGetterFromConfigData) ToRESTMapper() (meta.RESTMapper, error)

func (*ClientGetterFromConfigData) ToRawKubeConfigLoader added in v1.1.23

func (getter *ClientGetterFromConfigData) ToRawKubeConfigLoader() clientcmd.ClientConfig

type DeleteOptions

type DeleteOptions struct {
	DisableHooks bool
	Purge        bool
	Timeout      int64
}

type GetOptions

type GetOptions struct {
	Revision int32
	Template string
}

type HistoryOptions

type HistoryOptions struct {
	Max          int64
	OutputFormat string
	ColWidth     uint
}

type InitOptions

type InitOptions struct {
	KubeConfig                  string
	KubeConfigBase64            string
	KubeContext                 string
	HelmReleaseStorageNamespace string
	HelmReleaseStorageType      string

	InitNamespace bool

	StatusProgressPeriod      time.Duration
	HooksStatusProgressPeriod time.Duration

	ReleasesMaxHistory int

	WithoutKube bool
}

type LintOptions

type LintOptions struct {
	Strict bool
}

type LsOptions

type LsOptions struct {
	Short        bool
	Offset       string
	Reverse      bool
	Max          int64
	All          bool
	Deleted      bool
	Deleting     bool
	Pending      bool
	Namespace    string
	ColWidth     uint
	OutputFormat string
}

type ReleaseInstallOptions

type ReleaseInstallOptions struct {
	Debug bool
	// contains filtered or unexported fields
}

type ReleaseRollbackOptions

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

type ReleaseState

type ReleaseState struct {
	IsExists    bool
	StatusCode  string
	PurgeNeeded bool
}

type ReleaseUpdateOptions

type ReleaseUpdateOptions struct {
	Debug bool
	// contains filtered or unexported fields
}

type RenderOptions

type RenderOptions struct {
	ShowNotes bool
}

type ResourcesWaiter

type ResourcesWaiter struct {
	Ctx                       context.Context
	Client                    *helmKube.Client
	LogsFromTime              time.Time
	StatusProgressPeriod      time.Duration
	HooksStatusProgressPeriod time.Duration
}

func (*ResourcesWaiter) WaitForResources

func (waiter *ResourcesWaiter) WaitForResources(timeout time.Duration, created helmKube.Result) error

func (*ResourcesWaiter) WatchUntilReady

func (waiter *ResourcesWaiter) WatchUntilReady(namespace string, reader io.Reader, timeout time.Duration) error

type RollbackOptions

type RollbackOptions struct {
	DisableHooks  bool
	Recreate      bool
	Wait          bool
	Force         bool
	CleanupOnFail bool
	Timeout       int64
}

type Template

type Template struct {
	Version  string `yaml:"apiVersion,omitempty"`
	Kind     string `yaml:"kind,omitempty"`
	Metadata struct {
		Name        string                 `yaml:"name,omitempty"`
		Namespace   string                 `yaml:"namespace,omitempty"`
		Annotations map[string]string      `yaml:"annotations,omitempty"`
		Labels      map[string]string      `yaml:"labels,omitempty"`
		UID         string                 `yaml:"uid,omitempty"`
		OtherFields map[string]interface{} `yaml:",inline"`
	} `yaml:"metadata,omitempty"`
	OtherFields map[string]interface{} `yaml:",inline"`
}

func (Template) IsEmpty

func (t Template) IsEmpty() bool

func (Template) Namespace

func (t Template) Namespace(namespace string) string

type ThreeWayMergeModeType

type ThreeWayMergeModeType string
var (
	ThreeWayMergeEnabled         ThreeWayMergeModeType = "enabled"
	ThreeWayMergeOnlyNewReleases ThreeWayMergeModeType = "onlyNewReleases"
	ThreeWayMergeDisabled        ThreeWayMergeModeType = "disabled"
)

type WerfEngine

type WerfEngine struct {
	*engine.Engine

	ExtraAnnotations map[string]string
	ExtraLabels      map[string]string
}

func NewWerfEngine

func NewWerfEngine() *WerfEngine

func (*WerfEngine) InitWerfEngineExtraTemplatesFunctions

func (e *WerfEngine) InitWerfEngineExtraTemplatesFunctions(decodedSecretFiles map[string]string)

func (*WerfEngine) Render

func (e *WerfEngine) Render(chrt *chart.Chart, values chartutil.Values) (map[string]string, error)

Directories

Path Synopsis
module

Jump to

Keyboard shortcuts

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