storage

package
v2.0.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2026 License: Apache-2.0, Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const HelmStorageType = "sh.helm.release.v1"

HelmStorageType is the type field of the Kubernetes storage object which stores the Helm release version. It is modified slightly replacing the '/': sh.helm/release.v1 Note: The version 'v1' is incremented if the release object metadata is modified between major releases. This constant is used as a prefix for the Kubernetes storage object name.

Variables

This section is empty.

Functions

This section is empty.

Types

type Storage

type Storage struct {
	driver.Driver

	// MaxHistory specifies the maximum number of historical releases that will
	// be retained, including the most recent release. Values of 0 or less are
	// ignored (meaning no limits are imposed).
	MaxHistory int

	// Embed a LogHolder to provide logger functionality
	logging.LogHolder
}

Storage represents a storage engine for a Release.

func Init

func Init(d driver.Driver) *Storage

Init initializes a new storage backend with the driver d. If d is nil, the default in-memory driver is used.

func (*Storage) Create

func (s *Storage) Create(rls release.Releaser) error

Create creates a new storage entry holding the release. An error is returned if the storage driver fails to store the release, or a release with an identical key already exists.

func (*Storage) Delete

func (s *Storage) Delete(name string, version int) (release.Releaser, error)

Delete deletes the release from storage. An error is returned if the storage backend fails to delete the release or if the release does not exist.

func (*Storage) DeleteRevision

func (s *Storage) DeleteRevision(ctx context.Context, name string, version int) error

DeleteRevision removes one revision of a release. Drivers implementing the capability delete without transferring the body and honour ctx; the fallback goes through Delete, which fetches and decodes the body first and ignores ctx.

func (*Storage) Deployed

func (s *Storage) Deployed(name string) (release.Releaser, error)

Deployed returns the last deployed release with the provided release name, or returns driver.NewErrNoDeployedReleases if not found.

func (*Storage) DeployedAll

func (s *Storage) DeployedAll(name string) ([]release.Releaser, error)

DeployedAll returns all deployed releases with the provided name, or returns driver.NewErrNoDeployedReleases if not found.

func (*Storage) Get

func (s *Storage) Get(name string, version int) (release.Releaser, error)

Get retrieves the release from storage. An error is returned if the storage driver failed to fetch the release, or the release identified by the key, version pair does not exist.

func (*Storage) GetRelease

func (s *Storage) GetRelease(name string, version int) (*rspb.Release, error)

GetRelease returns a single release revision without decoding the whole history. version == 0 resolves the latest revision (via the driver's LastVersion capability, falling back to decoding the history). The revision is fetched through the driver's GetRevision capability, which keeps the unfiltered storage labels; Get is deliberately not used because it strips system labels through filterSystemLabels.

func (*Storage) History

func (s *Storage) History(name string) ([]release.Releaser, error)

History returns the revision history for the release with the provided name, or returns driver.ErrReleaseNotFound if no such release name exists.

func (*Storage) Last

func (s *Storage) Last(name string) (release.Releaser, error)

Last fetches the last revision of the named release.

func (*Storage) ListDeployed

func (s *Storage) ListDeployed() ([]release.Releaser, error)

ListDeployed returns all releases with Status == DEPLOYED. An error is returned if the storage backend fails to retrieve the releases.

func (*Storage) ListLatestReleases

func (s *Storage) ListLatestReleases(ctx context.Context) ([]*rspb.Release, error)

ListLatestReleases returns the highest revision of every release owned by Helm. Drivers implementing the capability answer without decoding superseded revisions; the fallback decodes the whole history of every release.

func (*Storage) ListReleases

func (s *Storage) ListReleases() ([]release.Releaser, error)

ListReleases returns all releases from storage. An error is returned if the storage backend fails to retrieve the releases.

func (*Storage) ListUninstalled

func (s *Storage) ListUninstalled() ([]release.Releaser, error)

ListUninstalled returns all releases with Status == UNINSTALLED. An error is returned if the storage backend fails to retrieve the releases.

func (*Storage) Revisions

func (s *Storage) Revisions(ctx context.Context, name string) ([]driver.RevisionRecord, error)

Revisions returns version and status of every revision of the named release, sorted by ascending version. Drivers implementing the capability answer without decoding release bodies; the fallback decodes the whole history. An unknown release yields an empty result, not an error.

func (*Storage) Update

func (s *Storage) Update(rls release.Releaser) error

Update updates the release in storage. An error is returned if the storage backend fails to update the release or if the release does not exist.

func (*Storage) UpdateLabels

func (s *Storage) UpdateLabels(name string, version int, labels map[string]string) error

UpdateLabels merges the given custom labels into the stored release identified by name and version without creating a new revision. An error is returned if the storage backend fails or the release does not exist.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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