release

package
v0.1.16 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package release includes a client for fetching Helm releases from Kubernetes secrets.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chart

type Chart struct {
	// Metadata is the contents of the Chart.yaml file.
	Metadata *Metadata `json:"metadata,omitempty"`
}

Chart holds the chart metadata.

type Client

type Client interface {
	List(context.Context, klabels.Selector, string) ([]*Release, error)
	Get(context.Context, string, string) (*Release, error)
}

Client is a subset of the kubernetes SecretsInterface, geared towards handling Helm secrets.

type HelmReleaseClient

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

HelmReleaseClient implements the Client interface.

func NewHelmReleaseClient

func NewHelmReleaseClient(client client.Client) *HelmReleaseClient

NewHelmReleaseClient initializes a new HelmReleaseClient.

func (*HelmReleaseClient) Get

func (s *HelmReleaseClient) Get(ctx context.Context, name string, namespace string) (*Release, error)

Get fetches the latest Helm release by name and namespace.

func (*HelmReleaseClient) List

func (s *HelmReleaseClient) List(ctx context.Context, labels klabels.Selector, namespace string) ([]*Release, error)

List fetches all Helm releases in a namespace, filtered by a label selector.

type Info

type Info struct {
	// FirstDeployed is when the release was first deployed.
	// +optional
	FirstDeployed Time `json:"first_deployed,omitempty"`

	// LastDeployed is when the release was last deployed.
	// +optional
	LastDeployed Time `json:"last_deployed,omitempty"`

	// Deleted tracks when this object was deleted.
	// +optional
	Deleted Time `json:"deleted,omitempty"`

	// Description is human-friendly "log entry" about this release.
	// +optional
	Description string `json:"description,omitempty"`

	// Status is the current state of the release.
	// +optional
	Status string `json:"status,omitempty"`

	// Contains the rendered templates/NOTES.txt if available.
	// +optional
	Notes string `json:"notes,omitempty"`
}

Info describes release information.

type Maintainer

type Maintainer struct {
	// Name is a user name or organization name.
	// +optional
	Name string `json:"name,omitempty"`

	// Email is an optional email address to contact the named maintainer.
	// +optional
	Email string `json:"email,omitempty"`

	// URL is an optional URL to an address for the named maintainer.
	// +optional
	URL string `json:"url,omitempty"`
}

Maintainer describes a chart maintainer.

type Metadata

type Metadata struct {
	// The name of the chart.
	// +optional
	Name string `json:"name,omitempty"`

	// The URL to a relevant project page, git repo, or contact person.
	// +optional
	Home string `json:"home,omitempty"`

	// Source is the URL to the source code of this chart.
	// +optional
	Sources []string `json:"sources,omitempty"`

	// A SemVer 2 conformant version string of the chart.
	// +optional
	Version string `json:"version,omitempty"`

	// A one-sentence description of the chart.
	// +optional
	Description string `json:"description,omitempty"`

	// A list of string keywords.
	// +optional
	Keywords []string `json:"keywords,omitempty"`

	// A list of name and URL/email address combinations for the maintainer(s).
	// +optional
	Maintainers []*Maintainer `json:"maintainers,omitempty"`

	// The URL to an icon file.
	// +optional
	Icon string `json:"icon,omitempty"`

	// The API Version of this chart.
	// +optional
	APIVersion string `json:"apiVersion,omitempty"`

	// The condition to check to enable chart.
	// +optional
	Condition string `json:"condition,omitempty"`

	// The tags to check to enable chart.
	// +optional
	Tags string `json:"tags,omitempty"`

	// The version of the application enclosed inside of this chart.
	// +optional
	AppVersion string `json:"appVersion,omitempty"`

	// Whether or not this chart is deprecated.
	// +optional
	Deprecated bool `json:"deprecated,omitempty"`

	// Annotations are additional mappings uninterpreted by Helm,
	// made available for inspection by other applications.
	// +optional
	Annotations map[string]string `json:"annotations,omitempty"`

	// KubeVersion is a SemVer constraint specifying the version of Kubernetes required.
	// +optional
	KubeVersion string `json:"kubeVersion,omitempty"`

	// Specifies the chart type: application or library.
	// +optional
	Type string `json:"type,omitempty"`

	// Urls where to find the chart contents.
	// +optional
	Urls []string `json:"urls,omitempty"`
}

Metadata describes a chart's metadata.

type Release

type Release struct {
	// Name is the name of the release.
	Name string `json:"name,omitempty"`

	// Info provides information about a release.
	Info *Info `json:"info,omitempty"`

	// Chart is the chart that was released.
	Chart *Chart `json:"chart,omitempty"`

	// Config is the set of extra Values added to the chart.
	// These values override the default values inside of the chart.
	Config map[string]interface{} `json:"config,omitempty"`

	// Version is an int which represents the version of the release.
	Version int `json:"version,omitempty"`

	// Namespace is the kubernetes namespace of the release.
	Namespace string `json:"namespace,omitempty"`

	// Secret is the secret containing the release's secret values.
	Secret *corev1.Secret `json:"-"`
}

Release describes a deployment of a chart, together with the chart and the variables used to deploy that chart.

type Time

type Time struct {
	time.Time
}

Time is a convenience wrapper around stdlib time, but with different marshalling and unmarshaling for zero values.

func Date

func Date(year int, month time.Month, day, hour, min, sec, nsec int, loc *time.Location) Time

Date returns the Time corresponding to the given year, month, day, hour, min, sec, and nsec. nolint:revive

func Now

func Now() Time

Now returns the current time. It is a convenience wrapper around time.Now().

func Parse

func Parse(layout, value string) (Time, error)

Parse parses a formatted string and returns the time value it represents.

func ParseInLocation

func ParseInLocation(layout, value string, loc *time.Location) (Time, error)

ParseInLocation is like Parse but with a location.

func Unix

func Unix(sec int64, nsec int64) Time

Unix generates a Time from sec and nsec.

func (Time) Add

func (t Time) Add(d time.Duration) Time

Add returns the Time t+d.

func (Time) AddDate

func (t Time) AddDate(years int, months int, days int) Time

AddDate returns the Time corresponding to adding the given number of years, months, and days to t.

func (Time) After

func (t Time) After(u Time) bool

After reports whether the time instant t is after u.

func (Time) Before

func (t Time) Before(u Time) bool

Before reports whether the time instant t is before u.

func (Time) Equal

func (t Time) Equal(u Time) bool

Equal reports whether Time t equals u.

func (Time) In

func (t Time) In(loc *time.Location) Time

In returns a copy of t representing the same time instant, but with a new location.

func (Time) Local

func (t Time) Local() Time

Local returns t with the location set to local time.

func (Time) MarshalJSON

func (t Time) MarshalJSON() ([]byte, error)

MarshalJSON marshals a Time to JSON.

func (Time) Round

func (t Time) Round(d time.Duration) Time

Round returns the result of rounding t to the nearest multiple of d (since the zero time).

func (Time) Sub

func (t Time) Sub(u Time) time.Duration

Sub returns the duration t-u.

func (Time) Truncate

func (t Time) Truncate(d time.Duration) Time

Truncate returns t truncated to a multiple of d (since the zero time).

func (Time) UTC

func (t Time) UTC() Time

UTC returns t with the location set to UTC.

func (*Time) UnmarshalJSON

func (t *Time) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals a Time from JSON.

Jump to

Keyboard shortcuts

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