Documentation
¶
Index ¶
- Constants
- Variables
- func NewRelease(name, namespace string, revision int, deployType common.DeployType, ...) (helmrel.Accessor, error)
- func ReleaseToResourceSpecs(ctx context.Context, rel helmrel.Accessor, releaseNamespace string) ([]*spec.ResourceSpec, error)
- func ReleaserToV1Release(releaser helmrel.Releaser) (*helmrelease.Release, error)
- func ReleaserVersion(releaser helmrel.Releaser) string
- type Historier
- type History
- func (h *History) CreateRelease(ctx context.Context, rel helmrel.Accessor) error
- func (h *History) DeleteRelease(ctx context.Context, name string, revision int) error
- func (h *History) Release(ctx context.Context, version int) (helmrel.Accessor, error)
- func (h *History) Revisions() []Revision
- func (h *History) UpdateRelease(ctx context.Context, rel helmrel.Accessor) error
- type IsReleaseUpToDateResult
- type LatestRevisionsOptions
- type ListLatestSummariesOptions
- type ListRevisionSummariesOptions
- type ReleaseOptions
- type ReleaseOutdatedReason
- type ReleaseStorageOptions
- type ReleaseStorager
- type ReleaseSummary
- type ReleaseSummaryChart
- type Revision
- type RevisionSummary
- type VersionedRelease
Constants ¶
View Source
const ( ReleaseVersionV1 = "v1" ReleaseVersionV2 = "v2" )
Variables ¶
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 ¶
Types ¶
type History ¶
type History struct {
// contains filtered or unexported fields
}
func BuildHistory ¶
func (*History) CreateRelease ¶
func (*History) DeleteRelease ¶
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 LatestRevisionsOptions ¶
type ListLatestSummariesOptions ¶
type ListLatestSummariesOptions struct {
// LabelSelector is applied before choosing the latest revision.
LabelSelector string
}
type ListRevisionSummariesOptions ¶
type ListRevisionSummariesOptions struct {
// Limit reads only the newest revisions; 0 means all.
Limit int
}
type ReleaseOptions ¶
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 ReleaseStorager ¶
type ReleaseStorager interface {
Create(ctx context.Context, rel helmrel.Accessor) error
Update(ctx context.Context, rel helmrel.Accessor) error
UpdateLabels(ctx context.Context, name string, version int, labels map[string]string) error
Delete(ctx context.Context, name string, version int) error
// GetRelease returns the decoded revision; version 0 means the latest one.
GetRelease(ctx context.Context, name string, version int) (helmrel.Accessor, error)
LoadRevision(ctx context.Context, revision Revision) (helmrel.Accessor, error)
// LoadRevisionSummary fails with ErrReleaseUndecodable on an undecodable body.
LoadRevisionSummary(ctx context.Context, revision Revision) (*ReleaseSummary, error)
// Revisions reads no bodies; sorted by version.
Revisions(ctx context.Context, name string) ([]Revision, error)
// LatestRevisions reads no bodies; sorted by namespace and name.
LatestRevisions(ctx context.Context, opts LatestRevisionsOptions) ([]Revision, error)
// ListLatestSummaries streams bodies and keeps only summaries; sorted by namespace and name.
ListLatestSummaries(ctx context.Context, opts ListLatestSummariesOptions) ([]RevisionSummary, error)
// ListRevisionSummaries streams bodies and keeps only summaries; sorted by version.
ListRevisionSummaries(ctx context.Context, name string, opts ListRevisionSummariesOptions) ([]RevisionSummary, error)
}
ReleaseStorager stores releases in the Helm format. Methods taking a release name require a namespace. Objects with an unparseable version label are skipped on reads but fail Revisions.
func NewReleaseStorage ¶
func NewReleaseStorage(ctx context.Context, namespace, storageDriver string, clientFactory kube.ClientFactorier, opts ReleaseStorageOptions) (ReleaseStorager, error)
type ReleaseSummary ¶
type ReleaseSummary struct {
Annotations map[string]string
// Chart is nil without chart metadata.
Chart *ReleaseSummaryChart
DeployedAt time.Time
}
ReleaseSummary is the part of a release body that listings show.
type ReleaseSummaryChart ¶
type Revision ¶
type Revision struct {
// Annotations is nil when they must be read from the body.
Annotations map[string]string `json:"annotations,omitempty"`
Name string `json:"name"`
Namespace string `json:"namespace"`
Status string `json:"status"`
Version int `json:"version"`
}
func DeployedRevisions ¶
DeployedRevisions expects revisions sorted by ascending Version.
func NewRevisionFromAccessor ¶
type RevisionSummary ¶
type RevisionSummary struct {
DecodeErr error
Revision Revision
Summary *ReleaseSummary
}
RevisionSummary has either Summary or DecodeErr wrapping ErrReleaseUndecodable.
type VersionedRelease ¶
func (*VersionedRelease) MarshalJSON ¶
func (r *VersionedRelease) MarshalJSON() ([]byte, error)
func (*VersionedRelease) UnmarshalJSON ¶
func (r *VersionedRelease) UnmarshalJSON(data []byte) error
Click to show internal directories.
Click to hide internal directories.