helmchart

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2026 License: MIT Imports: 21 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package helmchart moves chart archives between upstreams, the vendored tree and the mirror registry. Pull fetches the pinned tgz from an oci:// repository (the chart content layer, byte-identical to what helm pull writes) or an https:// helm repository (index.yaml, then the release asset); Extract unpacks it deterministically and traversal-safely into the vendor tree; TreeDiff compares an extraction against the committed tree, the publish-time tripwire that catches upstream mutating a released version in place.

The tgz itself is never committed: the vendored tree is what reviews see, and the lock's upstreamTgzSha256 proves the published artifact is the reviewed one.

Index

Constants

View Source
const ChartConfigMediaType = "application/vnd.cncf.helm.config.v1+json"

ChartConfigMediaType marks an OCI artifact as a helm chart.

View Source
const ChartContentLayerMediaType = "application/vnd.cncf.helm.chart.content.v1.tar+gzip"

ChartContentLayerMediaType is the OCI layer holding a chart's tgz.

Variables

This section is empty.

Functions

func AppVersion

func AppVersion(vendorDir, chartName string) (string, error)

AppVersion reads the extracted chart's appVersion ("" when absent).

func ChartYAML

func ChartYAML(vendorDir, chartName string) (map[string]any, error)

ChartYAML reads a field map from the extracted chart's Chart.yaml.

func Extract

func Extract(tgz []byte, destDir string) error

Extract unpacks a chart tgz into destDir the way tar -xzf does, minus the hazards: entry paths must stay inside destDir (no absolute paths, no .. traversal), and only regular files and directories are materialized — a chart archive has no business carrying symlinks or devices.

func Push

func Push(tgz []byte, ref string) (string, error)

Push publishes a chart tgz to ref (repo:version) the way helm push does: the byte-identical archive as the content layer, the chart metadata as the config blob. Returns the pushed manifest digest.

Push never checks for an existing tag — the caller owns the never-replace rule (an existing tag must be skipped, not overwritten).

func TreeDiff

func TreeDiff(aDir, bDir string) ([]string, error)

TreeDiff compares two directory trees by relative path and content, returning the differing paths ("only in a", "only in b", "differs"). Empty result means identical trees.

Types

type Puller

type Puller struct {
	// Registry performs OCI pulls.
	Registry *ocireg.Client
	// HTTP performs helm-repository pulls (nil: http.DefaultClient).
	HTTP *http.Client
	// Rewrites reroutes OCI pulls per registry host.
	Rewrites map[string]string
}

Puller fetches chart archives from upstream repositories.

func (*Puller) Pull

func (p *Puller) Pull(ctx context.Context, repo, name, version string) ([]byte, string, error)

Pull fetches the pinned chart tgz and returns its bytes and sha256. repo is the manifest's chart.repo: oci://<registry path> or an https:// helm repository URL.

func (*Puller) Versions

func (p *Puller) Versions(ctx context.Context, repo, name string) ([]string, error)

Versions lists a helm repository's versions of one chart, via index.yaml.

Jump to

Keyboard shortcuts

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