Documentation
¶
Overview ¶
helm/history.go
Index ¶
- Constants
- func CreateChart(chartName, saveDir string) error
- func DebugHelmPaths()
- func HelmHistory(releaseName, namespace string, max int, format string, useAI bool) error
- func HelmInstall(releaseName, chartRef, namespace string, valuesFiles []string, ...) error
- func HelmLint(chartPath string, fileValues []string, useAI bool) error
- func HelmPluginInstall(plugins string) error
- func HelmProvision(releaseName, chartPath, namespace string, useAI bool) error
- func HelmReleaseExists(releaseName, namespace string, debug, useAI bool) (bool, error)
- func HelmRollback(releaseName string, revision int, opts RollbackOptions, historyMax int, ...) error
- func HelmStatus(releaseName, namespace, format string, useAI bool) error
- func HelmTemplate(releaseName, chartPath, namespace, repoURL string, valuesFiles []string, ...) error
- func HelmUninstall(opts UninstallOptions, useAI bool) error
- func HelmUpgrade(releaseName, chartRef, namespace string, setValues []string, ...) error
- func ListNamespaces(ctx context.Context) ([]string, error)
- func ListReleaseNames(namespace string, timeout time.Duration) ([]string, error)
- func ListReleases(namespace, format string, useAI bool) ([]*release.Release, error)
- func LoadChart(chartRef, repoURL, version string, settings *cli.EnvSettings) (*chart.Chart, error)
- func LoadFromLocalRepo(chartRef, version string, settings *cli.EnvSettings) (*chart.Chart, error)
- func LoadOCIChart(chartRef, version string, settings *cli.EnvSettings, debug bool) (*chart.Chart, error)
- func LoadRemoteChart(chartName, repoURL string, version string, settings *cli.EnvSettings) (*chart.Chart, error)
- func Pull(chartRef, version, destination string, untar bool, untarDir string, ...) error
- func Repo_Add(args []string, ...) error
- func Repo_Update(args []string, helmConfigDir string, useAI bool) error
- type ConfigMapInfo
- type DeploymentInfo
- type IngressInfo
- type PodInfo
- type ReleaseInfo
- type ReplicaSetInfo
- type Resource
- type ResourceChecker
- type ResourceDetails
- type RollbackOptions
- type SecretInfo
- type ServiceInfo
- type UninstallOptions
Constants ¶
const ( ColorReset = "\033[0m" ColorRed = "\033[31m" ColorGreen = "\033[32m" ColorYellow = "\033[33m" ColorBlue = "\033[34m" ColorMagenta = "\033[35m" ColorCyan = "\033[36m" ColorWhite = "\033[37m" ColorGray = "\033[90m" ColorBold = "\033[1m" ColorItalic = "\033[3m" )
ANSI color codes
Variables ¶
This section is empty.
Functions ¶
func CreateChart ¶
CreateChart generates a new Helm chart in the specified directory using Helm's chartutil package. It ensures that the target directory exists before creating the chart scaffolding. If successful, a success message is logged with the chart's location.
func HelmHistory ¶ added in v0.0.6
HelmHistory shows the revision history of a Helm release using pterm.Table.
format selects the output shape: "table" (default) renders the existing human-facing table; "json"/"yaml" print the revision list as a single machine-readable document to stdout and suppress every other stdout write, so pipelines consuming stdout only ever see that document.
func HelmInstall ¶
func HelmInstall( releaseName, chartRef, namespace string, valuesFiles []string, duration time.Duration, atomic, debug bool, setValues, setLiteralValues []string, repoURL, version string, wait bool, useAI bool, ) error
HelmInstall handles chart installation with three possible sources: 1. Remote repository URL (e.g., "https://prometheus-community.github.io/helm-charts") 2. Local repository reference (e.g., "prometheus-community/prometheus") 3. Local chart path (e.g., "./mychart")
func HelmLint ¶
HelmLint runs Helm's built-in linting on a specified chart directory or tarball, optionally merging values from given YAML files and parsing additional values, passed through the --set mechanism. Upon completion, it displays any detected linting messages, listing severity and location, or indicates if no issues were found
func HelmPluginInstall ¶ added in v0.0.6
HelmPluginInstall installs one or more Helm plugins
func HelmProvision ¶
HelmProvision orchestrates a "provisioning" workflow that checks whether a specified Helm release already exists in the cluster and chooses either to install or upgrade. In parallel, it also runs linting and template rendering for the chart. If any step fails, a consolidated error is returned. Otherwise, a success message is printed.
func HelmReleaseExists ¶
HelmReleaseExists checks if a Helm release with the given name exists in the specified namespace. It initializes Helm's action configuration, runs the Helm list command, and returns true if a release with the given name is found in the specified namespace. Helper function to check if release exists
func HelmRollback ¶ added in v0.0.2
func HelmRollback(releaseName string, revision int, opts RollbackOptions, historyMax int, useAI bool) error
HelmRollback performs a rollback of a specified Helm release to a given revision. It initializes the Helm action configuration, sets up the rollback parameters, executes the rollback, and then retrieves the status of the release post-rollback. Detailed error logging is performed if any step fails.
func HelmStatus ¶
HelmStatus retrieves and displays the status of a specified Helm release within a given namespace. It initializes the Helm action configuration, fetches the release status, and presents it in a formatted table. Additionally, it checks the readiness of the associated Kubernetes resources and provides detailed feedback.
format selects the output shape: "table" (default) renders the existing human-facing table, spinner, notes and readiness report; "json"/"yaml" print a single machine-readable document to stdout and suppress every other stdout write (spinner, tables, notes, AI explanations) so pipelines consuming stdout only ever see that document. Errors are still returned normally and land on stderr via the caller.
func HelmTemplate ¶
func HelmTemplate(releaseName, chartPath, namespace, repoURL string, valuesFiles []string, useAI bool) error
HelmTemplate renders the Helm templates for a given chart, values files, and optionally a remote repo. HelmTemplate renders the Helm templates for a given chart, values files, and optionally a remote repo.
func HelmUninstall ¶
func HelmUninstall(opts UninstallOptions, useAI bool) error
HelmUninstall performs a complete uninstallation of a Helm release
func HelmUpgrade ¶
func HelmUpgrade( releaseName, chartRef, namespace string, setValues []string, valuesFiles []string, setLiteral []string, createNamespace, atomic bool, timeout time.Duration, debug bool, repoURL string, version string, wait bool, historyMax int, useAI bool, force bool, ) error
HelmUpgrade performs a Helm upgrade operation with repo + local support
func ListNamespaces ¶ added in v1.1.6
ListNamespaces returns the names of all namespaces visible to the configured Kubernetes client, for use in shell completion. It never prints and honors ctx's deadline, so a slow or unreachable cluster can't hang shell completion; callers should pass a context with a short (2-3s) timeout.
It intentionally builds its own client instead of reusing getKubeClient: that helper prints an error message as a side effect of the first failed call (cached for the process via kubeClientOnce), which is fine for regular command output but would violate the "completion functions never print" rule.
func ListReleaseNames ¶ added in v1.1.6
ListReleaseNames returns just the names of Helm releases in the given namespace (all namespaces if empty), for use in shell completion. Unlike ListReleases it never prints anything and never blocks longer than timeout: the Helm/Kubernetes call runs in the background and, if it has not finished by the deadline, a timeout error is returned immediately so a slow or unreachable cluster can't hang shell completion.
func ListReleases ¶ added in v0.0.6
ListReleases returns and displays Helm releases with flexible output formats
func LoadFromLocalRepo ¶ added in v0.0.5
loadFromLocalRepo loads a chart from a local repository
func LoadOCIChart ¶ added in v0.1.2
func LoadOCIChart(chartRef, version string, settings *cli.EnvSettings, debug bool) (*chart.Chart, error)
LoadOCIChart loads a chart from an OCI registry
func LoadRemoteChart ¶ added in v0.0.5
func LoadRemoteChart(chartName, repoURL string, version string, settings *cli.EnvSettings) (*chart.Chart, error)
loadRemoteChart downloads and loads a chart from a remote repository
func Pull ¶ added in v0.0.6
func Pull(chartRef, version, destination string, untar bool, untarDir string, verify bool, keyring string, repoURL string, username string, password string, certFile string, keyFile string, caFile string, insecure bool, plainHttp bool, passCredentials bool, devel bool, prov bool, helmConfigDir string, useAI bool) error
Types ¶
type ConfigMapInfo ¶ added in v0.0.6
type ConfigMapInfo struct {
Name string
}
type DeploymentInfo ¶ added in v0.0.6
type IngressInfo ¶ added in v0.0.6
type ReleaseInfo ¶ added in v0.0.6
type ReplicaSetInfo ¶ added in v0.0.6
type ResourceChecker ¶ added in v0.0.6
type ResourceChecker struct {
// contains filtered or unexported fields
}
ResourceChecker provides generic resource checking functionality
func NewResourceChecker ¶ added in v0.0.6
func NewResourceChecker(clientset *kubernetes.Clientset, namespace, releaseName string, debug bool) *ResourceChecker
type ResourceDetails ¶ added in v0.0.6
type ResourceDetails struct {
ReleaseInfo *ReleaseInfo
Deployments []DeploymentInfo
ReplicaSets []ReplicaSetInfo
Pods []PodInfo
Services []ServiceInfo
Ingresses []IngressInfo
Secrets []SecretInfo
ConfigMaps []ConfigMapInfo
}
ResourceDetails stores detailed information about resources
type RollbackOptions ¶ added in v0.0.2
RollbackOptions holds the options for rolling back a Helm release.