@@ -28,55 +28,60 @@ import (
2828// HelmChartKind is the string representation of a HelmChart.
2929const HelmChartKind = "HelmChart"
3030
31- // HelmChartSpec defines the desired state of a Helm chart.
31+ // HelmChartSpec specifies the desired state of a Helm chart.
3232type HelmChartSpec struct {
33- // The name or path the Helm chart is available at in the SourceRef.
33+ // Chart is the name or path the Helm chart is available at in the
34+ // SourceRef.
3435 // +required
3536 Chart string `json:"chart"`
3637
37- // The chart version semver expression, ignored for charts from GitRepository
38- // and Bucket sources. Defaults to latest when omitted.
38+ // Version is the chart version semver expression, ignored for charts from
39+ // GitRepository and Bucket sources. Defaults to latest when omitted.
3940 // +kubebuilder:default:=*
4041 // +optional
4142 Version string `json:"version,omitempty"`
4243
43- // The reference to the Source the chart is available at.
44+ // SourceRef is the reference to the Source the chart is available at.
4445 // +required
4546 SourceRef LocalHelmChartSourceReference `json:"sourceRef"`
4647
47- // The interval at which to check the Source for updates.
48+ // Interval is the interval at which to check the Source for updates.
4849 // +required
4950 Interval metav1.Duration `json:"interval"`
5051
51- // Determines what enables the creation of a new artifact. Valid values are
52- // ('ChartVersion', 'Revision').
52+ // ReconcileStrategy determines what enables the creation of a new artifact.
53+ // Valid values are ('ChartVersion', 'Revision').
5354 // See the documentation of the values for an explanation on their behavior.
5455 // Defaults to ChartVersion when omitted.
5556 // +kubebuilder:validation:Enum=ChartVersion;Revision
5657 // +kubebuilder:default:=ChartVersion
5758 // +optional
5859 ReconcileStrategy string `json:"reconcileStrategy,omitempty"`
5960
60- // Alternative list of values files to use as the chart values (values.yaml
61- // is not included by default), expected to be a relative path in the SourceRef.
62- // Values files are merged in the order of this list with the last file overriding
63- // the first. Ignored when omitted.
61+ // ValuesFiles is an alternative list of values files to use as the chart
62+ // values (values.yaml is not included by default), expected to be a
63+ // relative path in the SourceRef.
64+ // Values files are merged in the order of this list with the last file
65+ // overriding the first. Ignored when omitted.
6466 // +optional
6567 ValuesFiles []string `json:"valuesFiles,omitempty"`
6668
67- // Alternative values file to use as the default chart values, expected to
68- // be a relative path in the SourceRef. Deprecated in favor of ValuesFiles,
69- // for backwards compatibility the file defined here is merged before the
70- // ValuesFiles items. Ignored when omitted.
69+ // ValuesFile is an alternative values file to use as the default chart
70+ // values, expected to be a relative path in the SourceRef. Deprecated in
71+ // favor of ValuesFiles, for backwards compatibility the file specified here
72+ // is merged before the ValuesFiles items. Ignored when omitted.
7173 // +optional
7274 // +deprecated
7375 ValuesFile string `json:"valuesFile,omitempty"`
7476
75- // This flag tells the controller to suspend the reconciliation of this source.
77+ // Suspend tells the controller to suspend the reconciliation of this
78+ // source.
7679 // +optional
7780 Suspend bool `json:"suspend,omitempty"`
7881
79- // AccessFrom defines an Access Control List for allowing cross-namespace references to this object.
82+ // AccessFrom specifies an Access Control List for allowing cross-namespace
83+ // references to this object.
84+ // NOTE: Not implemented, provisional as of https://github.com/fluxcd/flux2/pull/2092
8085 // +optional
8186 AccessFrom * acl.AccessFrom `json:"accessFrom,omitempty"`
8287}
@@ -107,18 +112,19 @@ type LocalHelmChartSourceReference struct {
107112 Name string `json:"name"`
108113}
109114
110- // HelmChartStatus defines the observed state of the HelmChart.
115+ // HelmChartStatus records the observed state of the HelmChart.
111116type HelmChartStatus struct {
112- // ObservedGeneration is the last observed generation.
117+ // ObservedGeneration is the last observed generation of the HelmChart
118+ // object.
113119 // +optional
114120 ObservedGeneration int64 `json:"observedGeneration,omitempty"`
115121
116122 // ObservedSourceArtifactRevision is the last observed Artifact.Revision
117- // of the Source reference .
123+ // of the HelmChartSpec.SourceRef .
118124 // +optional
119125 ObservedSourceArtifactRevision string `json:"observedSourceArtifactRevision,omitempty"`
120126
121- // ObservedChartName is the last observed chart name as defined by the
127+ // ObservedChartName is the last observed chart name as specified by the
122128 // resolved chart reference.
123129 // +optional
124130 ObservedChartName string `json:"observedChartName,omitempty"`
@@ -127,31 +133,25 @@ type HelmChartStatus struct {
127133 // +optional
128134 Conditions []metav1.Condition `json:"conditions,omitempty"`
129135
130- // URL is the fetch link for the last chart pulled.
136+ // URL is the dynamic fetch link for the latest Artifact.
137+ // It is provided on a "best effort" basis, and using the precise
138+ // BucketStatus.Artifact data is recommended.
131139 // +optional
132140 URL string `json:"url,omitempty"`
133141
134- // Artifact represents the output of the last successful chart sync .
142+ // Artifact represents the output of the last successful reconciliation .
135143 // +optional
136144 Artifact * Artifact `json:"artifact,omitempty"`
137145
138146 meta.ReconcileRequestStatus `json:",inline"`
139147}
140148
141149const (
142- // ChartPullFailedReason represents the fact that the pull of the Helm chart
143- // failed.
144- ChartPullFailedReason string = "ChartPullFailed"
145-
146- // ChartPullSucceededReason represents the fact that the pull of the Helm chart
150+ // ChartPullSucceededReason signals that the pull of the Helm chart
147151 // succeeded.
148152 ChartPullSucceededReason string = "ChartPullSucceeded"
149153
150- // ChartPackageFailedReason represent the fact that the package of the Helm
151- // chart failed.
152- ChartPackageFailedReason string = "ChartPackageFailed"
153-
154- // ChartPackageSucceededReason represents the fact that the package of the Helm
154+ // ChartPackageSucceededReason signals that the package of the Helm
155155 // chart succeeded.
156156 ChartPackageSucceededReason string = "ChartPackageSucceeded"
157157)
@@ -166,23 +166,19 @@ func (in *HelmChart) SetConditions(conditions []metav1.Condition) {
166166 in .Status .Conditions = conditions
167167}
168168
169- // GetRequeueAfter returns the duration after which the source must be reconciled again.
169+ // GetRequeueAfter returns the duration after which the source must be
170+ // reconciled again.
170171func (in HelmChart ) GetRequeueAfter () time.Duration {
171172 return in .Spec .Interval .Duration
172173}
173174
174- // GetInterval returns the interval at which the source is reconciled.
175- // Deprecated: use GetRequeueAfter instead.
176- func (in HelmChart ) GetInterval () metav1.Duration {
177- return in .Spec .Interval
178- }
179-
180- // GetArtifact returns the latest artifact from the source if present in the status sub-resource.
175+ // GetArtifact returns the latest artifact from the source if present in the
176+ // status sub-resource.
181177func (in * HelmChart ) GetArtifact () * Artifact {
182178 return in .Status .Artifact
183179}
184180
185- // GetValuesFiles returns a merged list of ValuesFiles.
181+ // GetValuesFiles returns a merged list of HelmChartSpec. ValuesFiles.
186182func (in * HelmChart ) GetValuesFiles () []string {
187183 valuesFiles := in .Spec .ValuesFiles
188184
@@ -193,12 +189,6 @@ func (in *HelmChart) GetValuesFiles() []string {
193189 return valuesFiles
194190}
195191
196- // GetStatusConditions returns a pointer to the Status.Conditions slice.
197- // Deprecated: use GetConditions instead.
198- func (in * HelmChart ) GetStatusConditions () * []metav1.Condition {
199- return & in .Status .Conditions
200- }
201-
202192// +genclient
203193// +genclient:Namespaced
204194// +kubebuilder:storageversion
@@ -213,7 +203,7 @@ func (in *HelmChart) GetStatusConditions() *[]metav1.Condition {
213203// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.conditions[?(@.type==\"Ready\")].status",description=""
214204// +kubebuilder:printcolumn:name="Status",type="string",JSONPath=".status.conditions[?(@.type==\"Ready\")].message",description=""
215205
216- // HelmChart is the Schema for the helmcharts API
206+ // HelmChart is the Schema for the helmcharts API.
217207type HelmChart struct {
218208 metav1.TypeMeta `json:",inline"`
219209 metav1.ObjectMeta `json:"metadata,omitempty"`
@@ -223,9 +213,8 @@ type HelmChart struct {
223213 Status HelmChartStatus `json:"status,omitempty"`
224214}
225215
216+ // HelmChartList contains a list of HelmChart objects.
226217// +kubebuilder:object:root=true
227-
228- // HelmChartList contains a list of HelmChart
229218type HelmChartList struct {
230219 metav1.TypeMeta `json:",inline"`
231220 metav1.ListMeta `json:"metadata,omitempty"`
0 commit comments