loader

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2026 License: MIT, Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package loader provides functionality for loading Helm charts from URLs. This code is copied from github.com/fluxcd/helm-controller/internal/loader with modifications for use outside the controller context.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrFileNotFound is an error type used to signal 404 HTTP status code responses.
	ErrFileNotFound = errors.New("file not found")
	// ErrIntegrity signals a chart loader failed to verify the integrity of
	// a chart, for example due to a digest mismatch.
	ErrIntegrity = errors.New("integrity failure")
)

Functions

func NewRetryableHTTPClient

func NewRetryableHTTPClient(ctx context.Context, retries int) *retryablehttp.Client

NewRetryableHTTPClient returns a new retrying HTTP client for loading artifacts. The client will retry up to the given number of times before giving up.

func SecureLoadChartFromURL

func SecureLoadChartFromURL(client *retryablehttp.Client, URL, digest string) (*chart.Chart, error)

SecureLoadChartFromURL attempts to download a Helm chart from the given URL using the provided client. The retrieved data is verified against the given digest before loading the chart. It returns the loaded chart.Chart, or an error. The error may be of type ErrIntegrity if the integrity check fails.

Types

This section is empty.

Jump to

Keyboard shortcuts

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