Promote API to v2beta1
This commit is contained in:
parent
9e3760af57
commit
accd4762fe
|
@ -22,7 +22,7 @@ jobs:
|
|||
- name: Setup Go
|
||||
uses: actions/setup-go@v2-beta
|
||||
with:
|
||||
go-version: 1.14.x
|
||||
go-version: 1.15.x
|
||||
- name: Setup Kubernetes
|
||||
uses: engineerd/setup-kind@v0.4.0
|
||||
- name: Setup Helm
|
||||
|
|
|
@ -12,7 +12,7 @@ jobs:
|
|||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: "^1.14.x"
|
||||
go-version: "^1.15.x"
|
||||
- run: go version
|
||||
# Runs a set of commands to initialize and analyze with FOSSA
|
||||
- name: run FOSSA analysis
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Docker buildkit multi-arch build requires golang alpine
|
||||
FROM golang:1.14-alpine as builder
|
||||
FROM golang:1.15-alpine as builder
|
||||
|
||||
WORKDIR /workspace
|
||||
|
||||
|
|
2
Makefile
2
Makefile
|
@ -59,7 +59,7 @@ manifests: controller-gen
|
|||
|
||||
# Generate API reference documentation
|
||||
api-docs: gen-crd-api-reference-docs
|
||||
$(API_REF_GEN) -api-dir=./api/v2alpha1 -config=./hack/api-docs/config.json -template-dir=./hack/api-docs/template -out-file=./docs/api/helmrelease.md
|
||||
$(API_REF_GEN) -api-dir=./api/v2beta1 -config=./hack/api-docs/config.json -template-dir=./hack/api-docs/template -out-file=./docs/api/helmrelease.md
|
||||
|
||||
# Run go fmt against code
|
||||
fmt:
|
||||
|
|
2
PROJECT
2
PROJECT
|
@ -3,5 +3,5 @@ repo: github.com/fluxcd/helm-controller
|
|||
resources:
|
||||
- group: helm
|
||||
kind: HelmRelease
|
||||
version: v2alpha1
|
||||
version: v2beta1
|
||||
version: "2"
|
||||
|
|
|
@ -44,7 +44,7 @@ operator.
|
|||
|
||||
## Specifications
|
||||
|
||||
* [API](docs/spec/v2alpha1/README.md)
|
||||
* [API](docs/spec/v2beta1/README.md)
|
||||
* [Controller](docs/spec/README.md)
|
||||
|
||||
[source-controller]: https://github.com/fluxcd/source-controller
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
module github.com/fluxcd/helm-controller/api
|
||||
|
||||
go 1.14
|
||||
go 1.15
|
||||
|
||||
require (
|
||||
github.com/fluxcd/pkg/apis/meta v0.0.2
|
||||
|
|
|
@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
|
|||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v2alpha1
|
||||
package v2beta1
|
||||
|
||||
const (
|
||||
// ReleasedCondition represents the status of the last release attempt
|
|
@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
|
|||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Package v2alpha1 contains API Schema definitions for the helm v2alpha1 API group
|
||||
// Package v2beta1 contains API Schema definitions for the helm v2beta1 API group
|
||||
// +kubebuilder:object:generate=true
|
||||
// +groupName=helm.toolkit.fluxcd.io
|
||||
package v2alpha1
|
||||
package v2beta1
|
|
@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
|
|||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v2alpha1
|
||||
package v2beta1
|
||||
|
||||
import (
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
|
@ -23,7 +23,7 @@ import (
|
|||
|
||||
var (
|
||||
// GroupVersion is group version used to register these objects
|
||||
GroupVersion = schema.GroupVersion{Group: "helm.toolkit.fluxcd.io", Version: "v2alpha1"}
|
||||
GroupVersion = schema.GroupVersion{Group: "helm.toolkit.fluxcd.io", Version: "v2beta1"}
|
||||
|
||||
// SchemeBuilder is used to add go types to the GroupVersionKind scheme
|
||||
SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}
|
|
@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
|
|||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v2alpha1
|
||||
package v2beta1
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
@ -35,7 +35,7 @@ const HelmReleaseFinalizer = "finalizers.fluxcd.io"
|
|||
|
||||
// HelmReleaseSpec defines the desired state of a Helm release.
|
||||
type HelmReleaseSpec struct {
|
||||
// Chart defines the template of the v1alpha1.HelmChart that should be created
|
||||
// Chart defines the template of the v1beta1.HelmChart that should be created
|
||||
// for this HelmRelease.
|
||||
// +required
|
||||
Chart HelmChartTemplate `json:"chart"`
|
||||
|
@ -155,31 +155,31 @@ func (in HelmReleaseSpec) GetUninstall() Uninstall {
|
|||
}
|
||||
|
||||
// HelmChartTemplate defines the template from which the controller will
|
||||
// generate a v1alpha1.HelmChart object in the same namespace as the referenced
|
||||
// v1alpha1.Source.
|
||||
// generate a v1beta1.HelmChart object in the same namespace as the referenced
|
||||
// v1beta1.Source.
|
||||
type HelmChartTemplate struct {
|
||||
// Spec holds the template for the v1alpha1.HelmChartSpec for this HelmRelease.
|
||||
// Spec holds the template for the v1beta1.HelmChartSpec for this HelmRelease.
|
||||
// +required
|
||||
Spec HelmChartTemplateSpec `json:"spec"`
|
||||
}
|
||||
|
||||
// HelmChartTemplateSpec defines the template from which the controller will
|
||||
// generate a v1alpha1.HelmChartSpec object.
|
||||
// generate a v1beta1.HelmChartSpec object.
|
||||
type HelmChartTemplateSpec struct {
|
||||
// The name or path the Helm chart is available at in the SourceRef.
|
||||
// +required
|
||||
Chart string `json:"chart"`
|
||||
|
||||
// Version semver expression, ignored for charts from v1alpha1.GitRepository and
|
||||
// v1alpha1.Bucket sources. Defaults to latest when omitted.
|
||||
// Version semver expression, ignored for charts from v1beta1.GitRepository and
|
||||
// v1beta1.Bucket sources. Defaults to latest when omitted.
|
||||
// +optional
|
||||
Version string `json:"version,omitempty"`
|
||||
|
||||
// The name and namespace of the v1alpha1.Source the chart is available at.
|
||||
// The name and namespace of the v1beta1.Source the chart is available at.
|
||||
// +required
|
||||
SourceRef CrossNamespaceObjectReference `json:"sourceRef"`
|
||||
|
||||
// Interval at which to check the v1alpha1.Source for updates. Defaults to
|
||||
// Interval at which to check the v1beta1.Source for updates. Defaults to
|
||||
// 'HelmReleaseSpec.Interval'.
|
||||
// +optional
|
||||
Interval *metav1.Duration `json:"interval,omitempty"`
|
||||
|
@ -190,7 +190,7 @@ type HelmChartTemplateSpec struct {
|
|||
ValuesFile string `json:"valuesFile,omitempty"`
|
||||
}
|
||||
|
||||
// GetInterval returns the configured interval for the v1alpha1.HelmChart,
|
||||
// GetInterval returns the configured interval for the v1beta1.HelmChart,
|
||||
// or the given default.
|
||||
func (in HelmChartTemplate) GetInterval(defaultInterval metav1.Duration) metav1.Duration {
|
||||
if in.Spec.Interval == nil {
|
||||
|
@ -200,7 +200,7 @@ func (in HelmChartTemplate) GetInterval(defaultInterval metav1.Duration) metav1.
|
|||
}
|
||||
|
||||
// GetNamespace returns the namespace targeted namespace for the
|
||||
// v1alpha1.HelmChart, or the given default.
|
||||
// v1beta1.HelmChart, or the given default.
|
||||
func (in HelmChartTemplate) GetNamespace(defaultNamespace string) string {
|
||||
if in.Spec.SourceRef.Namespace == "" {
|
||||
return defaultNamespace
|
|
@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
|
|||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v2alpha1
|
||||
package v2beta1
|
||||
|
||||
// CrossNamespaceObjectReference contains enough information to let you locate
|
||||
// the typed referenced object at cluster level.
|
|
@ -18,7 +18,7 @@ limitations under the License.
|
|||
|
||||
// Code generated by controller-gen. DO NOT EDIT.
|
||||
|
||||
package v2alpha1
|
||||
package v2beta1
|
||||
|
||||
import (
|
||||
"github.com/fluxcd/pkg/apis/meta"
|
|
@ -28,7 +28,7 @@ spec:
|
|||
- jsonPath: .metadata.creationTimestamp
|
||||
name: Age
|
||||
type: date
|
||||
name: v2alpha1
|
||||
name: v2beta1
|
||||
schema:
|
||||
openAPIV3Schema:
|
||||
description: HelmRelease is the Schema for the helmreleases API
|
||||
|
@ -49,11 +49,11 @@ spec:
|
|||
description: HelmReleaseSpec defines the desired state of a Helm release.
|
||||
properties:
|
||||
chart:
|
||||
description: Chart defines the template of the v1alpha1.HelmChart
|
||||
that should be created for this HelmRelease.
|
||||
description: Chart defines the template of the v1beta1.HelmChart that
|
||||
should be created for this HelmRelease.
|
||||
properties:
|
||||
spec:
|
||||
description: Spec holds the template for the v1alpha1.HelmChartSpec
|
||||
description: Spec holds the template for the v1beta1.HelmChartSpec
|
||||
for this HelmRelease.
|
||||
properties:
|
||||
chart:
|
||||
|
@ -61,11 +61,11 @@ spec:
|
|||
at in the SourceRef.
|
||||
type: string
|
||||
interval:
|
||||
description: Interval at which to check the v1alpha1.Source
|
||||
description: Interval at which to check the v1beta1.Source
|
||||
for updates. Defaults to 'HelmReleaseSpec.Interval'.
|
||||
type: string
|
||||
sourceRef:
|
||||
description: The name and namespace of the v1alpha1.Source
|
||||
description: The name and namespace of the v1beta1.Source
|
||||
the chart is available at.
|
||||
properties:
|
||||
apiVersion:
|
||||
|
@ -98,8 +98,8 @@ spec:
|
|||
type: string
|
||||
version:
|
||||
description: Version semver expression, ignored for charts
|
||||
from v1alpha1.GitRepository and v1alpha1.Bucket sources.
|
||||
Defaults to latest when omitted.
|
||||
from v1beta1.GitRepository and v1beta1.Bucket sources. Defaults
|
||||
to latest when omitted.
|
||||
type: string
|
||||
required:
|
||||
- chart
|
||||
|
|
|
@ -5,6 +5,6 @@ resources:
|
|||
- ../crd
|
||||
- ../rbac
|
||||
- ../manager
|
||||
- github.com/fluxcd/source-controller/config//crd?ref=v0.0.15
|
||||
- github.com/fluxcd/source-controller/config//manager?ref=v0.0.15
|
||||
- github.com/fluxcd/source-controller/config//crd?ref=v0.1.0
|
||||
- github.com/fluxcd/source-controller/config//manager?ref=v0.1.0
|
||||
- namespace.yaml
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: helm.toolkit.fluxcd.io/v2alpha1
|
||||
apiVersion: helm.toolkit.fluxcd.io/v2beta1
|
||||
kind: HelmRelease
|
||||
metadata:
|
||||
name: podinfo-gitrepository
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: helm.toolkit.fluxcd.io/v2alpha1
|
||||
apiVersion: helm.toolkit.fluxcd.io/v2beta1
|
||||
kind: HelmRelease
|
||||
metadata:
|
||||
name: podinfo-helmrepository
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: source.toolkit.fluxcd.io/v1alpha1
|
||||
apiVersion: source.toolkit.fluxcd.io/v1beta1
|
||||
kind: GitRepository
|
||||
metadata:
|
||||
name: podinfo
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: source.toolkit.fluxcd.io/v1alpha1
|
||||
apiVersion: source.toolkit.fluxcd.io/v1beta1
|
||||
kind: HelmRepository
|
||||
metadata:
|
||||
name: podinfo
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: helm.toolkit.fluxcd.io/v2alpha1
|
||||
apiVersion: helm.toolkit.fluxcd.io/v2beta1
|
||||
kind: HelmRelease
|
||||
metadata:
|
||||
name: backend
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: helm.toolkit.fluxcd.io/v2alpha1
|
||||
apiVersion: helm.toolkit.fluxcd.io/v2beta1
|
||||
kind: HelmRelease
|
||||
metadata:
|
||||
name: frontend
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: source.toolkit.fluxcd.io/v1alpha1
|
||||
apiVersion: source.toolkit.fluxcd.io/v1beta1
|
||||
kind: HelmRepository
|
||||
metadata:
|
||||
name: webapp
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: helm.toolkit.fluxcd.io/v2alpha1
|
||||
apiVersion: helm.toolkit.fluxcd.io/v2beta1
|
||||
kind: HelmRelease
|
||||
metadata:
|
||||
name: install-fail-remediate
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: helm.toolkit.fluxcd.io/v2alpha1
|
||||
apiVersion: helm.toolkit.fluxcd.io/v2beta1
|
||||
kind: HelmRelease
|
||||
metadata:
|
||||
name: install-fail-retry
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: helm.toolkit.fluxcd.io/v2alpha1
|
||||
apiVersion: helm.toolkit.fluxcd.io/v2beta1
|
||||
kind: HelmRelease
|
||||
metadata:
|
||||
name: install-fail
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: helm.toolkit.fluxcd.io/v2alpha1
|
||||
apiVersion: helm.toolkit.fluxcd.io/v2beta1
|
||||
kind: HelmRelease
|
||||
metadata:
|
||||
name: install-test-fail-ignore
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: helm.toolkit.fluxcd.io/v2alpha1
|
||||
apiVersion: helm.toolkit.fluxcd.io/v2beta1
|
||||
kind: HelmRelease
|
||||
metadata:
|
||||
name: install-test-fail
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: source.toolkit.fluxcd.io/v1alpha1
|
||||
apiVersion: source.toolkit.fluxcd.io/v1beta1
|
||||
kind: GitRepository
|
||||
metadata:
|
||||
name: podinfo
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: helm.toolkit.fluxcd.io/v2alpha1
|
||||
apiVersion: helm.toolkit.fluxcd.io/v2beta1
|
||||
kind: HelmRelease
|
||||
metadata:
|
||||
name: podinfo-git
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: helm.toolkit.fluxcd.io/v2alpha1
|
||||
apiVersion: helm.toolkit.fluxcd.io/v2beta1
|
||||
kind: HelmRelease
|
||||
metadata:
|
||||
name: podinfo
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: source.toolkit.fluxcd.io/v1alpha1
|
||||
apiVersion: source.toolkit.fluxcd.io/v1beta1
|
||||
kind: HelmRepository
|
||||
metadata:
|
||||
name: podinfo
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: helm.toolkit.fluxcd.io/v2alpha1
|
||||
apiVersion: helm.toolkit.fluxcd.io/v2beta1
|
||||
kind: HelmRelease
|
||||
metadata:
|
||||
name: upgrade-fail-remediate-uninstall
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: helm.toolkit.fluxcd.io/v2alpha1
|
||||
apiVersion: helm.toolkit.fluxcd.io/v2beta1
|
||||
kind: HelmRelease
|
||||
metadata:
|
||||
name: upgrade-fail-remediate-uninstall
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: helm.toolkit.fluxcd.io/v2alpha1
|
||||
apiVersion: helm.toolkit.fluxcd.io/v2beta1
|
||||
kind: HelmRelease
|
||||
metadata:
|
||||
name: upgrade-fail-remediate
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: helm.toolkit.fluxcd.io/v2alpha1
|
||||
apiVersion: helm.toolkit.fluxcd.io/v2beta1
|
||||
kind: HelmRelease
|
||||
metadata:
|
||||
name: upgrade-fail-remediate
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: helm.toolkit.fluxcd.io/v2alpha1
|
||||
apiVersion: helm.toolkit.fluxcd.io/v2beta1
|
||||
kind: HelmRelease
|
||||
metadata:
|
||||
name: upgrade-fail-retry
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: helm.toolkit.fluxcd.io/v2alpha1
|
||||
apiVersion: helm.toolkit.fluxcd.io/v2beta1
|
||||
kind: HelmRelease
|
||||
metadata:
|
||||
name: upgrade-fail-retry
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: helm.toolkit.fluxcd.io/v2alpha1
|
||||
apiVersion: helm.toolkit.fluxcd.io/v2beta1
|
||||
kind: HelmRelease
|
||||
metadata:
|
||||
name: upgrade-fail
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: helm.toolkit.fluxcd.io/v2alpha1
|
||||
apiVersion: helm.toolkit.fluxcd.io/v2beta1
|
||||
kind: HelmRelease
|
||||
metadata:
|
||||
name: upgrade-fail
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: helm.toolkit.fluxcd.io/v2alpha1
|
||||
apiVersion: helm.toolkit.fluxcd.io/v2beta1
|
||||
kind: HelmRelease
|
||||
metadata:
|
||||
name: upgrade-test-fail
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: helm.toolkit.fluxcd.io/v2alpha1
|
||||
apiVersion: helm.toolkit.fluxcd.io/v2beta1
|
||||
kind: HelmRelease
|
||||
metadata:
|
||||
name: upgrade-test-fail
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: helm.toolkit.fluxcd.io/v2alpha1
|
||||
apiVersion: helm.toolkit.fluxcd.io/v2beta1
|
||||
kind: HelmRelease
|
||||
metadata:
|
||||
name: valuesfrom
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: source.toolkit.fluxcd.io/v1alpha1
|
||||
apiVersion: source.toolkit.fluxcd.io/v1beta1
|
||||
kind: HelmRepository
|
||||
metadata:
|
||||
name: valuesfrom
|
||||
|
|
|
@ -20,7 +20,7 @@ import (
|
|||
"sigs.k8s.io/controller-runtime/pkg/event"
|
||||
"sigs.k8s.io/controller-runtime/pkg/predicate"
|
||||
|
||||
sourcev1 "github.com/fluxcd/source-controller/api/v1alpha1"
|
||||
sourcev1 "github.com/fluxcd/source-controller/api/v1beta1"
|
||||
)
|
||||
|
||||
type HelmChartRevisionChangePredicate struct {
|
||||
|
|
|
@ -31,9 +31,9 @@ import (
|
|||
"sigs.k8s.io/controller-runtime/pkg/client"
|
||||
|
||||
"github.com/fluxcd/pkg/apis/meta"
|
||||
sourcev1 "github.com/fluxcd/source-controller/api/v1alpha1"
|
||||
sourcev1 "github.com/fluxcd/source-controller/api/v1beta1"
|
||||
|
||||
v2 "github.com/fluxcd/helm-controller/api/v2alpha1"
|
||||
v2 "github.com/fluxcd/helm-controller/api/v2beta1"
|
||||
)
|
||||
|
||||
// HelmChartWatcher watches HelmChart objects for revision changes and
|
||||
|
|
|
@ -47,9 +47,9 @@ import (
|
|||
"github.com/fluxcd/pkg/apis/meta"
|
||||
"github.com/fluxcd/pkg/recorder"
|
||||
"github.com/fluxcd/pkg/runtime/predicates"
|
||||
sourcev1 "github.com/fluxcd/source-controller/api/v1alpha1"
|
||||
sourcev1 "github.com/fluxcd/source-controller/api/v1beta1"
|
||||
|
||||
v2 "github.com/fluxcd/helm-controller/api/v2alpha1"
|
||||
v2 "github.com/fluxcd/helm-controller/api/v2beta1"
|
||||
"github.com/fluxcd/helm-controller/internal/runner"
|
||||
"github.com/fluxcd/helm-controller/internal/util"
|
||||
)
|
||||
|
@ -438,7 +438,7 @@ func (r *HelmReleaseReconciler) checkDependencies(hr v2.HelmRelease) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// composeValues attempts to resolve all v2alpha1.ValuesReference resources
|
||||
// composeValues attempts to resolve all v2beta1.ValuesReference resources
|
||||
// and merges them as defined. Referenced resources are only retrieved once
|
||||
// to ensure a single version is taken into account during the merge.
|
||||
func (r *HelmReleaseReconciler) composeValues(ctx context.Context, hr v2.HelmRelease) (chartutil.Values, error) {
|
||||
|
@ -567,7 +567,7 @@ func (r *HelmReleaseReconciler) loadHelmChart(source *sourcev1.HelmChart) (*char
|
|||
return loader.Load(f.Name())
|
||||
}
|
||||
|
||||
// garbageCollect deletes the v1alpha1.HelmChart of the v2alpha1.HelmRelease,
|
||||
// garbageCollect deletes the v1beta1.HelmChart of the v2beta1.HelmRelease,
|
||||
// and uninstalls the Helm release if the resource has not been suspended.
|
||||
func (r *HelmReleaseReconciler) garbageCollect(ctx context.Context, logger logr.Logger, hr v2.HelmRelease) error {
|
||||
if err := r.garbageCollectHelmChart(ctx, hr); err != nil {
|
||||
|
@ -580,8 +580,8 @@ func (r *HelmReleaseReconciler) garbageCollect(ctx context.Context, logger logr.
|
|||
return r.garbageCollectHelmRelease(logger, hr)
|
||||
}
|
||||
|
||||
// garbageCollectHelmChart deletes the v1alpha1.HelmChart of the
|
||||
// v2alpha1.HelmRelease.
|
||||
// garbageCollectHelmChart deletes the v1beta1.HelmChart of the
|
||||
// v2beta1.HelmRelease.
|
||||
func (r *HelmReleaseReconciler) garbageCollectHelmChart(ctx context.Context, hr v2.HelmRelease) error {
|
||||
if hr.Status.HelmChart == "" {
|
||||
return nil
|
||||
|
@ -604,7 +604,7 @@ func (r *HelmReleaseReconciler) garbageCollectHelmChart(ctx context.Context, hr
|
|||
}
|
||||
|
||||
// garbageCollectHelmRelease uninstalls the deployed Helm release of
|
||||
// the given v2alpha1.HelmRelease.
|
||||
// the given v2beta1.HelmRelease.
|
||||
func (r *HelmReleaseReconciler) garbageCollectHelmRelease(logger logr.Logger, hr v2.HelmRelease) error {
|
||||
run, err := runner.NewRunner(r.Config, hr.Namespace, logger)
|
||||
if err != nil {
|
||||
|
|
|
@ -30,7 +30,7 @@ import (
|
|||
logf "sigs.k8s.io/controller-runtime/pkg/log"
|
||||
"sigs.k8s.io/controller-runtime/pkg/log/zap"
|
||||
|
||||
helmv2alpha1 "github.com/fluxcd/helm-controller/api/v2alpha1"
|
||||
"github.com/fluxcd/helm-controller/api/v2beta1"
|
||||
// +kubebuilder:scaffold:imports
|
||||
)
|
||||
|
||||
|
@ -62,7 +62,7 @@ var _ = BeforeSuite(func(done Done) {
|
|||
Expect(err).ToNot(HaveOccurred())
|
||||
Expect(cfg).ToNot(BeNil())
|
||||
|
||||
err = helmv2alpha1.AddToScheme(scheme.Scheme)
|
||||
err = v2beta1.AddToScheme(scheme.Scheme)
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
|
||||
// +kubebuilder:scaffold:scheme
|
||||
|
|
|
@ -2,16 +2,16 @@
|
|||
<p>Packages:</p>
|
||||
<ul class="simple">
|
||||
<li>
|
||||
<a href="#helm.toolkit.fluxcd.io%2fv2alpha1">helm.toolkit.fluxcd.io/v2alpha1</a>
|
||||
<a href="#helm.toolkit.fluxcd.io%2fv2beta1">helm.toolkit.fluxcd.io/v2beta1</a>
|
||||
</li>
|
||||
</ul>
|
||||
<h2 id="helm.toolkit.fluxcd.io/v2alpha1">helm.toolkit.fluxcd.io/v2alpha1</h2>
|
||||
<p>Package v2alpha1 contains API Schema definitions for the helm v2alpha1 API group</p>
|
||||
<h2 id="helm.toolkit.fluxcd.io/v2beta1">helm.toolkit.fluxcd.io/v2beta1</h2>
|
||||
<p>Package v2beta1 contains API Schema definitions for the helm v2beta1 API group</p>
|
||||
Resource Types:
|
||||
<ul class="simple"><li>
|
||||
<a href="#helm.toolkit.fluxcd.io/v2alpha1.HelmRelease">HelmRelease</a>
|
||||
<a href="#helm.toolkit.fluxcd.io/v2beta1.HelmRelease">HelmRelease</a>
|
||||
</li></ul>
|
||||
<h3 id="helm.toolkit.fluxcd.io/v2alpha1.HelmRelease">HelmRelease
|
||||
<h3 id="helm.toolkit.fluxcd.io/v2beta1.HelmRelease">HelmRelease
|
||||
</h3>
|
||||
<p>HelmRelease is the Schema for the helmreleases API</p>
|
||||
<div class="md-typeset__scrollwrap">
|
||||
|
@ -29,7 +29,7 @@ Resource Types:
|
|||
<code>apiVersion</code><br>
|
||||
string</td>
|
||||
<td>
|
||||
<code>helm.toolkit.fluxcd.io/v2alpha1</code>
|
||||
<code>helm.toolkit.fluxcd.io/v2beta1</code>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -59,7 +59,7 @@ Refer to the Kubernetes API documentation for the fields of the
|
|||
<td>
|
||||
<code>spec</code><br>
|
||||
<em>
|
||||
<a href="#helm.toolkit.fluxcd.io/v2alpha1.HelmReleaseSpec">
|
||||
<a href="#helm.toolkit.fluxcd.io/v2beta1.HelmReleaseSpec">
|
||||
HelmReleaseSpec
|
||||
</a>
|
||||
</em>
|
||||
|
@ -72,13 +72,13 @@ HelmReleaseSpec
|
|||
<td>
|
||||
<code>chart</code><br>
|
||||
<em>
|
||||
<a href="#helm.toolkit.fluxcd.io/v2alpha1.HelmChartTemplate">
|
||||
<a href="#helm.toolkit.fluxcd.io/v2beta1.HelmChartTemplate">
|
||||
HelmChartTemplate
|
||||
</a>
|
||||
</em>
|
||||
</td>
|
||||
<td>
|
||||
<p>Chart defines the template of the v1alpha1.HelmChart that should be created
|
||||
<p>Chart defines the template of the v1beta1.HelmChart that should be created
|
||||
for this HelmRelease.</p>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -182,7 +182,7 @@ Use ‘0’ for an unlimited number of revisions; defaults to ‘10&
|
|||
<td>
|
||||
<code>install</code><br>
|
||||
<em>
|
||||
<a href="#helm.toolkit.fluxcd.io/v2alpha1.Install">
|
||||
<a href="#helm.toolkit.fluxcd.io/v2beta1.Install">
|
||||
Install
|
||||
</a>
|
||||
</em>
|
||||
|
@ -196,7 +196,7 @@ Install
|
|||
<td>
|
||||
<code>upgrade</code><br>
|
||||
<em>
|
||||
<a href="#helm.toolkit.fluxcd.io/v2alpha1.Upgrade">
|
||||
<a href="#helm.toolkit.fluxcd.io/v2beta1.Upgrade">
|
||||
Upgrade
|
||||
</a>
|
||||
</em>
|
||||
|
@ -210,7 +210,7 @@ Upgrade
|
|||
<td>
|
||||
<code>test</code><br>
|
||||
<em>
|
||||
<a href="#helm.toolkit.fluxcd.io/v2alpha1.Test">
|
||||
<a href="#helm.toolkit.fluxcd.io/v2beta1.Test">
|
||||
Test
|
||||
</a>
|
||||
</em>
|
||||
|
@ -224,7 +224,7 @@ Test
|
|||
<td>
|
||||
<code>rollback</code><br>
|
||||
<em>
|
||||
<a href="#helm.toolkit.fluxcd.io/v2alpha1.Rollback">
|
||||
<a href="#helm.toolkit.fluxcd.io/v2beta1.Rollback">
|
||||
Rollback
|
||||
</a>
|
||||
</em>
|
||||
|
@ -238,7 +238,7 @@ Rollback
|
|||
<td>
|
||||
<code>uninstall</code><br>
|
||||
<em>
|
||||
<a href="#helm.toolkit.fluxcd.io/v2alpha1.Uninstall">
|
||||
<a href="#helm.toolkit.fluxcd.io/v2beta1.Uninstall">
|
||||
Uninstall
|
||||
</a>
|
||||
</em>
|
||||
|
@ -252,7 +252,7 @@ Uninstall
|
|||
<td>
|
||||
<code>valuesFrom</code><br>
|
||||
<em>
|
||||
<a href="#helm.toolkit.fluxcd.io/v2alpha1.ValuesReference">
|
||||
<a href="#helm.toolkit.fluxcd.io/v2beta1.ValuesReference">
|
||||
[]ValuesReference
|
||||
</a>
|
||||
</em>
|
||||
|
@ -283,7 +283,7 @@ Kubernetes pkg/apis/apiextensions/v1.JSON
|
|||
<td>
|
||||
<code>status</code><br>
|
||||
<em>
|
||||
<a href="#helm.toolkit.fluxcd.io/v2alpha1.HelmReleaseStatus">
|
||||
<a href="#helm.toolkit.fluxcd.io/v2beta1.HelmReleaseStatus">
|
||||
HelmReleaseStatus
|
||||
</a>
|
||||
</em>
|
||||
|
@ -295,11 +295,11 @@ HelmReleaseStatus
|
|||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<h3 id="helm.toolkit.fluxcd.io/v2alpha1.CrossNamespaceObjectReference">CrossNamespaceObjectReference
|
||||
<h3 id="helm.toolkit.fluxcd.io/v2beta1.CrossNamespaceObjectReference">CrossNamespaceObjectReference
|
||||
</h3>
|
||||
<p>
|
||||
(<em>Appears on:</em>
|
||||
<a href="#helm.toolkit.fluxcd.io/v2alpha1.HelmChartTemplateSpec">HelmChartTemplateSpec</a>)
|
||||
<a href="#helm.toolkit.fluxcd.io/v2beta1.HelmChartTemplateSpec">HelmChartTemplateSpec</a>)
|
||||
</p>
|
||||
<p>CrossNamespaceObjectReference contains enough information to let you locate
|
||||
the typed referenced object at cluster level.</p>
|
||||
|
@ -363,18 +363,18 @@ string
|
|||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<h3 id="helm.toolkit.fluxcd.io/v2alpha1.DeploymentAction">DeploymentAction
|
||||
<h3 id="helm.toolkit.fluxcd.io/v2beta1.DeploymentAction">DeploymentAction
|
||||
</h3>
|
||||
<p>DeploymentAction defines a consistent interface for Install and Upgrade.</p>
|
||||
<h3 id="helm.toolkit.fluxcd.io/v2alpha1.HelmChartTemplate">HelmChartTemplate
|
||||
<h3 id="helm.toolkit.fluxcd.io/v2beta1.HelmChartTemplate">HelmChartTemplate
|
||||
</h3>
|
||||
<p>
|
||||
(<em>Appears on:</em>
|
||||
<a href="#helm.toolkit.fluxcd.io/v2alpha1.HelmReleaseSpec">HelmReleaseSpec</a>)
|
||||
<a href="#helm.toolkit.fluxcd.io/v2beta1.HelmReleaseSpec">HelmReleaseSpec</a>)
|
||||
</p>
|
||||
<p>HelmChartTemplate defines the template from which the controller will
|
||||
generate a v1alpha1.HelmChart object in the same namespace as the referenced
|
||||
v1alpha1.Source.</p>
|
||||
generate a v1beta1.HelmChart object in the same namespace as the referenced
|
||||
v1beta1.Source.</p>
|
||||
<div class="md-typeset__scrollwrap">
|
||||
<div class="md-typeset__table">
|
||||
<table>
|
||||
|
@ -389,13 +389,13 @@ v1alpha1.Source.</p>
|
|||
<td>
|
||||
<code>spec</code><br>
|
||||
<em>
|
||||
<a href="#helm.toolkit.fluxcd.io/v2alpha1.HelmChartTemplateSpec">
|
||||
<a href="#helm.toolkit.fluxcd.io/v2beta1.HelmChartTemplateSpec">
|
||||
HelmChartTemplateSpec
|
||||
</a>
|
||||
</em>
|
||||
</td>
|
||||
<td>
|
||||
<p>Spec holds the template for the v1alpha1.HelmChartSpec for this HelmRelease.</p>
|
||||
<p>Spec holds the template for the v1beta1.HelmChartSpec for this HelmRelease.</p>
|
||||
<br/>
|
||||
<br/>
|
||||
<table>
|
||||
|
@ -419,21 +419,21 @@ string
|
|||
</td>
|
||||
<td>
|
||||
<em>(Optional)</em>
|
||||
<p>Version semver expression, ignored for charts from v1alpha1.GitRepository and
|
||||
v1alpha1.Bucket sources. Defaults to latest when omitted.</p>
|
||||
<p>Version semver expression, ignored for charts from v1beta1.GitRepository and
|
||||
v1beta1.Bucket sources. Defaults to latest when omitted.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>sourceRef</code><br>
|
||||
<em>
|
||||
<a href="#helm.toolkit.fluxcd.io/v2alpha1.CrossNamespaceObjectReference">
|
||||
<a href="#helm.toolkit.fluxcd.io/v2beta1.CrossNamespaceObjectReference">
|
||||
CrossNamespaceObjectReference
|
||||
</a>
|
||||
</em>
|
||||
</td>
|
||||
<td>
|
||||
<p>The name and namespace of the v1alpha1.Source the chart is available at.</p>
|
||||
<p>The name and namespace of the v1beta1.Source the chart is available at.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -447,7 +447,7 @@ Kubernetes meta/v1.Duration
|
|||
</td>
|
||||
<td>
|
||||
<em>(Optional)</em>
|
||||
<p>Interval at which to check the v1alpha1.Source for updates. Defaults to
|
||||
<p>Interval at which to check the v1beta1.Source for updates. Defaults to
|
||||
‘HelmReleaseSpec.Interval’.</p>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -471,14 +471,14 @@ relative path in the SourceRef. Ignored when omitted.</p>
|
|||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<h3 id="helm.toolkit.fluxcd.io/v2alpha1.HelmChartTemplateSpec">HelmChartTemplateSpec
|
||||
<h3 id="helm.toolkit.fluxcd.io/v2beta1.HelmChartTemplateSpec">HelmChartTemplateSpec
|
||||
</h3>
|
||||
<p>
|
||||
(<em>Appears on:</em>
|
||||
<a href="#helm.toolkit.fluxcd.io/v2alpha1.HelmChartTemplate">HelmChartTemplate</a>)
|
||||
<a href="#helm.toolkit.fluxcd.io/v2beta1.HelmChartTemplate">HelmChartTemplate</a>)
|
||||
</p>
|
||||
<p>HelmChartTemplateSpec defines the template from which the controller will
|
||||
generate a v1alpha1.HelmChartSpec object.</p>
|
||||
generate a v1beta1.HelmChartSpec object.</p>
|
||||
<div class="md-typeset__scrollwrap">
|
||||
<div class="md-typeset__table">
|
||||
<table>
|
||||
|
@ -509,21 +509,21 @@ string
|
|||
</td>
|
||||
<td>
|
||||
<em>(Optional)</em>
|
||||
<p>Version semver expression, ignored for charts from v1alpha1.GitRepository and
|
||||
v1alpha1.Bucket sources. Defaults to latest when omitted.</p>
|
||||
<p>Version semver expression, ignored for charts from v1beta1.GitRepository and
|
||||
v1beta1.Bucket sources. Defaults to latest when omitted.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>sourceRef</code><br>
|
||||
<em>
|
||||
<a href="#helm.toolkit.fluxcd.io/v2alpha1.CrossNamespaceObjectReference">
|
||||
<a href="#helm.toolkit.fluxcd.io/v2beta1.CrossNamespaceObjectReference">
|
||||
CrossNamespaceObjectReference
|
||||
</a>
|
||||
</em>
|
||||
</td>
|
||||
<td>
|
||||
<p>The name and namespace of the v1alpha1.Source the chart is available at.</p>
|
||||
<p>The name and namespace of the v1beta1.Source the chart is available at.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -537,7 +537,7 @@ Kubernetes meta/v1.Duration
|
|||
</td>
|
||||
<td>
|
||||
<em>(Optional)</em>
|
||||
<p>Interval at which to check the v1alpha1.Source for updates. Defaults to
|
||||
<p>Interval at which to check the v1beta1.Source for updates. Defaults to
|
||||
‘HelmReleaseSpec.Interval’.</p>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -558,11 +558,11 @@ relative path in the SourceRef. Ignored when omitted.</p>
|
|||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<h3 id="helm.toolkit.fluxcd.io/v2alpha1.HelmReleaseSpec">HelmReleaseSpec
|
||||
<h3 id="helm.toolkit.fluxcd.io/v2beta1.HelmReleaseSpec">HelmReleaseSpec
|
||||
</h3>
|
||||
<p>
|
||||
(<em>Appears on:</em>
|
||||
<a href="#helm.toolkit.fluxcd.io/v2alpha1.HelmRelease">HelmRelease</a>)
|
||||
<a href="#helm.toolkit.fluxcd.io/v2beta1.HelmRelease">HelmRelease</a>)
|
||||
</p>
|
||||
<p>HelmReleaseSpec defines the desired state of a Helm release.</p>
|
||||
<div class="md-typeset__scrollwrap">
|
||||
|
@ -579,13 +579,13 @@ relative path in the SourceRef. Ignored when omitted.</p>
|
|||
<td>
|
||||
<code>chart</code><br>
|
||||
<em>
|
||||
<a href="#helm.toolkit.fluxcd.io/v2alpha1.HelmChartTemplate">
|
||||
<a href="#helm.toolkit.fluxcd.io/v2beta1.HelmChartTemplate">
|
||||
HelmChartTemplate
|
||||
</a>
|
||||
</em>
|
||||
</td>
|
||||
<td>
|
||||
<p>Chart defines the template of the v1alpha1.HelmChart that should be created
|
||||
<p>Chart defines the template of the v1beta1.HelmChart that should be created
|
||||
for this HelmRelease.</p>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -689,7 +689,7 @@ Use ‘0’ for an unlimited number of revisions; defaults to ‘10&
|
|||
<td>
|
||||
<code>install</code><br>
|
||||
<em>
|
||||
<a href="#helm.toolkit.fluxcd.io/v2alpha1.Install">
|
||||
<a href="#helm.toolkit.fluxcd.io/v2beta1.Install">
|
||||
Install
|
||||
</a>
|
||||
</em>
|
||||
|
@ -703,7 +703,7 @@ Install
|
|||
<td>
|
||||
<code>upgrade</code><br>
|
||||
<em>
|
||||
<a href="#helm.toolkit.fluxcd.io/v2alpha1.Upgrade">
|
||||
<a href="#helm.toolkit.fluxcd.io/v2beta1.Upgrade">
|
||||
Upgrade
|
||||
</a>
|
||||
</em>
|
||||
|
@ -717,7 +717,7 @@ Upgrade
|
|||
<td>
|
||||
<code>test</code><br>
|
||||
<em>
|
||||
<a href="#helm.toolkit.fluxcd.io/v2alpha1.Test">
|
||||
<a href="#helm.toolkit.fluxcd.io/v2beta1.Test">
|
||||
Test
|
||||
</a>
|
||||
</em>
|
||||
|
@ -731,7 +731,7 @@ Test
|
|||
<td>
|
||||
<code>rollback</code><br>
|
||||
<em>
|
||||
<a href="#helm.toolkit.fluxcd.io/v2alpha1.Rollback">
|
||||
<a href="#helm.toolkit.fluxcd.io/v2beta1.Rollback">
|
||||
Rollback
|
||||
</a>
|
||||
</em>
|
||||
|
@ -745,7 +745,7 @@ Rollback
|
|||
<td>
|
||||
<code>uninstall</code><br>
|
||||
<em>
|
||||
<a href="#helm.toolkit.fluxcd.io/v2alpha1.Uninstall">
|
||||
<a href="#helm.toolkit.fluxcd.io/v2beta1.Uninstall">
|
||||
Uninstall
|
||||
</a>
|
||||
</em>
|
||||
|
@ -759,7 +759,7 @@ Uninstall
|
|||
<td>
|
||||
<code>valuesFrom</code><br>
|
||||
<em>
|
||||
<a href="#helm.toolkit.fluxcd.io/v2alpha1.ValuesReference">
|
||||
<a href="#helm.toolkit.fluxcd.io/v2beta1.ValuesReference">
|
||||
[]ValuesReference
|
||||
</a>
|
||||
</em>
|
||||
|
@ -787,11 +787,11 @@ Kubernetes pkg/apis/apiextensions/v1.JSON
|
|||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<h3 id="helm.toolkit.fluxcd.io/v2alpha1.HelmReleaseStatus">HelmReleaseStatus
|
||||
<h3 id="helm.toolkit.fluxcd.io/v2beta1.HelmReleaseStatus">HelmReleaseStatus
|
||||
</h3>
|
||||
<p>
|
||||
(<em>Appears on:</em>
|
||||
<a href="#helm.toolkit.fluxcd.io/v2alpha1.HelmRelease">HelmRelease</a>)
|
||||
<a href="#helm.toolkit.fluxcd.io/v2beta1.HelmRelease">HelmRelease</a>)
|
||||
</p>
|
||||
<p>HelmReleaseStatus defines the observed state of a HelmRelease.</p>
|
||||
<div class="md-typeset__scrollwrap">
|
||||
|
@ -948,11 +948,11 @@ state. It is reset after a successful reconciliation.</p>
|
|||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<h3 id="helm.toolkit.fluxcd.io/v2alpha1.Install">Install
|
||||
<h3 id="helm.toolkit.fluxcd.io/v2beta1.Install">Install
|
||||
</h3>
|
||||
<p>
|
||||
(<em>Appears on:</em>
|
||||
<a href="#helm.toolkit.fluxcd.io/v2alpha1.HelmReleaseSpec">HelmReleaseSpec</a>)
|
||||
<a href="#helm.toolkit.fluxcd.io/v2beta1.HelmReleaseSpec">HelmReleaseSpec</a>)
|
||||
</p>
|
||||
<p>Install holds the configuration for Helm install actions performed for this
|
||||
HelmRelease.</p>
|
||||
|
@ -986,7 +986,7 @@ Jobs for hooks) during the performance of a Helm install action. Defaults to
|
|||
<td>
|
||||
<code>remediation</code><br>
|
||||
<em>
|
||||
<a href="#helm.toolkit.fluxcd.io/v2alpha1.InstallRemediation">
|
||||
<a href="#helm.toolkit.fluxcd.io/v2beta1.InstallRemediation">
|
||||
InstallRemediation
|
||||
</a>
|
||||
</em>
|
||||
|
@ -1065,11 +1065,11 @@ CRDs are installed if not already present.</p>
|
|||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<h3 id="helm.toolkit.fluxcd.io/v2alpha1.InstallRemediation">InstallRemediation
|
||||
<h3 id="helm.toolkit.fluxcd.io/v2beta1.InstallRemediation">InstallRemediation
|
||||
</h3>
|
||||
<p>
|
||||
(<em>Appears on:</em>
|
||||
<a href="#helm.toolkit.fluxcd.io/v2alpha1.Install">Install</a>)
|
||||
<a href="#helm.toolkit.fluxcd.io/v2beta1.Install">Install</a>)
|
||||
</p>
|
||||
<p>InstallRemediation holds the configuration for Helm install remediation.</p>
|
||||
<div class="md-typeset__scrollwrap">
|
||||
|
@ -1127,23 +1127,23 @@ no retries remain. Defaults to ‘false’.</p>
|
|||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<h3 id="helm.toolkit.fluxcd.io/v2alpha1.Remediation">Remediation
|
||||
<h3 id="helm.toolkit.fluxcd.io/v2beta1.Remediation">Remediation
|
||||
</h3>
|
||||
<p>Remediation defines a consistent interface for InstallRemediation and
|
||||
UpgradeRemediation.</p>
|
||||
<h3 id="helm.toolkit.fluxcd.io/v2alpha1.RemediationStrategy">RemediationStrategy
|
||||
<h3 id="helm.toolkit.fluxcd.io/v2beta1.RemediationStrategy">RemediationStrategy
|
||||
(<code>string</code> alias)</h3>
|
||||
<p>
|
||||
(<em>Appears on:</em>
|
||||
<a href="#helm.toolkit.fluxcd.io/v2alpha1.UpgradeRemediation">UpgradeRemediation</a>)
|
||||
<a href="#helm.toolkit.fluxcd.io/v2beta1.UpgradeRemediation">UpgradeRemediation</a>)
|
||||
</p>
|
||||
<p>RemediationStrategy returns the strategy to use to remediate a failed install
|
||||
or upgrade.</p>
|
||||
<h3 id="helm.toolkit.fluxcd.io/v2alpha1.Rollback">Rollback
|
||||
<h3 id="helm.toolkit.fluxcd.io/v2beta1.Rollback">Rollback
|
||||
</h3>
|
||||
<p>
|
||||
(<em>Appears on:</em>
|
||||
<a href="#helm.toolkit.fluxcd.io/v2alpha1.HelmReleaseSpec">HelmReleaseSpec</a>)
|
||||
<a href="#helm.toolkit.fluxcd.io/v2beta1.HelmReleaseSpec">HelmReleaseSpec</a>)
|
||||
</p>
|
||||
<p>Rollback holds the configuration for Helm rollback actions for this
|
||||
HelmRelease.</p>
|
||||
|
@ -1239,11 +1239,11 @@ rollback action when it fails.</p>
|
|||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<h3 id="helm.toolkit.fluxcd.io/v2alpha1.Test">Test
|
||||
<h3 id="helm.toolkit.fluxcd.io/v2beta1.Test">Test
|
||||
</h3>
|
||||
<p>
|
||||
(<em>Appears on:</em>
|
||||
<a href="#helm.toolkit.fluxcd.io/v2alpha1.HelmReleaseSpec">HelmReleaseSpec</a>)
|
||||
<a href="#helm.toolkit.fluxcd.io/v2beta1.HelmReleaseSpec">HelmReleaseSpec</a>)
|
||||
</p>
|
||||
<p>Test holds the configuration for Helm test actions for this HelmRelease.</p>
|
||||
<div class="md-typeset__scrollwrap">
|
||||
|
@ -1302,11 +1302,11 @@ actions in ‘Install.IgnoreTestFailures’ and ‘Upgrade.IgnoreTes
|
|||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<h3 id="helm.toolkit.fluxcd.io/v2alpha1.Uninstall">Uninstall
|
||||
<h3 id="helm.toolkit.fluxcd.io/v2beta1.Uninstall">Uninstall
|
||||
</h3>
|
||||
<p>
|
||||
(<em>Appears on:</em>
|
||||
<a href="#helm.toolkit.fluxcd.io/v2alpha1.HelmReleaseSpec">HelmReleaseSpec</a>)
|
||||
<a href="#helm.toolkit.fluxcd.io/v2beta1.HelmReleaseSpec">HelmReleaseSpec</a>)
|
||||
</p>
|
||||
<p>Uninstall holds the configuration for Helm uninstall actions for this
|
||||
HelmRelease.</p>
|
||||
|
@ -1365,11 +1365,11 @@ release as deleted, but retain the release history.</p>
|
|||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<h3 id="helm.toolkit.fluxcd.io/v2alpha1.Upgrade">Upgrade
|
||||
<h3 id="helm.toolkit.fluxcd.io/v2beta1.Upgrade">Upgrade
|
||||
</h3>
|
||||
<p>
|
||||
(<em>Appears on:</em>
|
||||
<a href="#helm.toolkit.fluxcd.io/v2alpha1.HelmReleaseSpec">HelmReleaseSpec</a>)
|
||||
<a href="#helm.toolkit.fluxcd.io/v2beta1.HelmReleaseSpec">HelmReleaseSpec</a>)
|
||||
</p>
|
||||
<p>Upgrade holds the configuration for Helm upgrade actions for this
|
||||
HelmRelease.</p>
|
||||
|
@ -1403,7 +1403,7 @@ Jobs for hooks) during the performance of a Helm upgrade action. Defaults to
|
|||
<td>
|
||||
<code>remediation</code><br>
|
||||
<em>
|
||||
<a href="#helm.toolkit.fluxcd.io/v2alpha1.UpgradeRemediation">
|
||||
<a href="#helm.toolkit.fluxcd.io/v2beta1.UpgradeRemediation">
|
||||
UpgradeRemediation
|
||||
</a>
|
||||
</em>
|
||||
|
@ -1495,11 +1495,11 @@ upgrade action when it fails.</p>
|
|||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<h3 id="helm.toolkit.fluxcd.io/v2alpha1.UpgradeRemediation">UpgradeRemediation
|
||||
<h3 id="helm.toolkit.fluxcd.io/v2beta1.UpgradeRemediation">UpgradeRemediation
|
||||
</h3>
|
||||
<p>
|
||||
(<em>Appears on:</em>
|
||||
<a href="#helm.toolkit.fluxcd.io/v2alpha1.Upgrade">Upgrade</a>)
|
||||
<a href="#helm.toolkit.fluxcd.io/v2beta1.Upgrade">Upgrade</a>)
|
||||
</p>
|
||||
<p>UpgradeRemediation holds the configuration for Helm upgrade remediation.</p>
|
||||
<div class="md-typeset__scrollwrap">
|
||||
|
@ -1557,7 +1557,7 @@ no retries remain. Defaults to ‘false’ unless ‘Retries’
|
|||
<td>
|
||||
<code>strategy</code><br>
|
||||
<em>
|
||||
<a href="#helm.toolkit.fluxcd.io/v2alpha1.RemediationStrategy">
|
||||
<a href="#helm.toolkit.fluxcd.io/v2beta1.RemediationStrategy">
|
||||
RemediationStrategy
|
||||
</a>
|
||||
</em>
|
||||
|
@ -1571,11 +1571,11 @@ RemediationStrategy
|
|||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<h3 id="helm.toolkit.fluxcd.io/v2alpha1.ValuesReference">ValuesReference
|
||||
<h3 id="helm.toolkit.fluxcd.io/v2beta1.ValuesReference">ValuesReference
|
||||
</h3>
|
||||
<p>
|
||||
(<em>Appears on:</em>
|
||||
<a href="#helm.toolkit.fluxcd.io/v2alpha1.HelmReleaseSpec">HelmReleaseSpec</a>)
|
||||
<a href="#helm.toolkit.fluxcd.io/v2beta1.HelmReleaseSpec">HelmReleaseSpec</a>)
|
||||
</p>
|
||||
<p>ValuesReference contains a reference to a resource containing Helm values,
|
||||
and optionally the key they can be found at.</p>
|
||||
|
|
|
@ -50,7 +50,7 @@ trigger a Helm uninstall.
|
|||
Alerting can be configured with a Kubernetes custom resource that specifies a webhook address, and a
|
||||
group of `HelmRelease` resources to be monitored using the [notification-controller](https://github.com/fluxcd/notification-controller).
|
||||
|
||||
The API design of the controller can be found at [helm.toolkit.fluxcd.io/v2alpha1](./v2alpha1/helmreleases.md).
|
||||
The API design of the controller can be found at [helm.toolkit.fluxcd.io/v2beta1](./v2beta1/helmreleases.md).
|
||||
|
||||
## Backward compatibility
|
||||
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
# helm.toolkit.fluxcd.io/v2beta1
|
||||
|
||||
This is the v2beta1 API specification for declaratively managing Helm chart releases with
|
||||
Kubernetes manifests.
|
||||
|
||||
## Specification
|
||||
|
||||
- [`HelmRelease` CRD](helmreleases.md)
|
||||
+ [Specification](helmreleases.md#specification)
|
||||
* [Reference types](helmreleases.md#reference-types)
|
||||
* [Status specification](helmreleases.md#status-specification)
|
||||
+ [Helm release placement](helmreleases.md#helm-release-placement)
|
||||
+ [Helm chart template](helmreleases.md#helm-chart-template)
|
||||
+ [Values overrides](helmreleases.md#values-overrides)
|
||||
+ [Reconciliation](helmreleases.md#reconciliation)
|
||||
* [Disabling resource waiting](helmreleases.md#disabling-resource-waiting)
|
||||
* [`HelmRelease` dependencies](helmreleases.md#helmrelease-dependencies)
|
||||
* [Configuring Helm test actions](helmreleases.md#configuring-helm-test-actions)
|
||||
* [Configuring failure remediation](helmreleases.md#configuring-failure-remediation)
|
||||
+ [Status](helmreleases.md#status)
|
||||
|
||||
## Implementation
|
||||
|
||||
* [helm-controller](https://github.com/fluxcd/helm-controller/)
|
|
@ -0,0 +1,900 @@
|
|||
# Helm Releases
|
||||
|
||||
The `HelmRelease` API defines a resource for automated controller driven Helm releases.
|
||||
|
||||
## Specification
|
||||
|
||||
A **helmrelease** object defines a resource for controller driven reconciliation
|
||||
of Helm releases via Helm actions such as install, upgrade, test, uninstall, and rollback.
|
||||
This includes release placement (namespace/name), release content (chart/values overrides),
|
||||
action trigger configuration, individual action configuration, and statusing.
|
||||
|
||||
```go
|
||||
// HelmReleaseSpec defines the desired state of a Helm Release.
|
||||
type HelmReleaseSpec struct {
|
||||
// Chart defines the template of the v1beta1.HelmChart that should be created
|
||||
// for this HelmRelease.
|
||||
// +required
|
||||
Chart HelmChartTemplate `json:"chart"`
|
||||
|
||||
// Interval at which to reconcile the Helm release.
|
||||
// +required
|
||||
Interval metav1.Duration `json:"interval"`
|
||||
|
||||
// Suspend tells the controller to suspend reconciliation for this HelmRelease,
|
||||
// it does not apply to already started reconciliations. Defaults to false.
|
||||
// +optional
|
||||
Suspend bool `json:"suspend,omitempty"`
|
||||
|
||||
// ReleaseName used for the Helm release. Defaults to a composition of
|
||||
// '[TargetNamespace-]Name'.
|
||||
// +kubebuilder:validation:MinLength=1
|
||||
// +kubebuilder:validation:MaxLength=53
|
||||
// +kubebuilder:validation:Optional
|
||||
// +optional
|
||||
ReleaseName string `json:"releaseName,omitempty"`
|
||||
|
||||
// TargetNamespace to target when performing operations for the HelmRelease.
|
||||
// Defaults to the namespace of the HelmRelease.
|
||||
// +kubebuilder:validation:MinLength=1
|
||||
// +kubebuilder:validation:MaxLength=63
|
||||
// +kubebuilder:validation:Optional
|
||||
// +optional
|
||||
TargetNamespace string `json:"targetNamespace,omitempty"`
|
||||
|
||||
// DependsOn may contain a dependency.CrossNamespaceDependencyReference slice with
|
||||
// references to HelmRelease resources that must be ready before this HelmRelease
|
||||
// can be reconciled.
|
||||
// +optional
|
||||
DependsOn []dependency.CrossNamespaceDependencyReference `json:"dependsOn,omitempty"`
|
||||
|
||||
// Timeout is the time to wait for any individual Kubernetes operation (like Jobs
|
||||
// for hooks) during the performance of a Helm action. Defaults to '5m0s'.
|
||||
// +optional
|
||||
Timeout *metav1.Duration `json:"timeout,omitempty"`
|
||||
|
||||
// MaxHistory is the number of revisions saved by Helm for this HelmRelease.
|
||||
// Use '0' for an unlimited number of revisions; defaults to '10'.
|
||||
// +optional
|
||||
MaxHistory *int `json:"maxHistory,omitempty"`
|
||||
|
||||
// Install holds the configuration for Helm install actions for this HelmRelease.
|
||||
// +optional
|
||||
Install *Install `json:"install,omitempty"`
|
||||
|
||||
// Upgrade holds the configuration for Helm upgrade actions for this HelmRelease.
|
||||
// +optional
|
||||
Upgrade *Upgrade `json:"upgrade,omitempty"`
|
||||
|
||||
// Test holds the configuration for Helm test actions for this HelmRelease.
|
||||
// +optional
|
||||
Test *Test `json:"test,omitempty"`
|
||||
|
||||
// Rollback holds the configuration for Helm rollback actions for this HelmRelease.
|
||||
// +optional
|
||||
Rollback *Rollback `json:"rollback,omitempty"`
|
||||
|
||||
// Uninstall holds the configuration for Helm uninstall actions for this HelmRelease.
|
||||
// +optional
|
||||
Uninstall *Uninstall `json:"uninstall,omitempty"`
|
||||
|
||||
// ValuesFrom holds references to resources containing Helm values for this HelmRelease,
|
||||
// and information about how they should be merged.
|
||||
ValuesFrom []ValuesReference `json:"valuesFrom,omitempty"`
|
||||
|
||||
// Values holds the values for this Helm release.
|
||||
// +optional
|
||||
Values *apiextensionsv1.JSON `json:"values,omitempty"`
|
||||
}
|
||||
|
||||
// HelmChartTemplate defines the template from which the controller will
|
||||
// generate a v1beta1.HelmChart object in the same namespace as the referenced
|
||||
// v1beta1.Source.
|
||||
type HelmChartTemplate struct {
|
||||
// Spec holds the template for the v1beta1.HelmChartSpec for this HelmRelease.
|
||||
// +required
|
||||
Spec HelmChartTemplateSpec `json:"spec"`
|
||||
}
|
||||
|
||||
// HelmChartTemplateSpec defines the template from which the controller will
|
||||
// generate a v1beta1.HelmChartSpec object.
|
||||
type HelmChartTemplateSpec struct {
|
||||
// The name or path the Helm chart is available at in the SourceRef.
|
||||
// +required
|
||||
Chart string `json:"chart"`
|
||||
|
||||
// Version semver expression, ignored for charts from v1beta1.GitRepository and
|
||||
// v1beta1.Bucket sources. Defaults to latest when omitted.
|
||||
// +optional
|
||||
Version string `json:"version,omitempty"`
|
||||
|
||||
// The name and namespace of the v1beta1.Source the chart is available at.
|
||||
// +required
|
||||
SourceRef CrossNamespaceObjectReference `json:"sourceRef"`
|
||||
|
||||
// Interval at which to check the v1beta1.Source for updates. Defaults to
|
||||
// 'HelmReleaseSpec.Interval'.
|
||||
// +optional
|
||||
Interval *metav1.Duration `json:"interval,omitempty"`
|
||||
|
||||
// Alternative values file to use as the default chart values, expected to be a
|
||||
// relative path in the SourceRef. Ignored when omitted.
|
||||
// +optional
|
||||
ValuesFile string `json:"valuesFile,omitempty"`
|
||||
}
|
||||
|
||||
// Install holds the configuration for Helm install actions performed for this
|
||||
// HelmRelease.
|
||||
type Install struct {
|
||||
// Timeout is the time to wait for any individual Kubernetes operation (like
|
||||
// Jobs for hooks) during the performance of a Helm install action. Defaults to
|
||||
// 'HelmReleaseSpec.Timeout'.
|
||||
// +optional
|
||||
Timeout *metav1.Duration `json:"timeout,omitempty"`
|
||||
|
||||
// Remediation holds the remediation configuration for when the Helm install
|
||||
// action for the HelmRelease fails. The default is to not perform any action.
|
||||
// +optional
|
||||
Remediation *InstallRemediation `json:"remediation,omitempty"`
|
||||
|
||||
// DisableWait disables the waiting for resources to be ready after a Helm
|
||||
// install has been performed.
|
||||
// +optional
|
||||
DisableWait bool `json:"disableWait,omitempty"`
|
||||
|
||||
// DisableHooks prevents hooks from running during the Helm install action.
|
||||
// +optional
|
||||
DisableHooks bool `json:"disableHooks,omitempty"`
|
||||
|
||||
// DisableOpenAPIValidation prevents the Helm install action from validating
|
||||
// rendered templates against the Kubernetes OpenAPI Schema.
|
||||
// +optional
|
||||
DisableOpenAPIValidation bool `json:"disableOpenAPIValidation,omitempty"`
|
||||
|
||||
// Replace tells the Helm install action to re-use the 'ReleaseName', but only
|
||||
// if that name is a deleted release which remains in the history.
|
||||
// +optional
|
||||
Replace bool `json:"replace,omitempty"`
|
||||
|
||||
// SkipCRDs tells the Helm install action to not install any CRDs. By default,
|
||||
// CRDs are installed if not already present.
|
||||
// +optional
|
||||
SkipCRDs bool `json:"skipCRDs,omitempty"`
|
||||
}
|
||||
|
||||
// InstallRemediation holds the configuration for Helm install remediation.
|
||||
type InstallRemediation struct {
|
||||
// Retries is the number of retries that should be attempted on failures before
|
||||
// bailing. Remediation, using an uninstall, is performed between each attempt.
|
||||
// Defaults to '0', a negative integer equals to unlimited retries.
|
||||
// +optional
|
||||
Retries int `json:"retries,omitempty"`
|
||||
|
||||
// IgnoreTestFailures tells the controller to skip remediation when the Helm
|
||||
// tests are run after an install action but fail. Defaults to
|
||||
// 'Test.IgnoreFailures'.
|
||||
// +optional
|
||||
IgnoreTestFailures *bool `json:"ignoreTestFailures,omitempty"`
|
||||
|
||||
// RemediateLastFailure tells the controller to remediate the last failure, when
|
||||
// no retries remain. Defaults to 'false'.
|
||||
// +optional
|
||||
RemediateLastFailure *bool `json:"remediateLastFailure,omitempty"`
|
||||
}
|
||||
|
||||
// Upgrade holds the configuration for Helm upgrade actions for this
|
||||
// HelmRelease.
|
||||
type Upgrade struct {
|
||||
// Timeout is the time to wait for any individual Kubernetes operation (like
|
||||
// Jobs for hooks) during the performance of a Helm upgrade action. Defaults to
|
||||
// 'HelmReleaseSpec.Timeout'.
|
||||
// +optional
|
||||
Timeout *metav1.Duration `json:"timeout,omitempty"`
|
||||
|
||||
// Remediation holds the remediation configuration for when the Helm upgrade
|
||||
// action for the HelmRelease fails. The default is to not perform any action.
|
||||
// +optional
|
||||
Remediation *UpgradeRemediation `json:"remediation,omitempty"`
|
||||
|
||||
// DisableWait disables the waiting for resources to be ready after a Helm
|
||||
// upgrade has been performed.
|
||||
// +optional
|
||||
DisableWait bool `json:"disableWait,omitempty"`
|
||||
|
||||
// DisableHooks prevents hooks from running during the Helm upgrade action.
|
||||
// +optional
|
||||
DisableHooks bool `json:"disableHooks,omitempty"`
|
||||
|
||||
// DisableOpenAPIValidation prevents the Helm upgrade action from validating
|
||||
// rendered templates against the Kubernetes OpenAPI Schema.
|
||||
// +optional
|
||||
DisableOpenAPIValidation bool `json:"disableOpenAPIValidation,omitempty"`
|
||||
|
||||
// Force forces resource updates through a replacement strategy.
|
||||
// +optional
|
||||
Force bool `json:"force,omitempty"`
|
||||
|
||||
// PreserveValues will make Helm reuse the last release's values and merge in
|
||||
// overrides from 'Values'. Setting this flag makes the HelmRelease
|
||||
// non-declarative.
|
||||
// +optional
|
||||
PreserveValues bool `json:"preserveValues,omitempty"`
|
||||
|
||||
// CleanupOnFail allows deletion of new resources created during the Helm
|
||||
// upgrade action when it fails.
|
||||
// +optional
|
||||
CleanupOnFail bool `json:"cleanupOnFail,omitempty"`
|
||||
}
|
||||
|
||||
// UpgradeRemediation holds the configuration for Helm upgrade remediation.
|
||||
type UpgradeRemediation struct {
|
||||
// Retries is the number of retries that should be attempted on failures before
|
||||
// bailing. Remediation, using 'Strategy', is performed between each attempt.
|
||||
// Defaults to '0', a negative integer equals to unlimited retries.
|
||||
// +optional
|
||||
Retries int `json:"retries,omitempty"`
|
||||
|
||||
// IgnoreTestFailures tells the controller to skip remediation when the Helm
|
||||
// tests are run after an upgrade action but fail.
|
||||
// Defaults to 'Test.IgnoreFailures'.
|
||||
// +optional
|
||||
IgnoreTestFailures *bool `json:"ignoreTestFailures,omitempty"`
|
||||
|
||||
// RemediateLastFailure tells the controller to remediate the last failure, when
|
||||
// no retries remain. Defaults to 'false' unless 'Retries' is greater than 0.
|
||||
// +optional
|
||||
RemediateLastFailure *bool `json:"remediateLastFailure,omitempty"`
|
||||
|
||||
// Strategy to use for failure remediation. Defaults to 'rollback'.
|
||||
// +kubebuilder:validation:Enum=rollback;uninstall
|
||||
// +optional
|
||||
Strategy *RemediationStrategy `json:"strategy,omitempty"`
|
||||
}
|
||||
|
||||
// Test holds the configuration for Helm test actions for this HelmRelease.
|
||||
type Test struct {
|
||||
// Enable enables Helm test actions for this HelmRelease after an Helm install
|
||||
// or upgrade action has been performed.
|
||||
// +optional
|
||||
Enable bool `json:"enable,omitempty"`
|
||||
|
||||
// Timeout is the time to wait for any individual Kubernetes operation during
|
||||
// the performance of a Helm test action. Defaults to 'HelmReleaseSpec.Timeout'.
|
||||
// +optional
|
||||
Timeout *metav1.Duration `json:"timeout,omitempty"`
|
||||
|
||||
// IgnoreFailures tells the controller to skip remediation when the Helm tests
|
||||
// are run but fail. Can be overwritten for tests run after install or upgrade
|
||||
// actions in 'Install.IgnoreTestFailures' and 'Upgrade.IgnoreTestFailures'.
|
||||
// +optional
|
||||
IgnoreFailures bool `json:"ignoreFailures,omitempty"`
|
||||
}
|
||||
|
||||
// Rollback holds the configuration for Helm rollback actions for this
|
||||
// HelmRelease.
|
||||
type Rollback struct {
|
||||
// Timeout is the time to wait for any individual Kubernetes operation (like
|
||||
// Jobs for hooks) during the performance of a Helm rollback action. Defaults to
|
||||
// 'HelmReleaseSpec.Timeout'.
|
||||
// +optional
|
||||
Timeout *metav1.Duration `json:"timeout,omitempty"`
|
||||
|
||||
// DisableWait disables the waiting for resources to be ready after a Helm
|
||||
// rollback has been performed.
|
||||
// +optional
|
||||
DisableWait bool `json:"disableWait,omitempty"`
|
||||
|
||||
// DisableHooks prevents hooks from running during the Helm rollback action.
|
||||
// +optional
|
||||
DisableHooks bool `json:"disableHooks,omitempty"`
|
||||
|
||||
// Recreate performs pod restarts for the resource if applicable.
|
||||
// +optional
|
||||
Recreate bool `json:"recreate,omitempty"`
|
||||
|
||||
// Force forces resource updates through a replacement strategy.
|
||||
// +optional
|
||||
Force bool `json:"force,omitempty"`
|
||||
|
||||
// CleanupOnFail allows deletion of new resources created during the Helm
|
||||
// rollback action when it fails.
|
||||
// +optional
|
||||
CleanupOnFail bool `json:"cleanupOnFail,omitempty"`
|
||||
}
|
||||
|
||||
// Uninstall holds the configuration for Helm uninstall actions for this
|
||||
// HelmRelease.
|
||||
type Uninstall struct {
|
||||
// Timeout is the time to wait for any individual Kubernetes operation (like
|
||||
// Jobs for hooks) during the performance of a Helm uninstall action. Defaults
|
||||
// to 'HelmReleaseSpec.Timeout'.
|
||||
// +optional
|
||||
Timeout *metav1.Duration `json:"timeout,omitempty"`
|
||||
|
||||
// DisableHooks prevents hooks from running during the Helm rollback action.
|
||||
// +optional
|
||||
DisableHooks bool `json:"disableHooks,omitempty"`
|
||||
|
||||
// KeepHistory tells Helm to remove all associated resources and mark the
|
||||
// release as deleted, but retain the release history.
|
||||
// +optional
|
||||
KeepHistory bool `json:"keepHistory,omitempty"`
|
||||
}
|
||||
```
|
||||
|
||||
### Reference types
|
||||
|
||||
```go
|
||||
// CrossNamespaceObjectReference contains enough information to let you locate the
|
||||
// typed referenced object at cluster level.
|
||||
type CrossNamespaceObjectReference struct {
|
||||
// APIVersion of the referent.
|
||||
// +optional
|
||||
APIVersion string `json:"apiVersion,omitempty"`
|
||||
|
||||
// Kind of the referent.
|
||||
// +kubebuilder:validation:Enum=HelmRepository
|
||||
// +required
|
||||
Kind string `json:"kind,omitempty"`
|
||||
|
||||
// Name of the referent.
|
||||
// +kubebuilder:validation:MinLength=1
|
||||
// +kubebuilder:validation:MaxLength=253
|
||||
// +required
|
||||
Name string `json:"name"`
|
||||
|
||||
// Namespace of the referent.
|
||||
// +kubebuilder:validation:MinLength=1
|
||||
// +kubebuilder:validation:MaxLength=63
|
||||
// +kubebuilder:validation:Optional
|
||||
// +optional
|
||||
Namespace string `json:"namespace,omitempty"`
|
||||
}
|
||||
|
||||
// ValuesReference contains a reference to a resource containing Helm values,
|
||||
// and optionally the key they can be found at.
|
||||
type ValuesReference struct {
|
||||
// Kind of the values referent, valid values are ('Secret', 'ConfigMap').
|
||||
// +kubebuilder:validation:Enum=Secret;ConfigMap
|
||||
// +required
|
||||
Kind string `json:"kind"`
|
||||
|
||||
// Name of the values referent. Should reside in the same namespace as the
|
||||
// referring resource.
|
||||
// +kubebuilder:validation:MinLength=1
|
||||
// +kubebuilder:validation:MaxLength=253
|
||||
// +required
|
||||
Name string `json:"name"`
|
||||
|
||||
// ValuesKey is the data key where the values.yaml or a specific value can be
|
||||
// found at. Defaults to 'values.yaml'.
|
||||
// +optional
|
||||
ValuesKey string `json:"valuesKey,omitempty"`
|
||||
|
||||
// TargetPath is the YAML dot notation path the value should be merged at. When
|
||||
// set, the ValuesKey is expected to be a single flat value. Defaults to 'None',
|
||||
// which results in the values getting merged at the root.
|
||||
// +optional
|
||||
TargetPath string `json:"targetPath,omitempty"`
|
||||
|
||||
// Optional marks this ValuesReference as optional. When set, a not found error
|
||||
// for the values reference is ignored, but any ValuesKey, TargetPath or
|
||||
// transient error will still result in a reconciliation failure.
|
||||
// +optional
|
||||
Optional bool `json:"optional,omitempty"`
|
||||
}
|
||||
```
|
||||
|
||||
### Status specification
|
||||
|
||||
```go
|
||||
// HelmReleaseStatus defines the observed state of a HelmRelease.
|
||||
type HelmReleaseStatus struct {
|
||||
// ObservedGeneration is the last observed generation.
|
||||
// +optional
|
||||
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
|
||||
|
||||
// LastHandledReconcileAt is the last manual reconciliation request (by
|
||||
// annotating the HelmRelease) handled by the reconciler.
|
||||
// +optional
|
||||
LastHandledReconcileAt string `json:"lastHandledReconcileAt,omitempty"`
|
||||
|
||||
// Conditions holds the conditions for the HelmRelease.
|
||||
// +optional
|
||||
Conditions []meta.Condition `json:"conditions,omitempty"`
|
||||
|
||||
// LastAppliedRevision is the revision of the last successfully applied source.
|
||||
// +optional
|
||||
LastAppliedRevision string `json:"lastAppliedRevision,omitempty"`
|
||||
|
||||
// LastAttemptedRevision is the revision of the last reconciliation attempt.
|
||||
// +optional
|
||||
LastAttemptedRevision string `json:"lastAttemptedRevision,omitempty"`
|
||||
|
||||
// LastAttemptedValuesChecksum is the SHA1 checksum of the values of the last
|
||||
// reconciliation attempt.
|
||||
// +optional
|
||||
LastAttemptedValuesChecksum string `json:"lastAttemptedValuesChecksum,omitempty"`
|
||||
|
||||
// LastReleaseRevision is the revision of the last successful Helm release.
|
||||
// +optional
|
||||
LastReleaseRevision int `json:"lastReleaseRevision,omitempty"`
|
||||
|
||||
// HelmChart is the namespaced name of the HelmChart resource created by
|
||||
// the controller for the HelmRelease.
|
||||
// +optional
|
||||
HelmChart string `json:"helmChart,omitempty"`
|
||||
|
||||
// Failures is the reconciliation failure count against the latest observed
|
||||
// state. It is reset after a successful reconciliation.
|
||||
// +optional
|
||||
Failures int64 `json:"failures,omitempty"`
|
||||
|
||||
// InstallFailures is the install failure count against the latest observed
|
||||
// state. It is reset after a successful reconciliation.
|
||||
// +optional
|
||||
InstallFailures int64 `json:"installFailures,omitempty"`
|
||||
|
||||
// UpgradeFailures is the upgrade failure count against the latest observed
|
||||
// state. It is reset after a successful reconciliation.
|
||||
// +optional
|
||||
UpgradeFailures int64 `json:"upgradeFailures,omitempty"`
|
||||
}
|
||||
```
|
||||
|
||||
#### Condition types
|
||||
|
||||
```go
|
||||
const (
|
||||
// ReleasedCondition represents the status of the last release attempt
|
||||
// (install/upgrade/test) against the latest desired state.
|
||||
ReleasedCondition string = "Released"
|
||||
|
||||
// TestSuccessCondition represents the status of the last test attempt against
|
||||
// the latest desired state.
|
||||
TestSuccessCondition string = "TestSuccess"
|
||||
|
||||
// RemediatedCondition represents the status of the last remediation attempt
|
||||
// (uninstall/rollback) due to a failure of the last release attempt against the
|
||||
// latest desired state.
|
||||
RemediatedCondition string = "Remediated"
|
||||
)
|
||||
```
|
||||
|
||||
#### Condition reasons
|
||||
|
||||
```go
|
||||
const (
|
||||
// InstallSucceededReason represents the fact that the Helm install for the
|
||||
// HelmRelease succeeded.
|
||||
InstallSucceededReason string = "InstallSucceeded"
|
||||
|
||||
// InstallFailedReason represents the fact that the Helm install for the
|
||||
// HelmRelease failed.
|
||||
InstallFailedReason string = "InstallFailed"
|
||||
|
||||
// UpgradeSucceededReason represents the fact that the Helm upgrade for the
|
||||
// HelmRelease succeeded.
|
||||
UpgradeSucceededReason string = "UpgradeSucceeded"
|
||||
|
||||
// UpgradeFailedReason represents the fact that the Helm upgrade for the
|
||||
// HelmRelease failed.
|
||||
UpgradeFailedReason string = "UpgradeFailed"
|
||||
|
||||
// TestSucceededReason represents the fact that the Helm tests for the
|
||||
// HelmRelease succeeded.
|
||||
TestSucceededReason string = "TestSucceeded"
|
||||
|
||||
// TestFailedReason represents the fact that the Helm tests for the HelmRelease
|
||||
// failed.
|
||||
TestFailedReason string = "TestFailed"
|
||||
|
||||
// RollbackSucceededReason represents the fact that the Helm rollback for the
|
||||
// HelmRelease succeeded.
|
||||
RollbackSucceededReason string = "RollbackSucceeded"
|
||||
|
||||
// RollbackFailedReason represents the fact that the Helm test for the
|
||||
// HelmRelease failed.
|
||||
RollbackFailedReason string = "RollbackFailed"
|
||||
|
||||
// UninstallSucceededReason represents the fact that the Helm uninstall for the
|
||||
// HelmRelease succeeded.
|
||||
UninstallSucceededReason string = "UninstallSucceeded"
|
||||
|
||||
// UninstallFailedReason represents the fact that the Helm uninstall for the
|
||||
// HelmRelease failed.
|
||||
UninstallFailedReason string = "UninstallFailed"
|
||||
|
||||
// ArtifactFailedReason represents the fact that the artifact download for the
|
||||
// HelmRelease failed.
|
||||
ArtifactFailedReason string = "ArtifactFailed"
|
||||
|
||||
// InitFailedReason represents the fact that the initialization of the Helm
|
||||
// configuration failed.
|
||||
InitFailedReason string = "InitFailed"
|
||||
|
||||
// GetLastReleaseFailedReason represents the fact that observing the last
|
||||
// release failed.
|
||||
GetLastReleaseFailedReason string = "GetLastReleaseFailed"
|
||||
)
|
||||
```
|
||||
|
||||
## Helm release placement
|
||||
|
||||
The namespace/name in which to deploy the Helm release defaults to the namespace/name of the
|
||||
`HelmRelease`. These can be overridden respectively via `spec.targetNamespace` and
|
||||
`spec.releaseName`. If `spec.targetNamespace` is set, `spec.releaseName` defaults to
|
||||
`<spec.targetNamespace>-<metadata.name>`.
|
||||
|
||||
> **Note:** that configuring the `spec.targetNamespace` only defines the namespace the release
|
||||
> is made in, the metadata for the release (also known as the "Helm storage") will always be
|
||||
> stored in the `metadata.namespace` of the `HelmRelease`.
|
||||
|
||||
## Helm chart template
|
||||
|
||||
The `spec.chart.spec` values are used by the helm-controller as a template
|
||||
to create a new `HelmChart` resource with the given spec.
|
||||
|
||||
The `spec.chart.spec.sourceRef` is a reference to an object managed by
|
||||
[source-controller](https://github.com/fluxcd/source-controller). When the source
|
||||
[revision](https://github.com/fluxcd/source-controller/blob/master/docs/spec/v1beta1/common.md#source-status)
|
||||
changes, it generates a Kubernetes event that triggers a new release.
|
||||
|
||||
Supported source types:
|
||||
|
||||
* [HelmRepository](https://github.com/fluxcd/source-controller/blob/master/docs/spec/v1beta1/helmrepositories.md)
|
||||
* [GitRepository](https://github.com/fluxcd/source-controller/blob/master/docs/spec/v1beta1/gitrepositories.md)
|
||||
* [Bucket](https://github.com/fluxcd/source-controller/blob/master/docs/spec/v1beta1/buckets.md)
|
||||
|
||||
The `HelmChart` is created in the same namespace as the `sourceRef`,
|
||||
with a name matching the `HelmRelease` `<metadata.namespace>-<metadata.name>`.
|
||||
|
||||
The `chart.spec.chart` can either contain:
|
||||
|
||||
* The name of the chart as made available by the `HelmRepository`
|
||||
(without any aliases), for example: `podinfo`
|
||||
* The relative path the chart can be found at in the `GitRepository`,
|
||||
for example: `./charts/podinfo`
|
||||
|
||||
The `chart.spec.version` can be a fixed semver, or any semver range
|
||||
(i.e. `>=4.0.0 <5.0.0`). It is ignored for `HelmRelease` resources
|
||||
that reference a `GitRepository` or `Bucket` source.
|
||||
|
||||
## Values overrides
|
||||
|
||||
The simplest way to define values overrides is inline via `spec.values`.
|
||||
It is also possible to define a list of `ConfigMap` and `Secret` resources
|
||||
from which to take values via `spec.valuesFrom`. The values are merged in the order given,
|
||||
with the later values overwriting earlier, and then `spec.values` overwriting those:
|
||||
|
||||
```yaml
|
||||
spec:
|
||||
values:
|
||||
replicaCount: 2
|
||||
valuesFrom:
|
||||
- kind: ConfigMap
|
||||
name: prod-env-values
|
||||
valuesKey: values-prod.yaml
|
||||
- kind: Secret
|
||||
name: prod-tls-values
|
||||
valuesKey: crt
|
||||
targetPath: tls.crt
|
||||
optional: true
|
||||
```
|
||||
|
||||
The definition of the listed keys for items in `spec.valuesFrom` is as follows:
|
||||
|
||||
- `kind`: Kind of the values referent (`ConfigMap` or `Secret`).
|
||||
- `name`: Name of the values referent, in the same namespace as the
|
||||
`HelmRelease`.
|
||||
- `valuesKey` _(Optional)_: The data key where the values.yaml or a
|
||||
specific value can be found. Defaults to `values.yaml` when omitted.
|
||||
- `targetPath` _(Optional)_: The YAML dot notation path at which the
|
||||
value should be merged. When set, the `valuesKey` is expected to be
|
||||
a single flat value. Defaults to `None` when omitted, which results
|
||||
in the values getting merged at the root.
|
||||
- `optional` _(Optional)_: Whether this values reference is optional. When `true`,
|
||||
a not found error for the values reference is ignored, but any valuesKey, targetPath or
|
||||
transient error will still result in a reconciliation failure. Defaults to `false`
|
||||
when omitted.
|
||||
|
||||
> **Note:** that the `targetPath` supports the same formatting as you would supply as an
|
||||
> argument to the `helm` binary using `--set [path]=[value]`. In addition to this, the
|
||||
> referred value can contain the same value formats (e.g. `{a,b,c}` for a list). You can
|
||||
> read more about the available formats and limitations in the
|
||||
> [Helm documentation](https://helm.sh/docs/intro/using_helm/#the-format-and-limitations-of---set).
|
||||
|
||||
## Reconciliation
|
||||
|
||||
If no Helm release with the matching namespace/name is found it will be installed. It will
|
||||
be upgraded any time the desired state is updated, which consists of:
|
||||
|
||||
* `spec` (and thus `metadata.generation`)
|
||||
* Latest `HelmChart` revision available
|
||||
* [`ConfigMap` and `Secret` values overrides](#values-overrides). Changes to these do not trigger an
|
||||
immediate reconciliation, but will be handled upon the next reconciliation. This is to avoid
|
||||
a large number of upgrades occurring when multiple resources are updated.
|
||||
|
||||
If the latest Helm release revision was not made by the helm-controller, it may not match the
|
||||
desired state, so an upgrade is made in this case as well.
|
||||
|
||||
The `spec.interval` tells the reconciler at which interval to reconcile the release. The
|
||||
interval time units are `s`, `m` and `h` e.g. `interval: 5m`, the minimum value should be 60 seconds.
|
||||
|
||||
The reconciler can be told to reconcile the `HelmRelease` outside of the specified interval
|
||||
by annotating the object with a `fluxcd.io/reconcileAt` annotation. For example:
|
||||
|
||||
```bash
|
||||
kubectl annotate --overwrite helmrelease/podinfo fluxcd.io/reconcileAt="$(date +%s)"
|
||||
```
|
||||
|
||||
Reconciliation can be suspended by setting `spec.susped` to `true`.
|
||||
|
||||
The timeout for any individual Kubernetes operation (like Jobs for hooks) during the performance
|
||||
of Helm actions can be configured via `spec.timeout` and can be overridden per action
|
||||
via `spec.<action>.timeout`.
|
||||
|
||||
### Disabling resource waiting
|
||||
|
||||
For install, upgrade, and rollback actions resource waiting is enabled by default,
|
||||
but can be disabled by setting `spec.<action>.disableWait`.
|
||||
|
||||
### `HelmRelease` dependencies
|
||||
|
||||
When applying a `HelmRelease`, you may need to make sure other releases are [Ready](#status)
|
||||
before the release is reconciled. For example, because your chart relies on the presence of
|
||||
a Custom Resource Definition installed by another `HelmRelease`. The `spec.dependsOn` field
|
||||
allows you to specify each of these dependencies.
|
||||
|
||||
Assuming two `HelmRelease` resources:
|
||||
|
||||
- `backend` - contains the backend of the application
|
||||
- `frontend` - contains the frontend of the application and relies on the backend
|
||||
|
||||
```yaml
|
||||
apiVersion: helm.toolkit.fluxcd.io/v2beta1
|
||||
kind: HelmRelease
|
||||
metadata:
|
||||
name: backend
|
||||
spec:
|
||||
interval: 5m
|
||||
chart:
|
||||
spec:
|
||||
chart: podinfo
|
||||
version: '>=4.0.0 <5.0.0'
|
||||
sourceRef:
|
||||
kind: HelmRepository
|
||||
name: podinfo
|
||||
interval: 1m
|
||||
upgrade:
|
||||
remediation:
|
||||
remediateLastFailure: true
|
||||
test:
|
||||
enable: true
|
||||
values:
|
||||
service:
|
||||
grpcService: backend
|
||||
resources:
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 64Mi
|
||||
---
|
||||
apiVersion: helm.toolkit.fluxcd.io/v2beta1
|
||||
kind: HelmRelease
|
||||
metadata:
|
||||
name: frontend
|
||||
spec:
|
||||
interval: 5m
|
||||
chart:
|
||||
spec:
|
||||
chart: podinfo
|
||||
version: '>=4.0.0 <5.0.0'
|
||||
sourceRef:
|
||||
kind: HelmRepository
|
||||
name: podinfo
|
||||
interval: 1m
|
||||
dependsOn:
|
||||
- backend
|
||||
upgrade:
|
||||
remediation:
|
||||
remediateLastFailure: true
|
||||
test:
|
||||
enable: true
|
||||
values:
|
||||
backend: http://backend-podinfo:9898/echo
|
||||
resources:
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 64Mi
|
||||
```
|
||||
|
||||
> **Note** that this does not account for upgrade ordering. Kubernetes only allows
|
||||
> applying one resource (`HelmRelease` in this case) at a time, so there is no way for the
|
||||
> controller to know when a dependency `HelmRelease` may be updated. Also, circular
|
||||
> dependencies between `HelmRelease` resources must be avoided, otherwise the
|
||||
> interdependent `HelmRelease` resources will never be reconciled.
|
||||
|
||||
### Configuring Helm test actions
|
||||
|
||||
To make the controller run the Helm tests available for your chart after a successful Helm install
|
||||
or upgrade, `spec.test.enable` should be set to `true`.
|
||||
|
||||
By default, when tests are enabled, failures in tests are considered release failures, and thus
|
||||
are subject to the triggering Helm action's `remediation` configuration. However, test failures
|
||||
can be ignored by setting `spec.test.ignoreFailures` to `true`. In this case, no remediation will
|
||||
be taken, and the test failure will not affect the `Released` and `Ready` status conditions. This
|
||||
can be overridden per Helm action by setting `spec.install.remediation.ignoreTestFailures`
|
||||
or `spec.upgrade.remediation.ignoreTestFailures`.
|
||||
|
||||
```yaml
|
||||
apiVersion: helm.toolkit.fluxcd.io/v2beta1
|
||||
kind: HelmRelease
|
||||
metadata:
|
||||
name: podinfo
|
||||
spec:
|
||||
interval: 5m
|
||||
chart:
|
||||
spec:
|
||||
chart: podinfo
|
||||
version: '>=4.0.0 <5.0.0'
|
||||
sourceRef:
|
||||
kind: HelmRepository
|
||||
name: podinfo
|
||||
interval: 1m
|
||||
test:
|
||||
enable: true
|
||||
ignoreFailures: true
|
||||
values:
|
||||
resources:
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 64Mi
|
||||
```
|
||||
|
||||
### Configuring failure remediation
|
||||
|
||||
From time to time a Helm install/upgrade and accompanying [Helm test](#configuring-helm-test-actions)
|
||||
may fail. When this occurs, by default no action is taken, and the release is left in a failed state.
|
||||
However, several automatic failure remediation options can be set via
|
||||
`spec.install.remediation` and `spec.upgrade.remediation`.
|
||||
|
||||
The `retries` can be set to configure the number of retries after an initial
|
||||
failure. A negative integer results in infinite retries. This implicitly opts-in to a remediation
|
||||
action between each attempt. The remediation action for install failures is an uninstall. The
|
||||
remediation action for upgrade failures is by default a rollback, however
|
||||
`spec.upgrade.remediation.strategy` can be set to `uninstall`, in which case after the uninstall,
|
||||
the `spec.install` configuration takes over.
|
||||
|
||||
One can also opt-in to remediation of the last failure (when no retries remain) by setting
|
||||
`spec.<action>.remediation.remediateLastFailure` to `true`. For upgrades, this defaults
|
||||
to true if at least one retry is configured.
|
||||
|
||||
```yaml
|
||||
apiVersion: helm.fluxcd.io/v2beta1
|
||||
kind: HelmRelease
|
||||
metadata:
|
||||
name: podinfo
|
||||
spec:
|
||||
interval: 5m
|
||||
chart:
|
||||
spec:
|
||||
chart: podinfo
|
||||
version: '>=4.0.0 <5.0.0'
|
||||
sourceRef:
|
||||
kind: HelmRepository
|
||||
name: podinfo
|
||||
interval: 1m
|
||||
install:
|
||||
remediation:
|
||||
retries: 3
|
||||
upgrade:
|
||||
remediation:
|
||||
remediateLastFailure: false
|
||||
values:
|
||||
resources:
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 64Mi
|
||||
```
|
||||
|
||||
## Status
|
||||
|
||||
When the controller completes a reconciliation, it reports the result in the status sub-resource.
|
||||
|
||||
The following `status.condtions` types are advertised. Here, "desired state" is as detailed in
|
||||
[reconciliation](#reconciliation):
|
||||
|
||||
* `Ready` - status of the last reconciliation attempt
|
||||
* `Released` - status of the last release attempt (install/upgrade/test) against the latest desired state
|
||||
* `TestSuccess` - status of the last test attempt against the latest desired state
|
||||
* `Remediated` - status of the last remediation attempt (uninstall/rollback) due to a failure of the
|
||||
last release attempt against the latest desired state
|
||||
|
||||
For example, you can wait for a successful helm-controller reconciliation with:
|
||||
|
||||
```sh
|
||||
kubectl wait helmrelease/podinfo --for=condition=ready
|
||||
```
|
||||
|
||||
Each of these conditions also include descriptive `reason` / `message` fields
|
||||
as to why the status is as such.
|
||||
|
||||
### Examples
|
||||
|
||||
#### Install success
|
||||
|
||||
```yaml
|
||||
status:
|
||||
conditions:
|
||||
- lastTransitionTime: "2020-07-13T13:13:40Z"
|
||||
message: Helm install succeeded
|
||||
reason: InstallSucceeded
|
||||
status: "True"
|
||||
type: Released
|
||||
- lastTransitionTime: "2020-07-13T13:13:40Z"
|
||||
message: Helm test succeeded
|
||||
reason: TestSucceeded
|
||||
status: "True"
|
||||
type: TestSuccess
|
||||
- lastTransitionTime: "2020-07-13T13:13:42Z"
|
||||
message: release reconciliation succeeded
|
||||
reason: ReconciliationSucceeded
|
||||
status: "True"
|
||||
type: Ready
|
||||
lastAppliedRevision: 4.0.6
|
||||
lastAttemptedRevision: 4.0.6
|
||||
lastReleaseRevision: 1
|
||||
observedGeneration: 2
|
||||
```
|
||||
|
||||
#### Upgrade failure
|
||||
|
||||
```yaml
|
||||
status:
|
||||
conditions:
|
||||
- lastTransitionTime: "2020-07-13T13:17:28Z"
|
||||
message: 'error validating "": error validating data: ValidationError(Deployment.spec.replicas):
|
||||
invalid type for io.k8s.api.apps.v1.DeploymentSpec.replicas: got "string",
|
||||
expected "integer"'
|
||||
reason: UpgradeFailed
|
||||
status: "False"
|
||||
type: Released
|
||||
- lastTransitionTime: "2020-07-13T13:17:28Z"
|
||||
message: 'error validating "": error validating data: ValidationError(Deployment.spec.replicas):
|
||||
invalid type for io.k8s.api.apps.v1.DeploymentSpec.replicas: got "string",
|
||||
expected "integer"'
|
||||
reason: UpgradeFailed
|
||||
status: "False"
|
||||
type: Ready
|
||||
failures: 1
|
||||
lastAppliedRevision: 4.0.6
|
||||
lastAttemptedRevision: 4.0.6
|
||||
lastReleaseRevision: 1
|
||||
observedGeneration: 3
|
||||
```
|
||||
|
||||
#### Ignored test failure
|
||||
|
||||
```yaml
|
||||
status:
|
||||
conditions:
|
||||
- lastTransitionTime: "2020-07-13T13:13:40Z"
|
||||
message: Helm install succeeded
|
||||
reason: InstallSucceeded
|
||||
status: "True"
|
||||
type: Released
|
||||
- lastTransitionTime: "2020-07-13T13:13:40Z"
|
||||
message: Helm test failed
|
||||
reason: TestFailed
|
||||
status: "False"
|
||||
type: TestSuccess
|
||||
- lastTransitionTime: "2020-07-13T13:13:42Z"
|
||||
message: release reconciliation succeeded
|
||||
reason: ReconciliationSucceeded
|
||||
status: "True"
|
||||
type: Ready
|
||||
lastAppliedRevision: 4.0.6
|
||||
lastAttemptedRevision: 4.0.6
|
||||
lastReleaseRevision: 1
|
||||
observedGeneration: 2
|
||||
```
|
4
go.mod
4
go.mod
|
@ -1,6 +1,6 @@
|
|||
module github.com/fluxcd/helm-controller
|
||||
|
||||
go 1.14
|
||||
go 1.15
|
||||
|
||||
replace github.com/fluxcd/helm-controller/api => ./api
|
||||
|
||||
|
@ -9,7 +9,7 @@ require (
|
|||
github.com/fluxcd/pkg/apis/meta v0.0.2
|
||||
github.com/fluxcd/pkg/recorder v0.0.5
|
||||
github.com/fluxcd/pkg/runtime v0.0.6
|
||||
github.com/fluxcd/source-controller/api v0.0.18
|
||||
github.com/fluxcd/source-controller/api v0.1.0
|
||||
github.com/go-logr/logr v0.1.0
|
||||
github.com/onsi/ginkgo v1.12.1
|
||||
github.com/onsi/gomega v1.10.1
|
||||
|
|
8
go.sum
8
go.sum
|
@ -196,12 +196,10 @@ github.com/fluxcd/pkg/apis/meta v0.0.2 h1:kyA4Y0IzNjf1joBOnFqpWG7aNDHvtLExZcaHQM
|
|||
github.com/fluxcd/pkg/apis/meta v0.0.2/go.mod h1:nCNps5JJOcEQr3MNDmZqI4o0chjePSUYL6Q2ktDtotU=
|
||||
github.com/fluxcd/pkg/recorder v0.0.5 h1:D8qfupahIvh6ncCMn2yTHsrzG91S05sp4zdpsbKWeaU=
|
||||
github.com/fluxcd/pkg/recorder v0.0.5/go.mod h1:2UG6EroZ6ZbqmqoL8k/cQMe09e6A36WyH4t4UDUGyuU=
|
||||
github.com/fluxcd/pkg/runtime v0.0.3 h1:x9rOThl1qh5srIUpW0YHEj1I84swMj5m76UqrR1QknY=
|
||||
github.com/fluxcd/pkg/runtime v0.0.3/go.mod h1:ECBTeplxhgbCJYIjmtwn3ZS0A91/+6YtOS4w2G0LeK4=
|
||||
github.com/fluxcd/pkg/runtime v0.0.6 h1:m7qwr2wRePs1vzVlM0Y88vitXSsv1lb3QCJflRpa3qQ=
|
||||
github.com/fluxcd/pkg/runtime v0.0.6/go.mod h1:iLjncjktQVpqpb1NsY2fW+UYDFOtVyt+yJrxqrrK8A0=
|
||||
github.com/fluxcd/source-controller/api v0.0.18 h1:9goqqsW3vhwO6Nxr8SNxIUW/5t1JL9cgIs4UctlaJVk=
|
||||
github.com/fluxcd/source-controller/api v0.0.18/go.mod h1:PUe+EYQ/s+KPnz2iOCgdf+L6clM0SWkyvdXIpbfpkQE=
|
||||
github.com/fluxcd/source-controller/api v0.1.0 h1:ky3gMs3mnkDl6ClX+7uT2BNxU+sLzW/6a8B/M1KfySw=
|
||||
github.com/fluxcd/source-controller/api v0.1.0/go.mod h1:1ac/vj49YVPKF+xBHTo/9pfFj64TcLc1RLaxi4MwVEM=
|
||||
github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4=
|
||||
github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20=
|
||||
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
|
||||
|
@ -987,8 +985,6 @@ k8s.io/utils v0.0.0-20200603063816-c1c6865ac451/go.mod h1:jPW/WVKK9YHAvNhRxK0md/
|
|||
rsc.io/letsencrypt v0.0.3 h1:H7xDfhkaFFSYEJlKeq38RwX2jYcnTeHuDQyT+mMNMwM=
|
||||
rsc.io/letsencrypt v0.0.3/go.mod h1:buyQKZ6IXrRnB7TdkHP0RyEybLx18HHyOSoTyoOLqNY=
|
||||
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.7/go.mod h1:PHgbrJT7lCHcxMU+mDHEm+nx46H4zuuHZkDP6icnhu0=
|
||||
sigs.k8s.io/controller-runtime v0.6.2 h1:jkAnfdTYBpFwlmBn3pS5HFO06SfxvnTZ1p5PeEF/zAA=
|
||||
sigs.k8s.io/controller-runtime v0.6.2/go.mod h1:vhcq/rlnENJ09SIRp3EveTaZ0yqH526hjf9iJdbUJ/E=
|
||||
sigs.k8s.io/controller-runtime v0.6.3 h1:SBbr+inLPEKhvlJtrvDcwIpm+uhDvp63Bl72xYJtoOE=
|
||||
sigs.k8s.io/controller-runtime v0.6.3/go.mod h1:WlZNXcM0++oyaQt4B7C2lEE5JYRs8vJUzRP4N4JpdAY=
|
||||
sigs.k8s.io/kustomize v2.0.3+incompatible h1:JUufWFNlI44MdtnjUqVnvh29rR37PQFzPbLXqhyOyX0=
|
||||
|
|
|
@ -29,11 +29,11 @@ import (
|
|||
"k8s.io/cli-runtime/pkg/genericclioptions"
|
||||
"k8s.io/client-go/rest"
|
||||
|
||||
v2 "github.com/fluxcd/helm-controller/api/v2alpha1"
|
||||
v2 "github.com/fluxcd/helm-controller/api/v2beta1"
|
||||
)
|
||||
|
||||
// Runner represents a Helm action runner capable of performing Helm
|
||||
// operations for a v2alpha1.HelmRelease.
|
||||
// operations for a v2beta1.HelmRelease.
|
||||
type Runner struct {
|
||||
config *action.Configuration
|
||||
}
|
||||
|
@ -53,7 +53,7 @@ func NewRunner(clusterCfg *rest.Config, namespace string, logger logr.Logger) (*
|
|||
return &Runner{config: cfg}, nil
|
||||
}
|
||||
|
||||
// Install runs an Helm install action for the given v2alpha1.HelmRelease.
|
||||
// Install runs an Helm install action for the given v2beta1.HelmRelease.
|
||||
func (r *Runner) Install(hr v2.HelmRelease, chart *chart.Chart, values chartutil.Values) (*release.Release, error) {
|
||||
install := action.NewInstall(r.config)
|
||||
install.ReleaseName = hr.GetReleaseName()
|
||||
|
@ -68,7 +68,7 @@ func (r *Runner) Install(hr v2.HelmRelease, chart *chart.Chart, values chartutil
|
|||
return install.Run(chart, values.AsMap())
|
||||
}
|
||||
|
||||
// Upgrade runs an Helm upgrade action for the given v2alpha1.HelmRelease.
|
||||
// Upgrade runs an Helm upgrade action for the given v2beta1.HelmRelease.
|
||||
func (r *Runner) Upgrade(hr v2.HelmRelease, chart *chart.Chart, values chartutil.Values) (*release.Release, error) {
|
||||
upgrade := action.NewUpgrade(r.config)
|
||||
upgrade.Namespace = hr.GetReleaseNamespace()
|
||||
|
@ -84,7 +84,7 @@ func (r *Runner) Upgrade(hr v2.HelmRelease, chart *chart.Chart, values chartutil
|
|||
return upgrade.Run(hr.GetReleaseName(), chart, values.AsMap())
|
||||
}
|
||||
|
||||
// Test runs an Helm test action for the given v2alpha1.HelmRelease.
|
||||
// Test runs an Helm test action for the given v2beta1.HelmRelease.
|
||||
func (r *Runner) Test(hr v2.HelmRelease) (*release.Release, error) {
|
||||
test := action.NewReleaseTesting(r.config)
|
||||
test.Namespace = hr.GetReleaseNamespace()
|
||||
|
@ -93,7 +93,7 @@ func (r *Runner) Test(hr v2.HelmRelease) (*release.Release, error) {
|
|||
return test.Run(hr.GetReleaseName())
|
||||
}
|
||||
|
||||
// Rollback runs an Helm rollback action for the given v2alpha1.HelmRelease.
|
||||
// Rollback runs an Helm rollback action for the given v2beta1.HelmRelease.
|
||||
func (r *Runner) Rollback(hr v2.HelmRelease) error {
|
||||
rollback := action.NewRollback(r.config)
|
||||
rollback.Timeout = hr.Spec.GetRollback().GetTimeout(hr.GetTimeout()).Duration
|
||||
|
@ -106,7 +106,7 @@ func (r *Runner) Rollback(hr v2.HelmRelease) error {
|
|||
return rollback.Run(hr.GetReleaseName())
|
||||
}
|
||||
|
||||
// Uninstall runs an Helm uninstall action for the given v2alpha1.HelmRelease.
|
||||
// Uninstall runs an Helm uninstall action for the given v2beta1.HelmRelease.
|
||||
func (r *Runner) Uninstall(hr v2.HelmRelease) error {
|
||||
uninstall := action.NewUninstall(r.config)
|
||||
uninstall.Timeout = hr.Spec.GetUninstall().GetTimeout(hr.GetTimeout()).Duration
|
||||
|
@ -118,7 +118,7 @@ func (r *Runner) Uninstall(hr v2.HelmRelease) error {
|
|||
}
|
||||
|
||||
// ObserveLastRelease observes the last revision, if there is one,
|
||||
// for the actual Helm release associated with the given v2alpha1.HelmRelease.
|
||||
// for the actual Helm release associated with the given v2beta1.HelmRelease.
|
||||
func (r *Runner) ObserveLastRelease(hr v2.HelmRelease) (*release.Release, error) {
|
||||
rel, err := r.config.Releases.Last(hr.GetReleaseName())
|
||||
if err != nil && errors.Is(err, driver.ErrReleaseNotFound) {
|
||||
|
|
4
main.go
4
main.go
|
@ -31,9 +31,9 @@ import (
|
|||
"sigs.k8s.io/controller-runtime/pkg/log/zap"
|
||||
|
||||
"github.com/fluxcd/pkg/recorder"
|
||||
sourcev1 "github.com/fluxcd/source-controller/api/v1alpha1"
|
||||
sourcev1 "github.com/fluxcd/source-controller/api/v1beta1"
|
||||
|
||||
v2 "github.com/fluxcd/helm-controller/api/v2alpha1"
|
||||
v2 "github.com/fluxcd/helm-controller/api/v2beta1"
|
||||
"github.com/fluxcd/helm-controller/controllers"
|
||||
// +kubebuilder:scaffold:imports
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue