helm

package
v0.75.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AUTO defines automatic version identifier
	AUTO string = "auto"
	// MINORVERSION defines minor version identifier
	MINORVERSION string = "minor"
	// MAJORVERSION defines major version identifier
	MAJORVERSION string = "major"
	// PATCHVERSION defines patch version identifier
	PATCHVERSION string = "patch"
	// NOINCREMENT disables chart version auto increment
	NOINCREMENT string = "none"
)
View Source
const (
	// CHANGELOGTEMPLATE contains helm chart changelog information
	CHANGELOGTEMPLATE string = `` /* 618-byte string literal not displayed */

)

Variables

View Source
var (
	// ErrWrongConfig is the error message for a wrong helm configuration
	ErrWrongConfig = errors.New("wrong helm configuration")
)

Functions

This section is empty.

Types

type Chart

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

Chart defines a resource of kind helmchart

func New

func New(spec interface{}) (*Chart, error)

New returns a reference to a newly initialized Chart object from a Spec or an error if the provided YamlSpec triggers a validation error.

func (Chart) Changelog

func (c Chart) Changelog() string

Changelog returns a rendered template with this chart version information

func (*Chart) Condition

func (c *Chart) Condition(source string, scm scm.ScmHandler) (pass bool, message string, err error)

Condition checks if a specific chart version exist

func (*Chart) DependencyUpdate added in v0.25.0

func (c *Chart) DependencyUpdate(out *bytes.Buffer, chartPath string) error

DependencyUpdate updates the "Chart.lock" file if needed

func (*Chart) GetRepoIndexFromFile added in v0.40.0

func (c *Chart) GetRepoIndexFromFile(rootDir string) (repo.IndexFile, error)

GetRepoIndexFromFile loads an index file from a local file and does minimal validity checking. It fails if API Version isn't set (ErrNoAPIVersion) or if the "unmarshal" operation fails.

func (*Chart) GetRepoIndexFromURL added in v0.40.0

func (c *Chart) GetRepoIndexFromURL() (repo.IndexFile, error)

GetRepoIndexFromUrl loads an index file and does minimal validity checking. It fails if API Version isn't set (ErrNoAPIVersion) or if the "unmarshal" operation fails.

func (*Chart) MetadataUpdate added in v0.25.0

func (c *Chart) MetadataUpdate(source string, scm scm.ScmHandler, dryRun bool, resultTarget *result.Target) error

MetadataUpdate updates a metadata if necessary and it bump the ChartVersion

func (*Chart) OCICondition added in v0.41.0

func (c *Chart) OCICondition(source string, scm scm.ScmHandler) (pass bool, message string, err error)

Condition checks if a Helm chart version exists on a OCI registry It assumes that not being able to retrieve the OCI digest, means, the helm chart doesn't exist.

func (*Chart) OCISource added in v0.41.0

func (c *Chart) OCISource(workingDir string, resultSource *result.Source) error

OCISource return a Helm Chart version hosted on a OCI registry

func (*Chart) RequirementsUpdate added in v0.25.0

func (c *Chart) RequirementsUpdate(chartPath string) error

RequirementsUpdate test if Updatecli updated the "requirements.yaml" file if it's the case then Updatecli also delete and recreate the "requirements.lock" file

func (*Chart) Source

func (c *Chart) Source(workingDir string, resultSource *result.Source) error

Source return the latest version

func (*Chart) Target

func (c *Chart) Target(source string, scm scm.ScmHandler, dryRun bool, resultTarget *result.Target) error

Target updates helm chart, it receives the default source value and a "dry-run" flag then return if it changed something or failed

func (*Chart) ValidateTarget

func (c *Chart) ValidateTarget() error

ValidateTarget validates target struct fields.

type Spec

type Spec struct {
	/*
		file defines the Helm Chart file to update.
		the path must be relative to chart root directory
		the chart name is defined by the parameter "name"

		compatible:
			* source
			* condition
			* target

		default:
			default set to "values.yaml"
	*/
	File string `yaml:",omitempty"`
	/*
		key defines the yamlpath query used for retrieving value from a YAML document

		compatible:
			* source
			* condition
			* target

		example:
			* key: $.image.tag
			* key: $.images[0].tag

		remark:
			* key is a simpler version of yamlpath accepts keys.

	*/
	Key string `yaml:",omitempty"`
	/*
		name defines the Chart name path like 'stable/chart'.

		compatible:
			* source
			* condition
			* target

		example:
			* name: stable/chart

		remark:
			* when used with a scm, the name must be the relative path from the scm repository root directory
			  with such as "stable/chart"
	*/
	Name string `yaml:",omitempty"`
	/*
		skippackaging defines if a Chart should be packaged or not.

		compatible:
			* target

		default: false
	*/
	SkipPackaging bool `yaml:",omitempty"`
	/*
		url defines the Chart location URL.

		compatible:
			* source
			* condition

		example:
			* index.yaml
			* file://./index.yaml
			* https://github.com/updatecli/charts.git
			* oci://ghcr.io/olblak/charts/

	*/
	URL string `yaml:",omitempty"`
	/*
		value is the value associated with a yamlpath query.

		compatible:
			* condition
			* target
	*/
	Value string `yaml:",omitempty"`
	/*
		version defines the Chart version. It is used by condition to check if a version exists on the registry.

		compatible:
			* condition
	*/
	Version string `yaml:",omitempty"`
	/*
		versionIncrement defines if a Chart changes, triggers, or not, a Chart version update, accepted values is a comma separated list of "none,major,minor,patch,auto".

		compatible:
			* target

		default:
			default set to "minor"

		remark:
			when multiple pipelines update the same chart, the versionIncrement will be applied multiple times.
			more information on https://github.com/updatecli/updatecli/issues/693
	*/
	VersionIncrement string `yaml:",omitempty"`
	/*
		AppVersion defines if a Chart changes, triggers, or not, a Chart AppVersion update.
		The value is retrieved from the source input.

		compatible:
			* target

		default
			false
	*/
	AppVersion bool `yaml:",omitempty"`
	/*
		versionfilter provides parameters to specify version pattern and its type like 'regex', 'semver', or just 'latest'.

		compatible:
			* source

		default:
			semver

		remark:
			* Helm chart uses semver by default.
	*/
	VersionFilter version.Filter `yaml:",omitempty"`
	/*
		credentials defines the credentials used to authenticate with OCI registries
	*/
	docker.InlineKeyChain `yaml:",inline" mapstructure:",squash"`
}

Spec defines a specification for an "helmchart" resource parsed from an updatecli manifest file

Jump to

Keyboard shortcuts

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