helm

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2023 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrReleaseNotFound     = errors.New("release not found")
	ErrChartNotApplication = errors.New("helm chart is not an application chart")
)

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(config *Config) *Client

func (*Client) Create added in v0.3.0

func (p *Client) Create(config *ReleaseConfig) (*Release, error)

Create - creates a helm release with its configs.

func (*Client) Delete

func (p *Client) Delete(config *ReleaseConfig) error

func (*Client) Update added in v0.3.0

func (p *Client) Update(config *ReleaseConfig) (*Release, error)

Update - updates a helm release with its configs.

type Config

type Config struct {
	// HelmDriver - The backend storage driver. Values are - configmap, secret, memory, sql
	HelmDriver string `default:"secret"`
	// Kubernetes configuration.
	Kubernetes kube.Config
}

func DefaultClientConfig added in v0.3.0

func DefaultClientConfig() *Config

type KubeConfig added in v0.3.0

type KubeConfig struct {
	ClientConfig clientcmd.ClientConfig

	sync.Mutex
}

KubeConfig is a RESTClientGetter interface implementation comes from https://github.com/hashicorp/terraform-provider-helm

func (*KubeConfig) ToDiscoveryClient added in v0.3.0

func (k *KubeConfig) ToDiscoveryClient() (discovery.CachedDiscoveryInterface, error)

ToDiscoveryClient implemented interface method.

func (*KubeConfig) ToRESTConfig added in v0.3.0

func (k *KubeConfig) ToRESTConfig() (*rest.Config, error)

ToRESTConfig implemented interface method.

func (*KubeConfig) ToRESTMapper added in v0.3.0

func (k *KubeConfig) ToRESTMapper() (meta.RESTMapper, error)

ToRESTMapper implemented interface method.

func (*KubeConfig) ToRawKubeConfigLoader added in v0.3.0

func (k *KubeConfig) ToRawKubeConfigLoader() clientcmd.ClientConfig

ToRawKubeConfigLoader implemented interface method.

type Release added in v0.3.0

type Release struct {
	Config *ReleaseConfig
	Output ReleaseOutput
}

type ReleaseConfig

type ReleaseConfig struct {
	// Name - Release Name
	Name string `json:"name" mapstructure:"name"`
	// Repository - Repository where to locate the requested chart. If is a URL the chart is installed without installing the repository.
	Repository string `json:"repository" mapstructure:"repository"`
	// Chart - Chart name to be installed. A path may be used.
	Chart string `json:"chart" mapstructure:"chart"`
	// Version - Specify the exact chart version to install. If this is not specified, the latest version is installed.
	Version string `json:"version" mapstructure:"version"`
	// Values - Map of values in to pass to helm.
	Values map[string]interface{} `json:"values" mapstructure:"values"`
	// Namespace - Namespace to install the release into.
	Namespace string `json:"namespace" mapstructure:"namespace" default:"default"`
	// Timeout - Time in seconds to wait for any individual kubernetes operation.
	Timeout int `json:"timeout" mapstructure:"timeout" default:"300"`
	// ForceUpdate - Force resource update through delete/recreate if needed.
	ForceUpdate bool `json:"force_update" mapstructure:"force_update" default:"false"`
	// RecreatePods - Perform pods restart during upgrade/rollback
	RecreatePods bool `json:"recreate_pods" mapstructure:"recreate_pods" default:"false"`
	// Wait - Will wait until all resources are in a ready state before marking the release as successful.
	Wait bool `json:"wait" mapstructure:"wait" default:"true"`
	// WaitForJobs - If wait is enabled, will wait until all Jobs have been completed before marking the release as successful.
	WaitForJobs bool `json:"wait_for_jobs" mapstructure:"wait_for_jobs" default:"false"`
	// Replace - Re-use the given name, even if that name is already used. This is unsafe in production
	Replace bool `json:"replace" mapstructure:"replace" default:"false"`
	// Description - Add a custom description
	Description string `json:"description" mapstructure:"description"`
	// CreateNamespace - Create the namespace if it does not exist
	CreateNamespace bool `json:"create_namespace" mapstructure:"create_namespace" default:"false"`
}

func DefaultReleaseConfig

func DefaultReleaseConfig() *ReleaseConfig

type ReleaseOutput added in v0.3.0

type ReleaseOutput struct {
	// Status - Status of the release.
	Status Status
	// Revision - Revision of the release.
	Release string
}

type Status added in v0.3.0

type Status string
const (
	StatusUnknown Status = "unknown"
	StatusSuccess Status = "success"
	StatusFailed  Status = "failed"
)

func (Status) String added in v0.3.0

func (x Status) String() string

Jump to

Keyboard shortcuts

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