framework

package
v0.0.0-...-900d465 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ResolvePath

func ResolvePath(path string) (string, error)

ResolvePath resolves a path containing $HOME or ~ to an absolute path.

Types

type HelmChartOptions

type HelmChartOptions struct {
	CleanupOnFail bool
	GenerateName  bool
	ReleaseName   string
	Timeout       time.Duration
	Wait          bool
	DryRun        bool
}

type HelmClient

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

HelmClient is the helm client, that allows to work with helm packages

func NewHelmClient

func NewHelmClient(opts ...HelmClientOption) (*HelmClient, error)

NewHelmClient creates a new helm client

func (*HelmClient) Cleanup

func (c *HelmClient) Cleanup() error

func (*HelmClient) Install

func (c *HelmClient) Install(ctx context.Context, params []string, chartOpts HelmChartOptions) (string, error)

Install deploys the helm chart

func (*HelmClient) Uninstall

func (c *HelmClient) Uninstall(releaseName string) error

type HelmClientOption

type HelmClientOption func(client *HelmClient)

HelmClientOption is a function that can be used to set the fields of the helm Client

func HelmWithChart

func HelmWithChart(chart string) HelmClientOption

HelmWithChart sets a chart value in the HelmClient struct

func HelmWithKubeConfig

func HelmWithKubeConfig(kubeconfig *restclient.Config) HelmClientOption

HelmWithKubeConfig sets a kubeconfig value in the HelmClient struct

func HelmWithNamespace

func HelmWithNamespace(namespace string) HelmClientOption

HelmWithNamespace sets a namespace value in the HelmClient struct

type KubeClient

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

KubeClient is a kubernetes client

func NewKubeClient

func NewKubeClient(k8sConfig *rest.Config) (*KubeClient, error)

NewKubeClient creates a new KubeClient instance

func (*KubeClient) CheckPodStatus

func (c *KubeClient) CheckPodStatus(ctx context.Context,
	namespace, podName string,
	condition func(namespace, podName string, status corev1.PodStatus) (bool, error),
) (bool, error)

func (*KubeClient) CreateNamespace

func (c *KubeClient) CreateNamespace(
	ctx context.Context,
	namespace string,
	labels map[string]string,
) (*corev1.Namespace, error)

CreateNamespace creates a new namespace

func (*KubeClient) CreatePod

func (c *KubeClient) CreatePod(ctx context.Context,
	namespace string,
	labels map[string]string,
	name string,
	containerName string,
	image string,
) (*corev1.Pod, error)

CreatePod creates a new pod in the defined namespace

func (*KubeClient) DeleteNamespace

func (c *KubeClient) DeleteNamespace(
	ctx context.Context,
	namespace string,
) error

DeleteNamespace deletes the namespace

func (*KubeClient) DeletePod

func (c *KubeClient) DeletePod(ctx context.Context,
	namespace string,
	name string,
) error

DeletePod deletes a pod in the defined namespace

func (*KubeClient) DoHttpRequest

func (c *KubeClient) DoHttpRequest(ctx context.Context,
	namespace string,
	name string,
	port uint,
	path string,
) ([]byte, error)

DoHttpRequest makes http request to path on the pod

func (*KubeClient) GetPodsByLabel

func (c *KubeClient) GetPodsByLabel(ctx context.Context, namespace string, labelMap map[string]string) ([]corev1.Pod, error)

GetPodsByLabel returns a list of pods that matches with the label selector

Jump to

Keyboard shortcuts

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