release

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 Imports: 35 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ReleaseVersionV1 = "v1"
	ReleaseVersionV2 = "v2"
)

Variables

This section is empty.

Functions

func NewRelease

func NewRelease(name, namespace string, revision int, deployType common.DeployType, resources []*spec.ResourceSpec, chrt chart.Accessor, releaseConfig map[string]interface{}, opts ReleaseOptions) (helmrel.Accessor, error)

Construct Helm release.

func ReleaseToResourceSpecs

func ReleaseToResourceSpecs(ctx context.Context, rel helmrel.Accessor, releaseNamespace string) ([]*spec.ResourceSpec, error)

Constructs ResourceSpecs from a Release object.

func ReleaserToV1Release

func ReleaserToV1Release(releaser helmrel.Releaser) (*helmrelease.Release, error)

func ReleaserVersion

func ReleaserVersion(releaser helmrel.Releaser) string

Types

type Historier

type Historier interface {
	CreateRelease(ctx context.Context, rel helmrel.Accessor) error
	UpdateRelease(ctx context.Context, rel helmrel.Accessor) error
	DeleteRelease(ctx context.Context, name string, revision int) error
}

type History

type History struct {
	// contains filtered or unexported fields
}

func BuildHistory

func BuildHistory(ctx context.Context, releaseName string, historyStorage ReleaseStorager) (*History, error)

func (*History) CreateRelease

func (h *History) CreateRelease(ctx context.Context, rel helmrel.Accessor) error

func (*History) DeleteRelease

func (h *History) DeleteRelease(ctx context.Context, name string, revision int) error

func (*History) Release

func (h *History) Release(ctx context.Context, version int) (helmrel.Accessor, error)

func (*History) Revisions

func (h *History) Revisions() []Revision

func (*History) UpdateRelease

func (h *History) UpdateRelease(ctx context.Context, rel helmrel.Accessor) error

type IsReleaseUpToDateResult

type IsReleaseUpToDateResult struct {
	Reason   ReleaseOutdatedReason
	UpToDate bool
}

func IsReleaseUpToDate

func IsReleaseUpToDate(oldRel, newRel helmrel.Accessor) (IsReleaseUpToDateResult, error)

Check if the new Release is up-to-date compared to the old Release. It doesn't check any resources of the release in the cluster, just compares Release objects.

type ReleaseOptions

type ReleaseOptions struct {
	InfoAnnotations map[string]string
	Labels          map[string]string
	Notes           string
}

type ReleaseOutdatedReason

type ReleaseOutdatedReason string
const (
	ReleaseOutdatedReasonNone                     ReleaseOutdatedReason = ""
	ReleaseOutdatedReasonNoPreviousRelease        ReleaseOutdatedReason = "there is no previously deployed release"
	ReleaseOutdatedReasonReleaseStatusNotDeployed ReleaseOutdatedReason = "the previously deployed release was not successful"
	ReleaseOutdatedReasonNotesChanged             ReleaseOutdatedReason = "the release notes changed"
	ReleaseOutdatedReasonValuesChanged            ReleaseOutdatedReason = "the release values changed"
	ReleaseOutdatedReasonHooksChanged             ReleaseOutdatedReason = "the release hooks changed"
	ReleaseOutdatedReasonManifestsChanged         ReleaseOutdatedReason = "the release manifests changed"
)

type ReleaseStorageOptions

type ReleaseStorageOptions struct {
	HistoryLimit  int
	SQLConnection string
}

type ReleaseStorager

type ReleaseStorager interface {
	Create(rls helmrel.Accessor) error
	Update(rls helmrel.Accessor) error
	UpdateLabels(name string, version int, labels map[string]string) error
	Delete(ctx context.Context, name string, version int) error
	Query(labels map[string]string) ([]helmrel.Accessor, error)
	// GetRelease returns a single release revision. version == 0 means the latest revision.
	GetRelease(name string, version int) (helmrel.Accessor, error)
	// ListLatestReleases returns the highest revision of every stored release.
	ListLatestReleases(ctx context.Context) ([]helmrel.Accessor, error)
	// Revisions returns version and status of every revision of the named release.
	Revisions(ctx context.Context, name string) ([]Revision, error)
}

func NewReleaseStorage

func NewReleaseStorage(ctx context.Context, namespace, storageDriver string, clientFactory kube.ClientFactorier, opts ReleaseStorageOptions) (ReleaseStorager, error)

type Revision

type Revision struct {
	Name      string `json:"name"`
	Namespace string `json:"namespace"`
	Status    string `json:"status"`
	Version   int    `json:"version"`
}

func DeployedRevisions

func DeployedRevisions(revisions []Revision) []Revision

DeployedRevisions expects revisions sorted by ascending Version.

func NewRevisionFromAccessor

func NewRevisionFromAccessor(rel helmrel.Accessor) Revision

type VersionedRelease

type VersionedRelease struct {
	Accessor helmrel.Accessor
}

func (*VersionedRelease) MarshalJSON

func (r *VersionedRelease) MarshalJSON() ([]byte, error)

func (*VersionedRelease) UnmarshalJSON

func (r *VersionedRelease) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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