helm

package
v0.37.2 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2021 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Overview

Copyright 2020-2021 The UnDistro authors

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BasicAuthFromSecret

func BasicAuthFromSecret(secret corev1.Secret) (getter.Option, error)

BasicAuthFromSecret attempts to construct a basic auth getter.Option for the given v1.Secret and returns the result.

Secrets with no username AND password are ignored, if only one is defined it returns an error.

func ClientOptionsFromSecret

func ClientOptionsFromSecret(secret corev1.Secret) ([]getter.Option, func(), error)

ClientOptionsFromSecret constructs a getter.Option slice for the given secret. It returns the slice, and a callback to remove temporary files.

func TLSClientConfigFromSecret

func TLSClientConfigFromSecret(secret corev1.Secret) (getter.Option, func(), error)

TLSClientConfigFromSecret attempts to construct a TLS client config getter.Option for the given v1.Secret. It returns the getter.Option and a callback to remove the temporary TLS files.

Secrets with no certFile, keyFile, AND caFile are ignored, if only a certBytes OR keyBytes is defined it returns an error.

Types

type ChartRepository

type ChartRepository struct {
	URL     string
	Index   *repo.IndexFile
	Client  getter.Getter
	Options []getter.Option
}

ChartRepository represents a Helm chart repository, and the configuration required to download the chart index, and charts from the repository.

func NewChartRepository

func NewChartRepository(repositoryURL string, providers getter.Providers, opts []getter.Option) (*ChartRepository, error)

NewChartRepository constructs and returns a new ChartRepository with the ChartRepository.Client configured to the getter.Getter for the repository URL scheme. It returns an error on URL parsing failures, or if there is no getter available for the scheme.

func (*ChartRepository) DownloadChart

func (r *ChartRepository) DownloadChart(chart *repo.ChartVersion) (*bytes.Buffer, error)

DownloadChart confirms the given repo.ChartVersion has a downloadable URL, and then attempts to download the chart using the Client and Options of the ChartRepository. It returns a bytes.Buffer containing the chart data.

func (*ChartRepository) DownloadIndex

func (r *ChartRepository) DownloadIndex() error

DownloadIndex attempts to download the chart repository index using the Client and set Options, and loads the index file into the Index. It returns an error on URL parsing and Client failures.

func (*ChartRepository) Get

func (r *ChartRepository) Get(name, ver string) (*repo.ChartVersion, error)

Get returns the repo.ChartVersion for the given name, the version is expected to be a semver.Constraints compatible string. If version is empty, the latest stable version will be returned and prerelease versions will be ignored.

func (*ChartRepository) LoadIndex

func (r *ChartRepository) LoadIndex(b []byte) error

LoadIndex loads the given bytes into the Index while performing minimal validity checks. It fails if the API version is not set (repo.ErrNoAPIVersion), or if the unmarshal fails.

The logic is derived from and on par with: https://github.com/helm/helm/blob/v3.3.4/pkg/repo/index.go#L301

type Runner

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

Runner represents a Helm action runner capable of performing Helm operations

func NewRunner

func NewRunner(getter genericclioptions.RESTClientGetter, storageNamespace string, logger logr.Logger) (*Runner, error)

NewRunner constructs a new Runner configured to run Helm actions with the given genericclioptions.RESTClientGetter, and the release and storage namespace configured to the provided values.

func (*Runner) Install

func (r *Runner) Install(hr appv1alpha1.HelmRelease, chart *chart.Chart, values chartutil.Values) (*release.Release, error)

func (*Runner) List

func (r *Runner) List() ([]*release.Release, error)

func (*Runner) ObserveLastRelease

func (r *Runner) ObserveLastRelease(hr appv1alpha1.HelmRelease) (*release.Release, error)

ObserveLastRelease observes the last revision, if there is one, for the actual Helm release associated with the given v2beta1.HelmRelease.

func (*Runner) Rollback

func (r *Runner) Rollback(hr appv1alpha1.HelmRelease) error

func (*Runner) Status

func (r *Runner) Status(hr appv1alpha1.HelmRelease) (*release.Release, error)

func (*Runner) Test

Test runs a Helm test action for the given v2beta1.HelmRelease.

func (*Runner) Uninstall

func (r *Runner) Uninstall(hr appv1alpha1.HelmRelease) error

func (*Runner) UpdateState added in v0.36.16

func (r *Runner) UpdateState(re *release.Release) error

func (*Runner) Upgrade

func (r *Runner) Upgrade(hr appv1alpha1.HelmRelease, chart *chart.Chart, values chartutil.Values) (*release.Release, error)

Upgrade runs a Helm upgrade action for the given v2beta1.HelmRelease.

Jump to

Keyboard shortcuts

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