Skip to content

Commit

Permalink
Merge pull request #1126 from fluxcd/alias-ValuesReference
Browse files Browse the repository at this point in the history
Make `ValuesReference` an alias for backwards compat
  • Loading branch information
stefanprodan authored Dec 12, 2024
2 parents 66f024c + af516b8 commit 8991959
Showing 1 changed file with 25 additions and 22 deletions.
47 changes: 25 additions & 22 deletions api/v2/helmrelease_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,27 +42,6 @@ const (
defaultMaxHistory = 5
)

// Kustomize Helm PostRenderer specification.
type Kustomize struct {
// Strategic merge and JSON patches, defined as inline YAML objects,
// capable of targeting objects based on kind, label and annotation selectors.
// +optional
Patches []kustomize.Patch `json:"patches,omitempty"`

// Images is a list of (image name, new name, new tag or digest)
// for changing image names, tags or digests. This can also be achieved with a
// patch, but this operator is simpler to specify.
// +optional
Images []kustomize.Image `json:"images,omitempty" json:"images,omitempty"`
}

// PostRenderer contains a Helm PostRenderer specification.
type PostRenderer struct {
// Kustomization to apply as PostRenderer.
// +optional
Kustomize *Kustomize `json:"kustomize,omitempty"`
}

// HelmReleaseSpec defines the desired state of a Helm release.
// +kubebuilder:validation:XValidation:rule="(has(self.chart) && !has(self.chartRef)) || (!has(self.chart) && has(self.chartRef))", message="either chart or chartRef must be set"
type HelmReleaseSpec struct {
Expand Down Expand Up @@ -189,7 +168,7 @@ type HelmReleaseSpec struct {

// ValuesFrom holds references to resources containing Helm values for this HelmRelease,
// and information about how they should be merged.
ValuesFrom []meta.ValuesReference `json:"valuesFrom,omitempty"`
ValuesFrom []ValuesReference `json:"valuesFrom,omitempty"`

// Values holds the values for this Helm release.
// +optional
Expand All @@ -201,6 +180,30 @@ type HelmReleaseSpec struct {
PostRenderers []PostRenderer `json:"postRenderers,omitempty"`
}

// +kubebuilder:object:generate=false
type ValuesReference = meta.ValuesReference

// Kustomize Helm PostRenderer specification.
type Kustomize struct {
// Strategic merge and JSON patches, defined as inline YAML objects,
// capable of targeting objects based on kind, label and annotation selectors.
// +optional
Patches []kustomize.Patch `json:"patches,omitempty"`

// Images is a list of (image name, new name, new tag or digest)
// for changing image names, tags or digests. This can also be achieved with a
// patch, but this operator is simpler to specify.
// +optional
Images []kustomize.Image `json:"images,omitempty" json:"images,omitempty"`
}

// PostRenderer contains a Helm PostRenderer specification.
type PostRenderer struct {
// Kustomization to apply as PostRenderer.
// +optional
Kustomize *Kustomize `json:"kustomize,omitempty"`
}

// DriftDetectionMode represents the modes in which a controller can detect and
// handle differences between the manifest in the Helm storage and the resources
// currently existing in the cluster.
Expand Down

0 comments on commit 8991959

Please sign in to comment.