Skip to content

Commit

Permalink
Add app version to CRD manifests
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
  • Loading branch information
stefanprodan committed May 7, 2024
1 parent 1763370 commit 863d311
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 22 deletions.
3 changes: 2 additions & 1 deletion api/v2beta1/helmrelease_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import (
"github.com/fluxcd/pkg/apis/kustomize"
"github.com/fluxcd/pkg/apis/meta"

v2 "github.com/fluxcd/helm-controller/api/v2"
"github.com/fluxcd/helm-controller/api/v2beta2"
)

Expand Down Expand Up @@ -931,7 +932,7 @@ type HelmReleaseStatus struct {
// Note: this field is provisional to the v2beta2 API, and not actively used
// by v2beta1 HelmReleases.
// +optional
History v2beta2.Snapshots `json:"history,omitempty"`
History v2.Snapshots `json:"history,omitempty"`

// LastAttemptedGeneration is the last generation the controller attempted
// to reconcile.
Expand Down
5 changes: 3 additions & 2 deletions api/v2beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion api/v2beta2/helmrelease_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ import (

"github.com/fluxcd/pkg/apis/kustomize"
"github.com/fluxcd/pkg/apis/meta"

v2 "github.com/fluxcd/helm-controller/api/v2"
)

const (
Expand Down Expand Up @@ -976,7 +978,7 @@ type HelmReleaseStatus struct {
// History holds the history of Helm releases performed for this HelmRelease
// up to the last successfully completed release.
// +optional
History Snapshots `json:"history,omitempty"`
History v2.Snapshots `json:"history,omitempty"`

// LastAttemptedReleaseAction is the last release action performed for this
// HelmRelease. It is used to determine the active remediation strategy.
Expand Down
5 changes: 3 additions & 2 deletions api/v2beta2/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 10 additions & 2 deletions config/crd/bases/helm.toolkit.fluxcd.io_helmreleases.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1003,8 +1003,8 @@ spec:
this field will be used to distinguish between the old and new methods.
type: string
appVersion:
description: Version is the version of the release object in
storage.
description: AppVersion is the chart app version of the release
object in storage.
type: string
chartName:
description: ChartName is the chart name of the release object
Expand Down Expand Up @@ -2224,6 +2224,10 @@ spec:
Provisional: when the calculation method of the Digest field is changed,
this field will be used to distinguish between the old and new methods.
type: string
appVersion:
description: AppVersion is the chart app version of the release
object in storage.
type: string
chartName:
description: ChartName is the chart name of the release object
in storage.
Expand Down Expand Up @@ -3509,6 +3513,10 @@ spec:
Provisional: when the calculation method of the Digest field is changed,
this field will be used to distinguish between the old and new methods.
type: string
appVersion:
description: AppVersion is the chart app version of the release
object in storage.
type: string
chartName:
description: ChartName is the chart name of the release object
in storage.
Expand Down
20 changes: 10 additions & 10 deletions docs/api/v2/helm.md
Original file line number Diff line number Diff line change
Expand Up @@ -2243,48 +2243,48 @@ int
</tr>
<tr>
<td>
<code>appVersion</code><br>
<code>status</code><br>
<em>
string
</em>
</td>
<td>
<em>(Optional)</em>
<p>Version is the version of the release object in storage.</p>
<p>Status is the current state of the release.</p>
</td>
</tr>
<tr>
<td>
<code>status</code><br>
<code>chartName</code><br>
<em>
string
</em>
</td>
<td>
<p>Status is the current state of the release.</p>
<p>ChartName is the chart name of the release object in storage.</p>
</td>
</tr>
<tr>
<td>
<code>chartName</code><br>
<code>chartVersion</code><br>
<em>
string
</em>
</td>
<td>
<p>ChartName is the chart name of the release object in storage.</p>
<p>ChartVersion is the chart version of the release object in
storage.</p>
</td>
</tr>
<tr>
<td>
<code>chartVersion</code><br>
<code>appVersion</code><br>
<em>
string
</em>
</td>
<td>
<p>ChartVersion is the chart version of the release object in
storage.</p>
<em>(Optional)</em>
<p>AppVersion is the chart app version of the release object in storage.</p>
</td>
</tr>
<tr>
Expand Down
10 changes: 6 additions & 4 deletions internal/reconcile/release.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,11 +200,13 @@ func eventMessageWithLog(msg string, log *action.LogBuffer) string {
// addMeta is a function that adds metadata to an event map.
type addMeta func(map[string]string)

// metaOCIDigestKey is the key for the OCI digest metadata.
const metaOCIDigestKey = "oci-digest"
const (
// metaOCIDigestKey is the key for the chart OCI artifact digest.
metaOCIDigestKey = "oci-digest"

// metaAppVersionKey is the key for the app version found in chart metadata.
const metaAppVersionKey = "app-version"
// metaAppVersionKey is the key for the app version found in chart metadata.
metaAppVersionKey = "app-version"
)

// eventMeta returns the event (annotation) metadata based on the given
// parameters.
Expand Down

0 comments on commit 863d311

Please sign in to comment.