helm

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: May 9, 2022 License: Apache-2.0 Imports: 55 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ChartsDir = "/tmp/helm-charts"
)

Functions

func AddBasicAuthRepository added in v0.9.0

func AddBasicAuthRepository(name, url, username, password string) error

AddBasicAuthRepository add a repo with basic auth

func AddConditionForHelmRequest added in v1.4.0

func AddConditionForHelmRequest(condition *appv1.HelmRequestCondition, hr *appv1.HelmRequest, client clientset.Interface) error

AddConditionForHelmRequest ... Note: this function will modify the hr object, this is not a good solution

func DeepHashObject added in v1.4.0

func DeepHashObject(hasher hash.Hash, objectToWrite interface{})

DeepHashObject writes specified object to hash using the spew library which follows pointers and prints actual values of the nested objects ensuring the hash does not change when a pointer changes.

func GenHashStr added in v1.4.0

func GenHashStr(data interface{}) string

GenHashStr ... This is a very stupid function, need to learn from kubernetes at how to generate pod name for deployment

func GenUniqueHash added in v0.9.8

func GenUniqueHash(hr *appv1.HelmRequest) string

GenUniqueHash generate a unique hash for a HelmRequest

func GetChartsForRepo added in v0.9.2

func GetChartsForRepo(name string) (*repo.IndexFile, error)

GetChartsForRepo retrieve charts info from a repo cache index Check: can we use the generated time to do compare?

func GetReleaseName added in v1.2.0

func GetReleaseName(hr *appv1.HelmRequest) string

GetReleaseName get release name

func IsHelmRequestSynced

func IsHelmRequestSynced(hr *appv1.HelmRequest) bool

IsHelmRequestSynced check if a HelmRequest is synced only if hash is equal and not install to all clusters First version: only hash .spec Second version: hash .spec and .metadata.annotations

func PrintRelease added in v1.4.0

func PrintRelease(out io.Writer, rel *release.Release)

PrintRelease prints info about a release

func RemoveRepository added in v0.9.0

func RemoveRepository(name string) error

RemoveRepository remove a repo from helm

func SouceToChartRepo added in v1.0.0

func SouceToChartRepo(name, dir, path string) error

SouceToChartRepo load vcs source to charts and upload them to chart repo

func UpdateHelmRequestStatus added in v1.4.0

func UpdateHelmRequestStatus(client clientset.Interface, request *appv1.HelmRequest) error

UpdateHelmRequestStatus update a helmrequest status This works simliar to the origin version in controller sync loop, the diff is: 1. no deletion helmrequest related resource when not found 2. more simple TODO: merge this two functions

Types

type ChartSourceType added in v1.5.0

type ChartSourceType string
const (
	ChartSourceHTTP  ChartSourceType = "http"
	ChartSourceOCI   ChartSourceType = "oci"
	ChartSourceChart ChartSourceType = "chart"
)

type Deploy added in v0.9.5

type Deploy struct {
	// logger
	Log logr.Logger

	// is this chart has deployed release
	Deployed bool

	// the global cluster info
	InCluster *cluster.Info

	// target cluster info
	Cluster *cluster.Info

	// system namespace for chartrepo
	SystemNamespace string

	// all the charts info
	HelmRequest *appv1.HelmRequest

	// Client is the crd client for hr
	Client clientset.Interface

	// Releases stores records of releases.
	Releases *storage.Storage
	// contains filtered or unexported fields
}

Deploy contains info about one chart deploy

func NewDeploy added in v0.9.5

func NewDeploy(client clientset.Interface) *Deploy

NewDeploy create a new deploy struct with crd client set

func (*Deploy) Delete added in v0.9.5

func (d *Deploy) Delete() error

Delete delete a Release from a cluster

func (*Deploy) GetCurrentReleases added in v1.4.0

func (d *Deploy) GetCurrentReleases() ([]*release.Release, error)

func (*Deploy) Sync added in v0.9.5

func (d *Deploy) Sync() (*release.Release, error)

Sync = install + upgrade When sync done, add the release note to HelmRequest status inCluster info is used to retrieve config info for valuesFrom

type Downloader added in v0.9.5

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

func NewDownloader added in v0.9.5

func NewDownloader(ns string, incfg, cfg *rest.Config, log logr.Logger) *Downloader

type IndexSyncer

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

IndexSyncer sync helm repo index repeatedly

func NewDefaultIndexSyncer

func NewDefaultIndexSyncer() *IndexSyncer

NewDefaultIndexSyncer create a new IndexSyncer

func (*IndexSyncer) Start

func (i *IndexSyncer) Start(stop <-chan struct{}) error

Start will refresh the repo index periodically

type RbacClient added in v1.4.0

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

type Values

type Values = map[string]interface{}

Values is an alias for map, we cannot use chartutils.Values because the helm code only support map when iterate the map

Jump to

Keyboard shortcuts

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