@@ -28,55 +28,60 @@ import (
28
28
// HelmChartKind is the string representation of a HelmChart.
29
29
const HelmChartKind = "HelmChart"
30
30
31
- // HelmChartSpec defines the desired state of a Helm chart.
31
+ // HelmChartSpec specifies the desired state of a Helm chart.
32
32
type 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.
34
35
// +required
35
36
Chart string `json:"chart"`
36
37
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.
39
40
// +kubebuilder:default:=*
40
41
// +optional
41
42
Version string `json:"version,omitempty"`
42
43
43
- // The reference to the Source the chart is available at.
44
+ // SourceRef is the reference to the Source the chart is available at.
44
45
// +required
45
46
SourceRef LocalHelmChartSourceReference `json:"sourceRef"`
46
47
47
- // The interval at which to check the Source for updates.
48
+ // Interval is the interval at which to check the Source for updates.
48
49
// +required
49
50
Interval metav1.Duration `json:"interval"`
50
51
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').
53
54
// See the documentation of the values for an explanation on their behavior.
54
55
// Defaults to ChartVersion when omitted.
55
56
// +kubebuilder:validation:Enum=ChartVersion;Revision
56
57
// +kubebuilder:default:=ChartVersion
57
58
// +optional
58
59
ReconcileStrategy string `json:"reconcileStrategy,omitempty"`
59
60
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.
64
66
// +optional
65
67
ValuesFiles []string `json:"valuesFiles,omitempty"`
66
68
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.
71
73
// +optional
72
74
// +deprecated
73
75
ValuesFile string `json:"valuesFile,omitempty"`
74
76
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.
76
79
// +optional
77
80
Suspend bool `json:"suspend,omitempty"`
78
81
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
80
85
// +optional
81
86
AccessFrom * acl.AccessFrom `json:"accessFrom,omitempty"`
82
87
}
@@ -107,18 +112,19 @@ type LocalHelmChartSourceReference struct {
107
112
Name string `json:"name"`
108
113
}
109
114
110
- // HelmChartStatus defines the observed state of the HelmChart.
115
+ // HelmChartStatus records the observed state of the HelmChart.
111
116
type HelmChartStatus struct {
112
- // ObservedGeneration is the last observed generation.
117
+ // ObservedGeneration is the last observed generation of the HelmChart
118
+ // object.
113
119
// +optional
114
120
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
115
121
116
122
// ObservedSourceArtifactRevision is the last observed Artifact.Revision
117
- // of the Source reference .
123
+ // of the HelmChartSpec.SourceRef .
118
124
// +optional
119
125
ObservedSourceArtifactRevision string `json:"observedSourceArtifactRevision,omitempty"`
120
126
121
- // ObservedChartName is the last observed chart name as defined by the
127
+ // ObservedChartName is the last observed chart name as specified by the
122
128
// resolved chart reference.
123
129
// +optional
124
130
ObservedChartName string `json:"observedChartName,omitempty"`
@@ -127,31 +133,25 @@ type HelmChartStatus struct {
127
133
// +optional
128
134
Conditions []metav1.Condition `json:"conditions,omitempty"`
129
135
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.
131
139
// +optional
132
140
URL string `json:"url,omitempty"`
133
141
134
- // Artifact represents the output of the last successful chart sync .
142
+ // Artifact represents the output of the last successful reconciliation .
135
143
// +optional
136
144
Artifact * Artifact `json:"artifact,omitempty"`
137
145
138
146
meta.ReconcileRequestStatus `json:",inline"`
139
147
}
140
148
141
149
const (
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
147
151
// succeeded.
148
152
ChartPullSucceededReason string = "ChartPullSucceeded"
149
153
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
155
155
// chart succeeded.
156
156
ChartPackageSucceededReason string = "ChartPackageSucceeded"
157
157
)
@@ -166,23 +166,19 @@ func (in *HelmChart) SetConditions(conditions []metav1.Condition) {
166
166
in .Status .Conditions = conditions
167
167
}
168
168
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.
170
171
func (in HelmChart ) GetRequeueAfter () time.Duration {
171
172
return in .Spec .Interval .Duration
172
173
}
173
174
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.
181
177
func (in * HelmChart ) GetArtifact () * Artifact {
182
178
return in .Status .Artifact
183
179
}
184
180
185
- // GetValuesFiles returns a merged list of ValuesFiles.
181
+ // GetValuesFiles returns a merged list of HelmChartSpec. ValuesFiles.
186
182
func (in * HelmChart ) GetValuesFiles () []string {
187
183
valuesFiles := in .Spec .ValuesFiles
188
184
@@ -193,12 +189,6 @@ func (in *HelmChart) GetValuesFiles() []string {
193
189
return valuesFiles
194
190
}
195
191
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
-
202
192
// +genclient
203
193
// +genclient:Namespaced
204
194
// +kubebuilder:storageversion
@@ -213,7 +203,7 @@ func (in *HelmChart) GetStatusConditions() *[]metav1.Condition {
213
203
// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.conditions[?(@.type==\"Ready\")].status",description=""
214
204
// +kubebuilder:printcolumn:name="Status",type="string",JSONPath=".status.conditions[?(@.type==\"Ready\")].message",description=""
215
205
216
- // HelmChart is the Schema for the helmcharts API
206
+ // HelmChart is the Schema for the helmcharts API.
217
207
type HelmChart struct {
218
208
metav1.TypeMeta `json:",inline"`
219
209
metav1.ObjectMeta `json:"metadata,omitempty"`
@@ -223,9 +213,8 @@ type HelmChart struct {
223
213
Status HelmChartStatus `json:"status,omitempty"`
224
214
}
225
215
216
+ // HelmChartList contains a list of HelmChart objects.
226
217
// +kubebuilder:object:root=true
227
-
228
- // HelmChartList contains a list of HelmChart
229
218
type HelmChartList struct {
230
219
metav1.TypeMeta `json:",inline"`
231
220
metav1.ListMeta `json:"metadata,omitempty"`
0 commit comments