Documentation
¶
Overview ¶
Package helm provides helpers for interacting with Helm in KSail.
Index ¶
- Constants
- type ChartSpec
- type Client
- func (c *Client) AddRepository(ctx context.Context, entry *RepositoryEntry) error
- func (c *Client) InstallChart(ctx context.Context, spec *ChartSpec) (*ReleaseInfo, error)
- func (c *Client) InstallOrUpgradeChart(ctx context.Context, spec *ChartSpec) (*ReleaseInfo, error)
- func (c *Client) UninstallRelease(ctx context.Context, releaseName, namespace string) error
- type Interface
- type MockInterface
- func (_mock *MockInterface) AddRepository(ctx context.Context, entry *RepositoryEntry) error
- func (_m *MockInterface) EXPECT() *MockInterface_Expecter
- func (_mock *MockInterface) InstallChart(ctx context.Context, spec *ChartSpec) (*ReleaseInfo, error)
- func (_mock *MockInterface) InstallOrUpgradeChart(ctx context.Context, spec *ChartSpec) (*ReleaseInfo, error)
- func (_mock *MockInterface) UninstallRelease(ctx context.Context, releaseName string, namespace string) error
- type MockInterface_AddRepository_Call
- func (_c *MockInterface_AddRepository_Call) Return(err error) *MockInterface_AddRepository_Call
- func (_c *MockInterface_AddRepository_Call) Run(run func(ctx context.Context, entry *RepositoryEntry)) *MockInterface_AddRepository_Call
- func (_c *MockInterface_AddRepository_Call) RunAndReturn(run func(ctx context.Context, entry *RepositoryEntry) error) *MockInterface_AddRepository_Call
- type MockInterface_Expecter
- func (_e *MockInterface_Expecter) AddRepository(ctx interface{}, entry interface{}) *MockInterface_AddRepository_Call
- func (_e *MockInterface_Expecter) InstallChart(ctx interface{}, spec interface{}) *MockInterface_InstallChart_Call
- func (_e *MockInterface_Expecter) InstallOrUpgradeChart(ctx interface{}, spec interface{}) *MockInterface_InstallOrUpgradeChart_Call
- func (_e *MockInterface_Expecter) UninstallRelease(ctx interface{}, releaseName interface{}, namespace interface{}) *MockInterface_UninstallRelease_Call
- type MockInterface_InstallChart_Call
- func (_c *MockInterface_InstallChart_Call) Return(releaseInfo *ReleaseInfo, err error) *MockInterface_InstallChart_Call
- func (_c *MockInterface_InstallChart_Call) Run(run func(ctx context.Context, spec *ChartSpec)) *MockInterface_InstallChart_Call
- func (_c *MockInterface_InstallChart_Call) RunAndReturn(run func(ctx context.Context, spec *ChartSpec) (*ReleaseInfo, error)) *MockInterface_InstallChart_Call
- type MockInterface_InstallOrUpgradeChart_Call
- func (_c *MockInterface_InstallOrUpgradeChart_Call) Return(releaseInfo *ReleaseInfo, err error) *MockInterface_InstallOrUpgradeChart_Call
- func (_c *MockInterface_InstallOrUpgradeChart_Call) Run(run func(ctx context.Context, spec *ChartSpec)) *MockInterface_InstallOrUpgradeChart_Call
- func (_c *MockInterface_InstallOrUpgradeChart_Call) RunAndReturn(run func(ctx context.Context, spec *ChartSpec) (*ReleaseInfo, error)) *MockInterface_InstallOrUpgradeChart_Call
- type MockInterface_UninstallRelease_Call
- func (_c *MockInterface_UninstallRelease_Call) Return(err error) *MockInterface_UninstallRelease_Call
- func (_c *MockInterface_UninstallRelease_Call) Run(run func(ctx context.Context, releaseName string, namespace string)) *MockInterface_UninstallRelease_Call
- func (_c *MockInterface_UninstallRelease_Call) RunAndReturn(run func(ctx context.Context, releaseName string, namespace string) error) *MockInterface_UninstallRelease_Call
- type ReleaseInfo
- type RepositoryEntry
Constants ¶
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 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
InstallChart installs a Helm chart using the provided specification.
func (*Client) InstallOrUpgradeChart ¶ added in v1.12.3
InstallOrUpgradeChart upgrades a Helm chart when present and installs it otherwise.
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
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
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 (_c *MockInterface_AddRepository_Call) Return(err error) *MockInterface_AddRepository_Call
func (*MockInterface_AddRepository_Call) Run ¶ added in v1.13.1
func (_c *MockInterface_AddRepository_Call) Run(run func(ctx context.Context, entry *RepositoryEntry)) *MockInterface_AddRepository_Call
func (*MockInterface_AddRepository_Call) RunAndReturn ¶ added in v1.13.1
func (_c *MockInterface_AddRepository_Call) RunAndReturn(run func(ctx context.Context, entry *RepositoryEntry) error) *MockInterface_AddRepository_Call
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
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 (_c *MockInterface_InstallChart_Call) Return(releaseInfo *ReleaseInfo, err error) *MockInterface_InstallChart_Call
func (*MockInterface_InstallChart_Call) Run ¶ added in v1.13.1
func (_c *MockInterface_InstallChart_Call) Run(run func(ctx context.Context, spec *ChartSpec)) *MockInterface_InstallChart_Call
func (*MockInterface_InstallChart_Call) RunAndReturn ¶ added in v1.13.1
func (_c *MockInterface_InstallChart_Call) RunAndReturn(run func(ctx context.Context, spec *ChartSpec) (*ReleaseInfo, error)) *MockInterface_InstallChart_Call
type MockInterface_InstallOrUpgradeChart_Call ¶ added in v1.13.1
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 (_c *MockInterface_InstallOrUpgradeChart_Call) Return(releaseInfo *ReleaseInfo, err error) *MockInterface_InstallOrUpgradeChart_Call
func (*MockInterface_InstallOrUpgradeChart_Call) Run ¶ added in v1.13.1
func (_c *MockInterface_InstallOrUpgradeChart_Call) Run(run func(ctx context.Context, spec *ChartSpec)) *MockInterface_InstallOrUpgradeChart_Call
func (*MockInterface_InstallOrUpgradeChart_Call) RunAndReturn ¶ added in v1.13.1
func (_c *MockInterface_InstallOrUpgradeChart_Call) RunAndReturn(run func(ctx context.Context, spec *ChartSpec) (*ReleaseInfo, error)) *MockInterface_InstallOrUpgradeChart_Call
type MockInterface_UninstallRelease_Call ¶ added in v1.13.1
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 (_c *MockInterface_UninstallRelease_Call) Return(err error) *MockInterface_UninstallRelease_Call
func (*MockInterface_UninstallRelease_Call) Run ¶ added in v1.13.1
func (_c *MockInterface_UninstallRelease_Call) Run(run func(ctx context.Context, releaseName string, namespace string)) *MockInterface_UninstallRelease_Call
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.