Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make ValuesReference an alias for backwards compat #1126

Merged
merged 1 commit into from
Dec 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading