Make `ValuesReference` an alias for backwards compat

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
This commit is contained in:
Stefan Prodan 2024-12-11 10:46:44 +02:00
parent 66f024c654
commit af516b84b0
No known key found for this signature in database
GPG Key ID: 3299AEB0E4085BAF
1 changed files with 25 additions and 22 deletions

View File

@ -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 {
@ -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
@ -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.