helm

package
v0.49.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2025 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Overview

Package helm is a generated GoMock package.

Package helm is a generated GoMock package.

Index

Constants

View Source
const (
	ContourChartDefaultVersion = "11.1.1"
)
View Source
const (

	// RadiusSystemNamespace is the default namespace for Radius.
	RadiusSystemNamespace = "radius-system"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CLIClusterOptions

type CLIClusterOptions struct {
	Radius  ChartOptions
	Contour ChartOptions
}

type ChartOptions added in v0.41.0

type ChartOptions struct {
	// Disabled specifies whether the chart should be disabled.
	// Setting this to true will skip the chart installation.
	Disabled bool

	// Target namespace for deployment
	Namespace string

	// ReleaseName specifies the release name for the helm chart.
	ReleaseName string

	// ChartRepo specifies the helm chart repository.
	ChartRepo string

	// Reinstall specifies whether to reinstall the chart (helm upgrade).
	Reinstall bool

	// ChartPath specifies an override for the chart location.
	ChartPath string

	// ChartVersion specifies the chart version.
	ChartVersion string

	// SetArgs specifies as set of additional "values" to pass to helm. These are specified using the command-line syntax accepted
	// by helm, in the order they appear on the command line (last one wins).
	SetArgs []string

	// SetFileArgs specifies as set of additional "values" from file to pass it to helm.
	SetFileArgs []string

	// Wait specifies whether to wait for the chart to be ready.
	Wait bool
}

ChartOptions describes the options for a Helm chart.

type ClusterOptions

type ClusterOptions struct {
	Radius  RadiusChartOptions
	Contour ContourChartOptions
}

func NewDefaultClusterOptions

func NewDefaultClusterOptions() ClusterOptions

NewDefaultClusterOptions sets the default values for the ClusterOptions struct, using the chart version that matches the channel of the CLI (major.minor) or the latest available version if it is an edge build.

func PopulateDefaultClusterOptions

func PopulateDefaultClusterOptions(cliOptions CLIClusterOptions) ClusterOptions

PopulateDefaultClusterOptions compares the CLI options provided by the user to the default options and returns a ClusterOptions object with the CLI options overriding the default options if they are provided.

type ContourChartOptions added in v0.47.0

type ContourChartOptions struct {
	ChartOptions
	// HostNetwork specifies whether to use host networking for the Envoy pod.
	HostNetwork bool
	// Wait specifies whether to wait for the chart to be ready.
	Wait bool
}

type HelmAction added in v0.47.0

type HelmAction interface {
	// HelmChartFromContainerRegistry downloads a helm chart (using helm pull) from a container registry and returns the chart object.
	HelmChartFromContainerRegistry(version string, config *helm.Configuration, repoUrl string, releaseName string) (*chart.Chart, error)

	// ApplyHelmChart checks if a Helm chart is already installed, and if not, installs it or upgrades it if the "Reinstall" option is set.
	ApplyHelmChart(kubeContext string, helmChart *chart.Chart, helmConf *helm.Configuration, options ChartOptions) error

	// QueryRelease checks to see if a release is deployed to a namespace for a given kubecontext.
	// Returns a bool indicating if the release is deployed, the version of the release, and an error if one occurs.
	QueryRelease(kubeContext, releaseName, namespace string) (bool, string, error)

	// LoadChart loads a helm chart from the specified path and returns the chart object.
	LoadChart(chartPath string) (*chart.Chart, error)
}

HelmAction is an interface for performing actions on Helm charts.

type HelmActionImpl added in v0.47.0

type HelmActionImpl struct {
	HelmClient HelmClient
}

func NewHelmAction added in v0.47.0

func NewHelmAction(helmClient HelmClient) *HelmActionImpl

func (*HelmActionImpl) ApplyHelmChart added in v0.47.0

func (helmAction *HelmActionImpl) ApplyHelmChart(kubeContext string, helmChart *chart.Chart, helmConf *helm.Configuration, options ChartOptions) error

func (*HelmActionImpl) HelmChartFromContainerRegistry added in v0.47.0

func (helmAction *HelmActionImpl) HelmChartFromContainerRegistry(version string, config *helm.Configuration, repoUrl string, releaseName string) (*chart.Chart, error)

func (*HelmActionImpl) LoadChart added in v0.47.0

func (helmAction *HelmActionImpl) LoadChart(chartPath string) (*chart.Chart, error)

func (*HelmActionImpl) QueryRelease added in v0.47.0

func (helmAction *HelmActionImpl) QueryRelease(kubeContext, releaseName, namespace string) (bool, string, error)

type HelmClient added in v0.47.0

type HelmClient interface {
	// RunHelmInstall installs the Helm chart.
	RunHelmInstall(helmConf *helm.Configuration, helmChart *chart.Chart, releaseName, namespace string, wait bool) (*release.Release, error)

	// RunHelmUpgrade upgrades the Helm chart.
	RunHelmUpgrade(helmConf *helm.Configuration, helmChart *chart.Chart, releaseName, namespace string, wait bool) (*release.Release, error)

	// RunHelmUninstall uninstalls the Helm chart.
	RunHelmUninstall(helmConf *helm.Configuration, releaseName, namespace string, wait bool) (*release.UninstallReleaseResponse, error)

	// RunHelmList lists the Helm releases.
	RunHelmList(helmConf *helm.Configuration, releaseName string) ([]*release.Release, error)

	// RunHelmPull pulls the Helm chart.
	RunHelmPull(pullopts []helm.PullOpt, chartRef string) (string, error)

	// LoadChart loads a Helm chart from the specified path.
	LoadChart(chartPath string) (*chart.Chart, error)
}

HelmClient is an interface for interacting with Helm charts.

func NewHelmClient added in v0.47.0

func NewHelmClient() HelmClient

type HelmClientImpl added in v0.47.0

type HelmClientImpl struct{}

HelmClientImpl is an implementation of the HelmClient interface. It uses the Helm go sdk to perform operations on Helm charts.

func (*HelmClientImpl) LoadChart added in v0.47.0

func (client *HelmClientImpl) LoadChart(chartPath string) (*chart.Chart, error)

func (*HelmClientImpl) RunHelmInstall added in v0.47.0

func (client *HelmClientImpl) RunHelmInstall(helmConf *helm.Configuration, helmChart *chart.Chart, releaseName, namespace string, wait bool) (*release.Release, error)

func (*HelmClientImpl) RunHelmList added in v0.47.0

func (client *HelmClientImpl) RunHelmList(helmConf *helm.Configuration, releaseName string) ([]*release.Release, error)

func (*HelmClientImpl) RunHelmPull added in v0.47.0

func (client *HelmClientImpl) RunHelmPull(pullopts []helm.PullOpt, chartRef string) (string, error)

func (*HelmClientImpl) RunHelmUninstall added in v0.47.0

func (client *HelmClientImpl) RunHelmUninstall(helmConf *helm.Configuration, releaseName, namespace string, wait bool) (*release.UninstallReleaseResponse, error)

func (*HelmClientImpl) RunHelmUpgrade added in v0.47.0

func (client *HelmClientImpl) RunHelmUpgrade(helmConf *helm.Configuration, helmChart *chart.Chart, releaseName, namespace string, wait bool) (*release.Release, error)

type Impl

type Impl struct {
	// HelmClient is the Helm client used to interact with the Kubernetes cluster.
	Helm HelmClient
}

func (*Impl) CheckRadiusInstall

func (i *Impl) CheckRadiusInstall(kubeContext string) (InstallState, error)

CheckRadiusInstall checks if the Radius release is installed in the given kubeContext and returns an InstallState object with the version of the release if installed, or an error if an error occurs while checking.

func (*Impl) InstallRadius

func (i *Impl) InstallRadius(ctx context.Context, clusterOptions ClusterOptions, kubeContext string) error

InstallRadius installs Radius and its dependencies (Contour) on the cluster using the provided options.

func (*Impl) UninstallRadius

func (i *Impl) UninstallRadius(ctx context.Context, clusterOptions ClusterOptions, kubeContext string) error

UninstallRadius uninstalls Radius and its dependencies (Contour) from the cluster using the provided options.

func (*Impl) UpgradeRadius added in v0.47.0

func (i *Impl) UpgradeRadius(ctx context.Context, clusterOptions ClusterOptions, kubeContext string) error

UpgradeRadius upgrades the Radius installation on the cluster, based on the specified Kubernetes context.

type InstallState

type InstallState struct {
	// RadiusInstalled denotes whether the Radius helm chart is installed on the cluster.
	RadiusInstalled bool

	// RadiusVersion is the version of the Radius helm chart installed on the cluster. Will be blank if Radius is not installed.
	RadiusVersion string

	// ContourInstalled denotes whether the Contour helm chart is installed on the cluster.
	ContourInstalled bool

	// ContourVersion is the version of the Contour helm chart installed on the cluster. Will be blank if Contour is not installed.
	ContourVersion string
}

InstallState represents the state of the Radius installation on a Kubernetes cluster.

type Interface

type Interface interface {
	// InstallRadius installs Radius on the cluster, based on the specified Kubernetes context.
	InstallRadius(ctx context.Context, clusterOptions ClusterOptions, kubeContext string) error

	// UninstallRadius uninstalls Radius from the cluster based on the specified Kubernetes context. Will succeed regardless of whether Radius is installed.
	UninstallRadius(ctx context.Context, clusterOptions ClusterOptions, kubeContext string) error

	// UpgradeRadius upgrades the Radius installation on the cluster, based on the specified Kubernetes context.
	UpgradeRadius(ctx context.Context, clusterOptions ClusterOptions, kubeContext string) error

	// CheckRadiusInstall checks whether Radius is installed on the cluster, based on the specified Kubernetes context.
	CheckRadiusInstall(kubeContext string) (InstallState, error)
}

Interface provides an abstraction over Helm operations for installing Radius.

type MockHelmClient added in v0.47.0

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

MockHelmClient is a mock of HelmClient interface.

func NewMockHelmClient added in v0.47.0

func NewMockHelmClient(ctrl *gomock.Controller) *MockHelmClient

NewMockHelmClient creates a new mock instance.

func (*MockHelmClient) EXPECT added in v0.47.0

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockHelmClient) LoadChart added in v0.47.0

func (m *MockHelmClient) LoadChart(arg0 string) (*chart.Chart, error)

LoadChart mocks base method.

func (*MockHelmClient) RunHelmInstall added in v0.47.0

func (m *MockHelmClient) RunHelmInstall(arg0 *action.Configuration, arg1 *chart.Chart, arg2, arg3 string, arg4 bool) (*release.Release, error)

RunHelmInstall mocks base method.

func (*MockHelmClient) RunHelmList added in v0.47.0

func (m *MockHelmClient) RunHelmList(arg0 *action.Configuration, arg1 string) ([]*release.Release, error)

RunHelmList mocks base method.

func (*MockHelmClient) RunHelmPull added in v0.47.0

func (m *MockHelmClient) RunHelmPull(arg0 []action.PullOpt, arg1 string) (string, error)

RunHelmPull mocks base method.

func (*MockHelmClient) RunHelmUninstall added in v0.47.0

func (m *MockHelmClient) RunHelmUninstall(arg0 *action.Configuration, arg1, arg2 string, arg3 bool) (*release.UninstallReleaseResponse, error)

RunHelmUninstall mocks base method.

func (*MockHelmClient) RunHelmUpgrade added in v0.47.0

func (m *MockHelmClient) RunHelmUpgrade(arg0 *action.Configuration, arg1 *chart.Chart, arg2, arg3 string, arg4 bool) (*release.Release, error)

RunHelmUpgrade mocks base method.

type MockHelmClientLoadChartCall added in v0.47.0

type MockHelmClientLoadChartCall struct {
	*gomock.Call
}

MockHelmClientLoadChartCall wrap *gomock.Call

func (*MockHelmClientLoadChartCall) Do added in v0.47.0

Do rewrite *gomock.Call.Do

func (*MockHelmClientLoadChartCall) DoAndReturn added in v0.47.0

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*MockHelmClientLoadChartCall) Return added in v0.47.0

Return rewrite *gomock.Call.Return

type MockHelmClientMockRecorder added in v0.47.0

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

MockHelmClientMockRecorder is the mock recorder for MockHelmClient.

func (*MockHelmClientMockRecorder) LoadChart added in v0.47.0

LoadChart indicates an expected call of LoadChart.

func (*MockHelmClientMockRecorder) RunHelmInstall added in v0.47.0

func (mr *MockHelmClientMockRecorder) RunHelmInstall(arg0, arg1, arg2, arg3, arg4 any) *MockHelmClientRunHelmInstallCall

RunHelmInstall indicates an expected call of RunHelmInstall.

func (*MockHelmClientMockRecorder) RunHelmList added in v0.47.0

func (mr *MockHelmClientMockRecorder) RunHelmList(arg0, arg1 any) *MockHelmClientRunHelmListCall

RunHelmList indicates an expected call of RunHelmList.

func (*MockHelmClientMockRecorder) RunHelmPull added in v0.47.0

func (mr *MockHelmClientMockRecorder) RunHelmPull(arg0, arg1 any) *MockHelmClientRunHelmPullCall

RunHelmPull indicates an expected call of RunHelmPull.

func (*MockHelmClientMockRecorder) RunHelmUninstall added in v0.47.0

func (mr *MockHelmClientMockRecorder) RunHelmUninstall(arg0, arg1, arg2, arg3 any) *MockHelmClientRunHelmUninstallCall

RunHelmUninstall indicates an expected call of RunHelmUninstall.

func (*MockHelmClientMockRecorder) RunHelmUpgrade added in v0.47.0

func (mr *MockHelmClientMockRecorder) RunHelmUpgrade(arg0, arg1, arg2, arg3, arg4 any) *MockHelmClientRunHelmUpgradeCall

RunHelmUpgrade indicates an expected call of RunHelmUpgrade.

type MockHelmClientRunHelmInstallCall added in v0.47.0

type MockHelmClientRunHelmInstallCall struct {
	*gomock.Call
}

MockHelmClientRunHelmInstallCall wrap *gomock.Call

func (*MockHelmClientRunHelmInstallCall) Do added in v0.47.0

Do rewrite *gomock.Call.Do

func (*MockHelmClientRunHelmInstallCall) DoAndReturn added in v0.47.0

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*MockHelmClientRunHelmInstallCall) Return added in v0.47.0

Return rewrite *gomock.Call.Return

type MockHelmClientRunHelmListCall added in v0.47.0

type MockHelmClientRunHelmListCall struct {
	*gomock.Call
}

MockHelmClientRunHelmListCall wrap *gomock.Call

func (*MockHelmClientRunHelmListCall) Do added in v0.47.0

Do rewrite *gomock.Call.Do

func (*MockHelmClientRunHelmListCall) DoAndReturn added in v0.47.0

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*MockHelmClientRunHelmListCall) Return added in v0.47.0

Return rewrite *gomock.Call.Return

type MockHelmClientRunHelmPullCall added in v0.47.0

type MockHelmClientRunHelmPullCall struct {
	*gomock.Call
}

MockHelmClientRunHelmPullCall wrap *gomock.Call

func (*MockHelmClientRunHelmPullCall) Do added in v0.47.0

Do rewrite *gomock.Call.Do

func (*MockHelmClientRunHelmPullCall) DoAndReturn added in v0.47.0

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*MockHelmClientRunHelmPullCall) Return added in v0.47.0

Return rewrite *gomock.Call.Return

type MockHelmClientRunHelmUninstallCall added in v0.47.0

type MockHelmClientRunHelmUninstallCall struct {
	*gomock.Call
}

MockHelmClientRunHelmUninstallCall wrap *gomock.Call

func (*MockHelmClientRunHelmUninstallCall) Do added in v0.47.0

Do rewrite *gomock.Call.Do

func (*MockHelmClientRunHelmUninstallCall) DoAndReturn added in v0.47.0

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*MockHelmClientRunHelmUninstallCall) Return added in v0.47.0

Return rewrite *gomock.Call.Return

type MockHelmClientRunHelmUpgradeCall added in v0.47.0

type MockHelmClientRunHelmUpgradeCall struct {
	*gomock.Call
}

MockHelmClientRunHelmUpgradeCall wrap *gomock.Call

func (*MockHelmClientRunHelmUpgradeCall) Do added in v0.47.0

Do rewrite *gomock.Call.Do

func (*MockHelmClientRunHelmUpgradeCall) DoAndReturn added in v0.47.0

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*MockHelmClientRunHelmUpgradeCall) Return added in v0.47.0

Return rewrite *gomock.Call.Return

type MockInterface

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

MockInterface is a mock of Interface interface.

func NewMockInterface

func NewMockInterface(ctrl *gomock.Controller) *MockInterface

NewMockInterface creates a new mock instance.

func (*MockInterface) CheckRadiusInstall

func (m *MockInterface) CheckRadiusInstall(arg0 string) (InstallState, error)

CheckRadiusInstall mocks base method.

func (*MockInterface) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockInterface) InstallRadius

func (m *MockInterface) InstallRadius(arg0 context.Context, arg1 ClusterOptions, arg2 string) error

InstallRadius mocks base method.

func (*MockInterface) UninstallRadius

func (m *MockInterface) UninstallRadius(arg0 context.Context, arg1 ClusterOptions, arg2 string) error

UninstallRadius mocks base method.

func (*MockInterface) UpgradeRadius added in v0.47.0

func (m *MockInterface) UpgradeRadius(arg0 context.Context, arg1 ClusterOptions, arg2 string) error

UpgradeRadius mocks base method.

type MockInterfaceCheckRadiusInstallCall added in v0.35.0

type MockInterfaceCheckRadiusInstallCall struct {
	*gomock.Call
}

MockInterfaceCheckRadiusInstallCall wrap *gomock.Call

func (*MockInterfaceCheckRadiusInstallCall) Do added in v0.35.0

Do rewrite *gomock.Call.Do

func (*MockInterfaceCheckRadiusInstallCall) DoAndReturn added in v0.35.0

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*MockInterfaceCheckRadiusInstallCall) Return added in v0.35.0

Return rewrite *gomock.Call.Return

type MockInterfaceInstallRadiusCall added in v0.35.0

type MockInterfaceInstallRadiusCall struct {
	*gomock.Call
}

MockInterfaceInstallRadiusCall wrap *gomock.Call

func (*MockInterfaceInstallRadiusCall) Do added in v0.35.0

Do rewrite *gomock.Call.Do

func (*MockInterfaceInstallRadiusCall) DoAndReturn added in v0.35.0

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*MockInterfaceInstallRadiusCall) Return added in v0.35.0

Return rewrite *gomock.Call.Return

type MockInterfaceMockRecorder

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

MockInterfaceMockRecorder is the mock recorder for MockInterface.

func (*MockInterfaceMockRecorder) CheckRadiusInstall

CheckRadiusInstall indicates an expected call of CheckRadiusInstall.

func (*MockInterfaceMockRecorder) InstallRadius

func (mr *MockInterfaceMockRecorder) InstallRadius(arg0, arg1, arg2 any) *MockInterfaceInstallRadiusCall

InstallRadius indicates an expected call of InstallRadius.

func (*MockInterfaceMockRecorder) UninstallRadius

func (mr *MockInterfaceMockRecorder) UninstallRadius(arg0, arg1, arg2 any) *MockInterfaceUninstallRadiusCall

UninstallRadius indicates an expected call of UninstallRadius.

func (*MockInterfaceMockRecorder) UpgradeRadius added in v0.47.0

func (mr *MockInterfaceMockRecorder) UpgradeRadius(arg0, arg1, arg2 any) *MockInterfaceUpgradeRadiusCall

UpgradeRadius indicates an expected call of UpgradeRadius.

type MockInterfaceUninstallRadiusCall added in v0.35.0

type MockInterfaceUninstallRadiusCall struct {
	*gomock.Call
}

MockInterfaceUninstallRadiusCall wrap *gomock.Call

func (*MockInterfaceUninstallRadiusCall) Do added in v0.35.0

Do rewrite *gomock.Call.Do

func (*MockInterfaceUninstallRadiusCall) DoAndReturn added in v0.35.0

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*MockInterfaceUninstallRadiusCall) Return added in v0.35.0

Return rewrite *gomock.Call.Return

type MockInterfaceUpgradeRadiusCall added in v0.47.0

type MockInterfaceUpgradeRadiusCall struct {
	*gomock.Call
}

MockInterfaceUpgradeRadiusCall wrap *gomock.Call

func (*MockInterfaceUpgradeRadiusCall) Do added in v0.47.0

Do rewrite *gomock.Call.Do

func (*MockInterfaceUpgradeRadiusCall) DoAndReturn added in v0.47.0

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*MockInterfaceUpgradeRadiusCall) Return added in v0.47.0

Return rewrite *gomock.Call.Return

type RadiusChartOptions added in v0.47.0

type RadiusChartOptions struct {
	ChartOptions
}

Jump to

Keyboard shortcuts

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