Skip to content

Commit

Permalink
Merge pull request #146 from fluxcd/helm-chart-change
Browse files Browse the repository at this point in the history
  • Loading branch information
hiddeco authored Nov 18, 2020
2 parents cd22046 + f18ddbf commit 7e67f21
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions api/v2beta1/helmrelease_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ type HelmChartTemplateSpec struct {

// Version semver expression, ignored for charts from v1beta1.GitRepository and
// v1beta1.Bucket sources. Defaults to latest when omitted.
// +kubebuilder:default:=*
// +optional
Version string `json:"version,omitempty"`

Expand Down
1 change: 1 addition & 0 deletions config/crd/bases/helm.toolkit.fluxcd.io_helmreleases.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ spec:
Ignored when omitted.
type: string
version:
default: '*'
description: Version semver expression, ignored for charts
from v1beta1.GitRepository and v1beta1.Bucket sources. Defaults
to latest when omitted.
Expand Down
6 changes: 5 additions & 1 deletion controllers/helmrelease_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -826,14 +826,18 @@ func helmChartRequiresUpdate(hr v2.HelmRelease, chart sourcev1.HelmChart) bool {
switch {
case template.Spec.Chart != chart.Spec.Chart:
return true
case template.Spec.Version != chart.Spec.Version:
// TODO(hidde): remove emptiness checks on next MINOR version
case template.Spec.Version == "" && chart.Spec.Version != "*",
template.Spec.Version != "" && template.Spec.Version != chart.Spec.Version:
return true
case template.Spec.SourceRef.Name != chart.Spec.SourceRef.Name:
return true
case template.Spec.SourceRef.Kind != chart.Spec.SourceRef.Kind:
return true
case template.GetInterval(hr.Spec.Interval) != chart.Spec.Interval:
return true
case template.Spec.ValuesFile != chart.Spec.ValuesFile:
return true
default:
return false
}
Expand Down
1 change: 1 addition & 0 deletions docs/spec/v2beta1/helmreleases.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ type HelmChartTemplateSpec struct {

// Version semver expression, ignored for charts from v1beta1.GitRepository and
// v1beta1.Bucket sources. Defaults to latest when omitted.
// +kubebuilder:default:=*
// +optional
Version string `json:"version,omitempty"`

Expand Down

0 comments on commit 7e67f21

Please sign in to comment.