helm

package
v0.41.0 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Overview

Package helm is a generated GoMock package.

Index

Constants

View Source
const (
	ContourChartDefaultVersion = "11.1.1"
	DaprChartDefaultVersion    = "1.14.4"
)
View Source
const (
	RadiusSystemNamespace = "radius-system"

	DaprSystemNamespace = "dapr-system"
)

Variables

This section is empty.

Functions

func AddContourValues

func AddContourValues(helmChart *chart.Chart, options ContourOptions) error

// AddContourValues adds values to the helm chart to enable host networking for the Envoy pod, and sets the default LoadBalancer service ports to 8080 and 8443 so that they don't conflict with Envoy while using Host Networking. It returns an error if any of the nodes in the chart values are not found.

func AddValues added in v0.41.0

func AddValues(helmChart *chart.Chart, options *ChartOptions) error

AddValues parses the --set arguments in order and adds them to the helm chart values, returning an error if any of the arguments are invalid.

func ApplyContourHelmChart

func ApplyContourHelmChart(options ContourOptions, kubeContext string) error

// ApplyContourHelmChart checks if a Contour Helm chart has been installed, and if not, installs it with the given options. If an error occurs, it returns an error with the Helm output.

func ApplyHelmChart added in v0.41.0

func ApplyHelmChart(options ChartOptions, kubeContext string) (bool, error)

ApplyHelmChart checks if a Helm chart is already installed, and if not, installs it or upgrades it if the "Reinstall" option is set. It returns a boolean indicating if the chart was already installed and an error if one occurred.

func HelmConfig

func HelmConfig(builder *strings.Builder, flags *genericclioptions.ConfigFlags) (*helm.Configuration, error)

HelmConfig initializes a helm configuration object and sets the backend storage driver to use kubernetes secrets, returning the configuration object and an error if one occurs.

func Install

func Install(ctx context.Context, clusterOptions ClusterOptions, kubeContext string) (bool, error)

Install takes in a context, clusterOptions and kubeContext and returns a boolean and an error. If an error is encountered, it is returned.

func RunContourHelmInstall

func RunContourHelmInstall(helmConf *helm.Configuration, helmChart *chart.Chart) error

RunContourHelmInstall creates a new helm install client with the given configuration and chart, sets the release name and namespace, and then runs the install. It returns an error if the install fails.

func RunContourHelmUninstall

func RunContourHelmUninstall(helmConf *helm.Configuration) error

This function "RunContourHelmUninstall" uses the Helm configuration to uninstall Contour from the specified namespace, and returns an error if the uninstall fails.

func RunHelmUninstall added in v0.41.0

func RunHelmUninstall(helmConf *helm.Configuration, options ChartOptions) error

RunRadiusHelmUninstall attempts to uninstall Radius from the Radius system namespace using a helm configuration, and returns an error if the uninstall fails.

func UninstallOnCluster

func UninstallOnCluster(kubeContext string, clusterOptions ClusterOptions) error

UninstallOnCluster retrieves the Helm configuration and runs the Contour and Radius Helm uninstall commands to remove the Helm releases from the cluster.

Types

type CLIClusterOptions

type CLIClusterOptions struct {
	Radius ChartOptions
}

type ChartOptions added in v0.41.0

type ChartOptions struct {
	// 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
}

ChartOptions describes the options for the a helm chart.

type ClusterOptions

type ClusterOptions struct {
	Contour ContourOptions
	Radius  ChartOptions
	Dapr    ChartOptions
}

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 ContourOptions

type ContourOptions struct {
	ChartVersion string
	HostNetwork  bool
}

type Impl

type Impl struct {
}

func (*Impl) CheckRadiusInstall

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

Checks if radius is installed based on kubeContext.

func (*Impl) InstallRadius

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

Installs radius on a cluster based on kubeContext.

func (*Impl) UninstallRadius

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

UninstallRadius uninstalls RADIUS from the specified Kubernetes cluster, and returns an error if it fails.

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

	// DaprInstalled denotes whether the Dapr helm chart is installed on the cluster.
	DaprInstalled bool

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

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

func CheckRadiusInstall

func 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.

type Interface

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

	// InstallRadius installs Radius on the cluster, based on the specified Kubernetes context.
	InstallRadius(ctx context.Context, clusterOptions ClusterOptions, kubeContext string) (bool, 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
}

Interface provides an abstraction over Helm operations for installing Radius.

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) (bool, error)

InstallRadius mocks base method.

func (*MockInterface) UninstallRadius

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

UninstallRadius 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.

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

Jump to

Keyboard shortcuts

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