charts

package
v0.11.7 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2022 License: Apache-2.0, MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PopulateGlobalCatalog

func PopulateGlobalCatalog(options ...PopulateOption) error

PopulateGlobalCatalog uses the provided options to populate the existing Charts into the global Chart catalog.

Call this function only once when the controller initializes.

Types

type Catalog

type Catalog []*chart.Chart

Catalog is a list of available Helm Charts. Use different criteria with Query functions to select the desired Charts from the catalog.

func GlobalCatalog

func GlobalCatalog() Catalog

GlobalCatalog returns the global Chart catalog. This catalog is created once and is accessible globally.

Do not change the content of this catalog directly.

func (Catalog) AppVersions

func (c Catalog) AppVersions(name string) []string

AppVersions returns the list of the available appVersions of the named Chart in this catalog.

func (*Catalog) Append

func (c *Catalog) Append(chart *chart.Chart)

Append adds a new chart to the catalog. It ensures that the new chart has a valid metadata and a chart with the same name and version does not exist in the catalog.

func (Catalog) Empty

func (c Catalog) Empty() bool

Empty returns true when the catalog is empty. This is useful to check the results from the Query function.

func (Catalog) First

func (c Catalog) First() *chart.Chart

First returns the first element of the catalog or nil if the catalog is empty. This is useful to retrieve results from the Query function.

func (Catalog) Names

func (c Catalog) Names() []string

Names returns the list of the names of the Charts in this catalog.

func (*Catalog) Populate

func (c *Catalog) Populate(options ...PopulateOption) error

Populate uses the provided options to populate the existing Charts into the catalog.

Currently it can only populate Charts from the local file system using a set of search paths and file name patterns. If a directory or an archive file in the specified search paths contain a chart it loads it and appends it to the catalog.

func (Catalog) Query

func (c Catalog) Query(criteria ...Criterion) Catalog

Query selects any chart that matches all of the specified criteria. It can return an empty list when it can not find any match.

Each chart must match all the criteria. Use alternative criteria builders for different matching requirements.

func (Catalog) Versions

func (c Catalog) Versions(name string) []string

Versions returns the list of the available versions of the named Chart in this catalog.

type Criterion

type Criterion = func(*chart.Chart) bool

Criterion is a single criterion for querying Chart catalog. If a Chart matches the criterion it must return true.

func All

func All(criteria ...Criterion) Criterion

Any combines the provided Chart query criteria and succeeds when all of them return true.

func Any

func Any(criteria ...Criterion) Criterion

Any combines the provided Chart query criteria and succeeds when any of them returns true.

func None

func None(criteria ...Criterion) Criterion

None combines the provided Chart query criteria and succeeds when none of them return true.

func WithAppVersion

func WithAppVersion(appVersion string) Criterion

WithName matches the Chart appVersion.

func WithName

func WithName(name string) Criterion

WithName matches the Chart name.

func WithVersion

func WithVersion(version string) Criterion

WithName matches the Chart version.

type PopulateConfig

type PopulateConfig struct {
	Logger       logr.Logger
	SearchPaths  []string
	FilePatterns []string
	// contains filtered or unexported fields
}

PopulateConfig is the configuration used for populating available Helm Charts to the controller.

Currently it only supports searching the local file system with a set of search paths and file name patterns.

type PopulateOption

type PopulateOption = func(*PopulateConfig)

PopulateOption represents an individual Chart population option. The available options are:

  • WithSearchPath
  • WithFilePattern
  • WithLogger
  • WithContext

See each option for further details.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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