v3

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2021 License: LGPL-3.0 Imports: 39 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrRepoNotFound = errors.New("helm repository not found!")

ErrRepoNotFound describe an error if helm repository not found

Functions

func ChartsGet

func ChartsGet(helmEnv *cli.EnvSettings, repos, chart, Keyword, version string) (map[string][]repo.ChartVersions, error)

func DownloadChartFromRepo

func DownloadChartFromRepo(name, version string, env *cli.EnvSettings) (string, error)

DownloadChartFromRepo download a given chart

func GetRepoFilePath

func GetRepoFilePath(env *cli.EnvSettings) string

func InstallHelmClient

func InstallHelmClient(env *cli.EnvSettings) error

InstallHelmClient Installs helm client on a given path

func InstallLocalHelm

func InstallLocalHelm(env *cli.EnvSettings, repoMap map[string]string) error

InstallLocalHelm install helm into the given path

func NewChartRepositoryWarp

func NewChartRepositoryWarp(cfg *repo.Entry, settings *cli.EnvSettings) (*repo.ChartRepository, error)

func NewCustomGetter

func NewCustomGetter(namespace string, kubeconfig []byte, cacheDir string, logger logr.Logger) (genericclioptions.RESTClientGetter, error)

func ReposAdd

func ReposAdd(env *cli.EnvSettings, c *repo.Entry) (bool, error)

ReposAdd adds repo(s)

func ReposDelete

func ReposDelete(env *cli.EnvSettings, repoName string) error

ReposDelete deletes repo(s)

func ReposGet

func ReposGet(env *cli.EnvSettings) ([]*repo.Entry, error)

ReposGet returns repo

func ReposModify

func ReposModify(env *cli.EnvSettings, repoName string, newRepo *repo.Entry) error

ReposModify modifies repo(s)

func ReposUpdate

func ReposUpdate(env *cli.EnvSettings, repoName string) error

ReposUpdate updates a repo(s)

func UninstallReleases

func UninstallReleases(helmEnv *HelmEnv, releaseName string, opt *Options) error

UninstallReleases

Types

type HelmEnv

type HelmEnv struct {
	KubeCache string

	Cli     *cli.EnvSettings
	KubeCli kubernetes.Interface
	genericclioptions.RESTClientGetter
}

func InitHelmRepoEnv

func InitHelmRepoEnv(organizationName string, repoMap map[string]string) (*HelmEnv, error)

InitHelmRepoEnv Generate helm path based on orgName

func NewHelmEnv

func NewHelmEnv(helmEnv *HelmEnv, kubeConfig []byte, ns string, kubecli kubernetes.Interface) (*HelmEnv, error)

type HelmIndexSyncer

type HelmIndexSyncer struct {
	HelmEnv *HelmEnv

	// interval is the interval of the sync process
	Interval int
}

HelmIndexSyncer sync helm repo index repeatedly

func NewDefaultHelmIndexSyncer

func NewDefaultHelmIndexSyncer(helmEnv *HelmEnv) *HelmIndexSyncer

func (*HelmIndexSyncer) Start

func (h *HelmIndexSyncer) Start(stop <-chan struct{}) error

type Options

type Options struct {
	Namespace    string  `json:"namespace,omitempty"`
	DryRun       bool    `json:"dryRun,omitempty"`
	GenerateName bool    `json:"generateName,omitempty"`
	Wait         bool    `json:"wait,omitempty"`
	Timeout      int64   `json:"timeout,omitempty"`
	ReuseValues  bool    `json:"reuseValues,omitempty"`
	Install      bool    `json:"install,omitempty"`
	Filter       *string `json:"filter,omitempty"`
	SkipCRDs     bool    `json:"skipCRDs,omitempty"`
}

Options struct holding directives for driving helm operations (similar to command line flags) extend this as required eventually build a more sophisticated solution for it

type Release

type Release struct {
	// ReleaseInput struct encapsulating information about the release to be created
	ReleaseName      string
	ChartName        string
	Namespace        string
	Values           map[string]interface{} //json representation
	Version          string
	ReleaseInfo      *ReleaseInfo
	ReleaseVersion   int32
	ReleaseResources []*object.K8sObject
	ChartPackage     []byte
}

Release represents information related to a helm chart release

func ApplyRelease

func ApplyRelease(helmEnv *HelmEnv, rlsName, chartUrlName, specChartVersion string, chartPackage []byte,
	namespace string, va []byte, runningRls *Release) (*Release, error)

Create or update a release, creating it if release parameter is nil, otherwise, updating it.

func InstallRelease

func InstallRelease(ctx context.Context, helmEnv *HelmEnv, releaseInput *Release, options *Options) (*Release, error)

func ListReleases

func ListReleases(_ context.Context, helmEnv *HelmEnv, opt *Options) ([]*Release, error)

func UpgradeRelease

func UpgradeRelease(ctx context.Context, helmEnv *HelmEnv, releaseInput *Release, options *Options) (*Release, error)

func (*Release) NameAndChartSlice

func (ri *Release) NameAndChartSlice() []string

type ReleaseInfo

type ReleaseInfo struct {
	// FirstDeployed is when the release was first deployed.
	FirstDeployed time.Time `json:"first_deployed,omitempty"`
	// LastDeployed is when the release was last deployed.
	LastDeployed time.Time `json:"last_deployed,omitempty"`
	// Deleted tracks when this object was deleted.
	Deleted time.Time `json:"deleted"`
	// Description is human-friendly "log entry" about this release.
	Description string `json:"description,omitempty"`
	// Status is the current state of the release
	Status string
	// Contains the rendered templates/NOTES.txt if available
	Notes string
	// Contains override values provided to the release
	Values map[string]interface{}
}

ReleaseInfo copy of the struct form the helm library

Jump to

Keyboard shortcuts

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