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
- func AppVersion(vendorDir, chartName string) (string, error)
- func ChartYAML(vendorDir, chartName string) (map[string]any, error)
- func Extract(tgz []byte, destDir string) error
- func Push(tgz []byte, ref string) (string, error)
- func TreeDiff(aDir, bDir string) ([]string, error)
- func Version(vendorDir, chartName string) (string, error)
- type Puller
Constants ¶
const ChartConfigMediaType = "application/vnd.cncf.helm.config.v1+json"
ChartConfigMediaType marks an OCI artifact as a helm chart.
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 ¶
AppVersion reads the extracted chart's appVersion ("" when absent).
func Extract ¶
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 ¶
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).
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.