helm

package
v0.0.55 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2025 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetValuesYaml

func GetValuesYaml(c *chart.Chart) string

GetValuesYaml 提取 values.yaml 文件内容

func ParseValuesYaml

func ParseValuesYaml(data string) (map[string]interface{}, error)

Types

type Client

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

func (*Client) AddOrUpdateRepo

func (c *Client) AddOrUpdateRepo(repoEntry *repo.Entry) error

AddOrUpdateRepo Add or update repo from repo config

func (*Client) GetChartValue

func (c *Client) GetChartValue(repoName, chartName, version string) (string, error)

func (*Client) GetChartVersions

func (c *Client) GetChartVersions(repoName string, chartName string) ([]string, error)

GetChartVersions 获取chart的版本

func (*Client) GetReleaseHistory

func (c *Client) GetReleaseHistory(releaseName string) ([]*release.Release, error)

GetReleaseHistory check release installed or not

func (*Client) GetReleaseList

func (c *Client) GetReleaseList() ([]*release.Release, error)

func (*Client) InstallRelease

func (c *Client) InstallRelease(namespace, releaseName, repoName, chartName, version string, values ...string) error

InstallRelease install release

func (*Client) UninstallRelease

func (c *Client) UninstallRelease(releaseName string) error

UninstallRelease uninstall release which deployed

func (*Client) UpdateReposIndex

func (c *Client) UpdateReposIndex(ids string)

func (*Client) UpgradeRelease

func (c *Client) UpgradeRelease(releaseName, repoName, targetVersion string, values ...string) error

UpgradeRelease upgrade release version

type Helm

type Helm interface {
	AddOrUpdateRepo(repoEntry *repo.Entry) error
	GetReleaseHistory(releaseName string) ([]*release.Release, error)
	InstallRelease(namespace, releaseName, repoName, chartName, version string, values ...string) error
	UninstallRelease(releaseName string) error
	UpgradeRelease(releaseName, repoName, targetVersion string, values ...string) error
	GetChartValue(repoName, chartName, version string) (string, error)
	GetChartVersions(repoName string, chartName string) ([]string, error)
	UpdateReposIndex(ids string)
	GetReleaseList() ([]*release.Release, error)
}

func New

func New(restConfig *rest.Config, namespace string, options ...Option) (Helm, error)

New Helm Interface 此处namespace 决定了release 记录信息写入哪个命名空间

type Option

type Option func(client *Client)

func WithRESTClientGetter

func WithRESTClientGetter(getter *RESTClientGetterImpl) Option

WithRESTClientGetter with custom rest client getter, use rest.Config to visit Kubernetes

type RESTClientGetterImpl

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

RESTClientGetterImpl impl genericclioptions.RESTClientGetter

func NewRESTClientGetterImpl

func NewRESTClientGetterImpl(rc *rest.Config) *RESTClientGetterImpl

NewRESTClientGetterImpl new RESTClientGetterImpl

func (*RESTClientGetterImpl) ToDiscoveryClient

func (*RESTClientGetterImpl) ToRESTConfig

func (r *RESTClientGetterImpl) ToRESTConfig() (*rest.Config, error)

func (*RESTClientGetterImpl) ToRESTMapper

func (r *RESTClientGetterImpl) ToRESTMapper() (meta.RESTMapper, error)

func (*RESTClientGetterImpl) ToRawKubeConfigLoader

func (r *RESTClientGetterImpl) ToRawKubeConfigLoader() clientcmd.ClientConfig

Jump to

Keyboard shortcuts

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