helm

package
v1.14.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2025 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package helm provides helpers for interacting with Helm in KSail.

Index

Constants

View Source
const (
	// DefaultTimeout defines the fallback Helm chart installation timeout.
	DefaultTimeout = 5 * time.Minute
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ChartSpec added in v1.12.3

type ChartSpec struct {
	ReleaseName string
	ChartName   string
	Namespace   string
	Version     string

	CreateNamespace bool
	Atomic          bool
	Wait            bool
	WaitForJobs     bool
	Timeout         time.Duration
	Silent          bool
	UpgradeCRDs     bool

	ValuesYaml  string
	ValueFiles  []string
	SetValues   map[string]string
	SetFileVals map[string]string
	SetJSONVals map[string]string

	RepoURL               string
	Username              string
	Password              string
	CertFile              string
	KeyFile               string
	CaFile                string
	InsecureSkipTLSverify bool
}

ChartSpec mirrors the mittwald chart specification while keeping KSail specific convenience fields.

type Client

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

Client represents the default helm implementation used by KSail.

func NewClient

func NewClient(kubeConfig, kubeContext string) (*Client, error)

NewClient creates a Helm client using the provided kubeconfig and context.

func NewClientWithDebug added in v1.12.3

func NewClientWithDebug(
	kubeConfig, kubeContext string,
	debugFunc func(string, ...any),
) (*Client, error)

NewClientWithDebug creates a Helm client with a custom debug logger.

func (*Client) AddRepository added in v1.12.3

func (c *Client) AddRepository(ctx context.Context, entry *RepositoryEntry) error

AddRepository registers a Helm repository for the current client instance.

func (*Client) InstallChart added in v1.12.3

func (c *Client) InstallChart(ctx context.Context, spec *ChartSpec) (*ReleaseInfo, error)

InstallChart installs a Helm chart using the provided specification.

func (*Client) InstallOrUpgradeChart added in v1.12.3

func (c *Client) InstallOrUpgradeChart(ctx context.Context, spec *ChartSpec) (*ReleaseInfo, error)

InstallOrUpgradeChart upgrades a Helm chart when present and installs it otherwise.

func (*Client) UninstallRelease added in v1.12.3

func (c *Client) UninstallRelease(ctx context.Context, releaseName, namespace string) error

UninstallRelease removes a Helm release by name within the provided namespace.

type Interface added in v1.12.3

type Interface interface {
	InstallChart(ctx context.Context, spec *ChartSpec) (*ReleaseInfo, error)
	InstallOrUpgradeChart(ctx context.Context, spec *ChartSpec) (*ReleaseInfo, error)
	UninstallRelease(ctx context.Context, releaseName, namespace string) error
	AddRepository(ctx context.Context, entry *RepositoryEntry) error
}

Interface defines the subset of Helm functionality required by KSail.

type MockInterface added in v1.13.1

type MockInterface struct {
	mock.Mock
}

MockInterface is an autogenerated mock type for the Interface type

func NewMockInterface added in v1.13.1

func NewMockInterface(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockInterface

NewMockInterface creates a new instance of MockInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockInterface) AddRepository added in v1.13.1

func (_mock *MockInterface) AddRepository(ctx context.Context, entry *RepositoryEntry) error

AddRepository provides a mock function for the type MockInterface

func (*MockInterface) EXPECT added in v1.13.1

func (_m *MockInterface) EXPECT() *MockInterface_Expecter

func (*MockInterface) InstallChart added in v1.13.1

func (_mock *MockInterface) InstallChart(ctx context.Context, spec *ChartSpec) (*ReleaseInfo, error)

InstallChart provides a mock function for the type MockInterface

func (*MockInterface) InstallOrUpgradeChart added in v1.13.1

func (_mock *MockInterface) InstallOrUpgradeChart(ctx context.Context, spec *ChartSpec) (*ReleaseInfo, error)

InstallOrUpgradeChart provides a mock function for the type MockInterface

func (*MockInterface) UninstallRelease added in v1.13.1

func (_mock *MockInterface) UninstallRelease(ctx context.Context, releaseName string, namespace string) error

UninstallRelease provides a mock function for the type MockInterface

type MockInterface_AddRepository_Call added in v1.13.1

type MockInterface_AddRepository_Call struct {
	*mock.Call
}

MockInterface_AddRepository_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddRepository'

func (*MockInterface_AddRepository_Call) Return added in v1.13.1

func (*MockInterface_AddRepository_Call) Run added in v1.13.1

func (*MockInterface_AddRepository_Call) RunAndReturn added in v1.13.1

type MockInterface_Expecter added in v1.13.1

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

func (*MockInterface_Expecter) AddRepository added in v1.13.1

func (_e *MockInterface_Expecter) AddRepository(ctx interface{}, entry interface{}) *MockInterface_AddRepository_Call

AddRepository is a helper method to define mock.On call

  • ctx context.Context
  • entry *RepositoryEntry

func (*MockInterface_Expecter) InstallChart added in v1.13.1

func (_e *MockInterface_Expecter) InstallChart(ctx interface{}, spec interface{}) *MockInterface_InstallChart_Call

InstallChart is a helper method to define mock.On call

  • ctx context.Context
  • spec *ChartSpec

func (*MockInterface_Expecter) InstallOrUpgradeChart added in v1.13.1

func (_e *MockInterface_Expecter) InstallOrUpgradeChart(ctx interface{}, spec interface{}) *MockInterface_InstallOrUpgradeChart_Call

InstallOrUpgradeChart is a helper method to define mock.On call

  • ctx context.Context
  • spec *ChartSpec

func (*MockInterface_Expecter) UninstallRelease added in v1.13.1

func (_e *MockInterface_Expecter) UninstallRelease(ctx interface{}, releaseName interface{}, namespace interface{}) *MockInterface_UninstallRelease_Call

UninstallRelease is a helper method to define mock.On call

  • ctx context.Context
  • releaseName string
  • namespace string

type MockInterface_InstallChart_Call added in v1.13.1

type MockInterface_InstallChart_Call struct {
	*mock.Call
}

MockInterface_InstallChart_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'InstallChart'

func (*MockInterface_InstallChart_Call) Return added in v1.13.1

func (*MockInterface_InstallChart_Call) Run added in v1.13.1

func (*MockInterface_InstallChart_Call) RunAndReturn added in v1.13.1

type MockInterface_InstallOrUpgradeChart_Call added in v1.13.1

type MockInterface_InstallOrUpgradeChart_Call struct {
	*mock.Call
}

MockInterface_InstallOrUpgradeChart_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'InstallOrUpgradeChart'

func (*MockInterface_InstallOrUpgradeChart_Call) Return added in v1.13.1

func (*MockInterface_InstallOrUpgradeChart_Call) Run added in v1.13.1

func (*MockInterface_InstallOrUpgradeChart_Call) RunAndReturn added in v1.13.1

type MockInterface_UninstallRelease_Call added in v1.13.1

type MockInterface_UninstallRelease_Call struct {
	*mock.Call
}

MockInterface_UninstallRelease_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UninstallRelease'

func (*MockInterface_UninstallRelease_Call) Return added in v1.13.1

func (*MockInterface_UninstallRelease_Call) Run added in v1.13.1

func (*MockInterface_UninstallRelease_Call) RunAndReturn added in v1.13.1

func (_c *MockInterface_UninstallRelease_Call) RunAndReturn(run func(ctx context.Context, releaseName string, namespace string) error) *MockInterface_UninstallRelease_Call

type ReleaseInfo added in v1.12.3

type ReleaseInfo struct {
	Name       string
	Namespace  string
	Revision   int
	Status     string
	Chart      string
	AppVersion string
	Updated    time.Time
	Notes      string
}

ReleaseInfo captures metadata about a Helm release after an operation.

type RepositoryEntry added in v1.12.3

type RepositoryEntry struct {
	Name                  string
	URL                   string
	Username              string
	Password              string
	CertFile              string
	KeyFile               string
	CaFile                string
	InsecureSkipTLSverify bool
	PlainHTTP             bool
}

RepositoryEntry describes a Helm repository that should be added locally before performing chart operations.

Jump to

Keyboard shortcuts

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