-
Notifications
You must be signed in to change notification settings - Fork 103
/
interface.go
43 lines (38 loc) · 1.63 KB
/
interface.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package helmclient
import (
"context"
"helm.sh/helm/v3/pkg/cli"
"helm.sh/helm/v3/pkg/getter"
"helm.sh/helm/v3/pkg/action"
"helm.sh/helm/v3/pkg/chart"
"helm.sh/helm/v3/pkg/release"
"helm.sh/helm/v3/pkg/repo"
)
// Client holds the method signatures for a Helm client.
// NOTE: This is an interface to allow for mocking in tests.
type Client interface {
AddOrUpdateChartRepo(entry repo.Entry) error
UpdateChartRepos() error
InstallOrUpgradeChart(ctx context.Context, spec *ChartSpec, opts *GenericHelmOptions) (*release.Release, error)
InstallChart(ctx context.Context, spec *ChartSpec, opts *GenericHelmOptions) (*release.Release, error)
UpgradeChart(ctx context.Context, spec *ChartSpec, opts *GenericHelmOptions) (*release.Release, error)
ListDeployedReleases() ([]*release.Release, error)
ListReleasesByStateMask(action.ListStates) ([]*release.Release, error)
GetRelease(name string) (*release.Release, error)
// RollBack is an interface to abstract a rollback action.
RollBack
GetReleaseValues(name string, allValues bool) (map[string]interface{}, error)
GetSettings() *cli.EnvSettings
GetProviders() getter.Providers
UninstallRelease(spec *ChartSpec) error
UninstallReleaseByName(name string) error
TemplateChart(spec *ChartSpec, options *HelmTemplateOptions) ([]byte, error)
LintChart(spec *ChartSpec) error
SetDebugLog(debugLog action.DebugLog)
ListReleaseHistory(name string, max int) ([]*release.Release, error)
GetChart(chartName string, chartPathOptions *action.ChartPathOptions) (*chart.Chart, string, error)
RunChartTests(releaseName string) (bool, error)
}
type RollBack interface {
RollbackRelease(spec *ChartSpec) error
}