helm

package
v0.0.151 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2025 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StartUpdateHelmRepoInBackground added in v0.0.137

func StartUpdateHelmRepoInBackground()

Types

type ChartVersion added in v0.0.137

type ChartVersion struct {
	*Metadata
	URLs    []string  `json:"urls"`
	Created time.Time `json:"created,omitempty"`
	Removed bool      `json:"removed,omitempty"`
	Digest  string    `json:"digest,omitempty"`

	// ChecksumDeprecated is deprecated in Helm 3, and therefore ignored. Helm 3 replaced
	// this with Digest. However, with a strict YAML parser enabled, a field must be
	// present on the struct for backwards compatibility.
	ChecksumDeprecated string `json:"checksum,omitempty"`

	// EngineDeprecated is deprecated in Helm 3, and therefore ignored. However, with a strict
	// YAML parser enabled, this field must be present.
	EngineDeprecated string `json:"engine,omitempty"`

	// TillerVersionDeprecated is deprecated in Helm 3, and therefore ignored. However, with a strict
	// YAML parser enabled, this field must be present.
	TillerVersionDeprecated string `json:"tillerVersion,omitempty"`

	// URLDeprecated is deprecated in Helm 3, superseded by URLs. It is ignored. However,
	// with a strict YAML parser enabled, this must be present on the struct.
	URLDeprecated string `json:"url,omitempty"`
}

type ChartVersions added in v0.0.137

type ChartVersions []*ChartVersion

type Dependency added in v0.0.137

type Dependency struct {
	// Name is the name of the dependency.
	//
	// This must mach the name in the dependency's Chart.yaml.
	Name string `json:"name" yaml:"name"`
	// Version is the version (range) of this chart.
	//
	// A lock file will always produce a single version, while a dependency
	// may contain a semantic version range.
	Version string `json:"version,omitempty" yaml:"version,omitempty"`
	// The URL to the repository.
	//
	// Appending `index.yaml` to this string should result in a URL that can be
	// used to fetch the repository index.
	Repository string `json:"repository" yaml:"repository"`
	// A yaml path that resolves to a boolean, used for enabling/disabling charts (e.g. subchart1.enabled )
	Condition string `json:"condition,omitempty" yaml:"condition,omitempty"`
	// Tags can be used to group charts for enabling/disabling together
	Tags []string `json:"tags,omitempty" yaml:"tags,omitempty"`
	// Enabled bool determines if chart should be loaded
	Enabled bool `json:"enabled,omitempty" yaml:"enabled,omitempty"`
	// ImportValues holds the mapping of source values to parent key to be imported. Each item can be a
	// string or pair of child/parent sublist items.
	ImportValues []interface{} `json:"import-values,omitempty" yaml:"import-values,omitempty"`
	// Alias usable alias to be used for the chart
	Alias string `json:"alias,omitempty" yaml:"alias,omitempty"`
}

Dependency describes a chart upon which another chart depends.

Dependencies can be used to express developer intent, or to capture the state of a chart.

type Helm

type Helm interface {
	AddOrUpdateRepo(repo *models.HelmRepository) error
	GetReleaseHistory(ns, releaseName string) ([]*models.ReleaseHistory, error)
	InstallRelease(ns, releaseName, repoName, chartName, version string, values ...string) error
	UninstallRelease(ns, releaseName string) error
	UpgradeRelease(ns, name string, values ...string) error
	GetChartValue(repoName, chartName, version string) (string, error)
	GetChartVersions(repoName, chartName string) ([]string, error)
	UpdateReposIndex(ids string)
	GetReleaseList() ([]*models.Release, error)
	GetReleaseNote(ns, name string) (string, error)
	GetReleaseNoteWithRevision(ns, name, revision string) (string, error)
	GetReleaseValues(ns, name string) (string, error)
	GetReleaseValuesWithRevision(ns, name, revision string) (string, error)
	RemoveRepo(repoName string) error
	GetRepoList() ([]*RepoVO, error)
}

type HelmCmd added in v0.0.137

type HelmCmd struct {
	HelmBin string // helm 二进制路径,默认 "helm"
	// contains filtered or unexported fields
}

func NewBackgroundHelmCmd added in v0.0.137

func NewBackgroundHelmCmd(helmBin string) *HelmCmd

NewBackgroundHelmCmd 独立后台执行Helm命令

func NewHelmCmd added in v0.0.137

func NewHelmCmd(helmBin string, clusterID string, cluster *service.ClusterConfig) *HelmCmd

func NewHelmCmdWithNoCluster added in v0.0.144

func NewHelmCmdWithNoCluster(helmBin string) *HelmCmd

NewHelmCmdWithNoCluster 仅Helm命令

func (*HelmCmd) AddOrUpdateRepo added in v0.0.137

func (h *HelmCmd) AddOrUpdateRepo(helmRepo *models.HelmRepository) error

AddOrUpdateRepo 添加或更新 Helm 仓库

func (*HelmCmd) GetChartValue added in v0.0.137

func (h *HelmCmd) GetChartValue(repoName, chartName, version string) (string, error)

func (*HelmCmd) GetChartVersions added in v0.0.137

func (h *HelmCmd) GetChartVersions(repoName string, chartName string) ([]string, error)

func (*HelmCmd) GetReleaseHistory added in v0.0.137

func (h *HelmCmd) GetReleaseHistory(namespace string, releaseName string) ([]*models.ReleaseHistory, error)

func (*HelmCmd) GetReleaseList added in v0.0.137

func (h *HelmCmd) GetReleaseList() ([]*models.Release, error)

func (*HelmCmd) GetReleaseNote added in v0.0.137

func (h *HelmCmd) GetReleaseNote(ns string, name string) (string, error)

func (*HelmCmd) GetReleaseNoteWithRevision added in v0.0.137

func (h *HelmCmd) GetReleaseNoteWithRevision(ns string, name string, revision string) (string, error)

func (*HelmCmd) GetReleaseValues added in v0.0.137

func (h *HelmCmd) GetReleaseValues(ns string, name string) (string, error)

func (*HelmCmd) GetReleaseValuesWithRevision added in v0.0.137

func (h *HelmCmd) GetReleaseValuesWithRevision(ns string, name string, revision string) (string, error)

func (*HelmCmd) GetRepoList added in v0.0.137

func (h *HelmCmd) GetRepoList() ([]*RepoVO, error)

func (*HelmCmd) InstallRelease added in v0.0.137

func (h *HelmCmd) InstallRelease(namespace, releaseName, repoName, chartName, version string, values ...string) error

func (*HelmCmd) ReAddMissingRepo added in v0.0.137

func (h *HelmCmd) ReAddMissingRepo()

ReAddMissingRepo 重新添加丢失的Repo,比如在容器环境中重启了。

func (*HelmCmd) RemoveRepo added in v0.0.137

func (h *HelmCmd) RemoveRepo(repoName string) error

func (*HelmCmd) UninstallRelease added in v0.0.137

func (h *HelmCmd) UninstallRelease(namespace string, releaseName string) error

func (*HelmCmd) UpdateAllReposIndex added in v0.0.137

func (h *HelmCmd) UpdateAllReposIndex()

func (*HelmCmd) UpdateReposIndex added in v0.0.137

func (h *HelmCmd) UpdateReposIndex(ids string)

func (*HelmCmd) UpgradeRelease added in v0.0.137

func (h *HelmCmd) UpgradeRelease(ns, name string, values ...string) error

type IndexFile added in v0.0.137

type IndexFile struct {
	// This is used ONLY for validation against chartmuseum's index files and is discarded after validation.
	ServerInfo map[string]interface{}   `json:"serverInfo,omitempty"`
	APIVersion string                   `json:"apiVersion"`
	Generated  time.Time                `json:"generated"`
	Entries    map[string]ChartVersions `json:"entries"`
	PublicKeys []string                 `json:"publicKeys,omitempty"`

	// Annotations are additional mappings uninterpreted by Helm. They are made available for
	// other applications to add information to the index file.
	Annotations map[string]string `json:"annotations,omitempty"`
}

type Maintainer added in v0.0.137

type Maintainer struct {
	// Name is a user name or organization name
	Name string `json:"name,omitempty"`
	// Email is an optional email address to contact the named maintainer
	Email string `json:"email,omitempty"`
	// URL is an optional URL to an address for the named maintainer
	URL string `json:"url,omitempty"`
}

type Metadata added in v0.0.137

type Metadata struct {
	// The name of the chart. Required.
	Name string `json:"name,omitempty"`
	// The URL to a relevant project page, git repo, or contact person
	Home string `json:"home,omitempty"`
	// Source is the URL to the source code of this chart
	Sources []string `json:"sources,omitempty"`
	// A SemVer 2 conformant version string of the chart. Required.
	Version string `json:"version,omitempty"`
	// A one-sentence description of the chart
	Description string `json:"description,omitempty"`
	// A list of string keywords
	Keywords []string `json:"keywords,omitempty"`
	// A list of name and URL/email address combinations for the maintainer(s)
	Maintainers []*Maintainer `json:"maintainers,omitempty"`
	// The URL to an icon file.
	Icon string `json:"icon,omitempty"`
	// The API Version of this chart. Required.
	APIVersion string `json:"apiVersion,omitempty"`
	// The condition to check to enable chart
	Condition string `json:"condition,omitempty"`
	// The tags to check to enable chart
	Tags string `json:"tags,omitempty"`
	// The version of the application enclosed inside of this chart.
	AppVersion string `json:"appVersion,omitempty"`
	// Whether or not this chart is deprecated
	Deprecated bool `json:"deprecated,omitempty"`
	// Annotations are additional mappings uninterpreted by Helm,
	// made available for inspection by other applications.
	Annotations map[string]string `json:"annotations,omitempty"`
	// KubeVersion is a SemVer constraint specifying the version of Kubernetes required.
	KubeVersion string `json:"kubeVersion,omitempty"`
	// Dependencies are a list of dependencies for a chart.
	Dependencies []*Dependency `json:"dependencies,omitempty"`
	// Specifies the chart type: application or library
	Type string `json:"type,omitempty"`
}

Metadata for a Chart file. This models the structure of a Chart.yaml file.

type RepoVO added in v0.0.137

type RepoVO struct {
	Name string `json:"name"`
	URL  string `json:"url"`
}

Jump to

Keyboard shortcuts

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