@@ -28,82 +28,86 @@ import (
2828const (
2929 // HelmRepositoryKind is the string representation of a HelmRepository.
3030 HelmRepositoryKind = "HelmRepository"
31- // HelmRepositoryURLIndexKey is the key to use for indexing HelmRepository
32- // resources by their HelmRepositorySpec.URL.
31+ // HelmRepositoryURLIndexKey is the key used for indexing HelmRepository
32+ // objects by their HelmRepositorySpec.URL.
3333 HelmRepositoryURLIndexKey = ".metadata.helmRepositoryURL"
3434)
3535
36- // HelmRepositorySpec defines the reference to a Helm repository.
36+ // HelmRepositorySpec specifies the required configuration to produce an
37+ // Artifact for a Helm repository index YAML.
3738type HelmRepositorySpec struct {
38- // The Helm repository URL, a valid URL contains at least a protocol and host.
39+ // URL of the Helm repository, a valid URL contains at least a protocol and
40+ // host.
3941 // +required
4042 URL string `json:"url"`
4143
42- // The name of the secret containing authentication credentials for the Helm
43- // repository .
44- // For HTTP/S basic auth the secret must contain username and
45- // password fields.
46- // For TLS the secret must contain a certFile and keyFile, and/or
47- // caCert fields.
44+ // SecretRef specifies the Secret containing authentication credentials
45+ // for the HelmRepository .
46+ // For HTTP/S basic auth the secret must contain ' username' and 'password'
47+ // fields.
48+ // For TLS the secret must contain a ' certFile' and ' keyFile' , and/or
49+ // ' caCert' fields.
4850 // +optional
4951 SecretRef * meta.LocalObjectReference `json:"secretRef,omitempty"`
5052
51- // PassCredentials allows the credentials from the SecretRef to be passed on to
52- // a host that does not match the host as defined in URL.
53- // This may be required if the host of the advertised chart URLs in the index
54- // differ from the defined URL.
55- // Enabling this should be done with caution, as it can potentially result in
56- // credentials getting stolen in a MITM-attack.
53+ // PassCredentials allows the credentials from the SecretRef to be passed
54+ // on to a host that does not match the host as defined in URL.
55+ // This may be required if the host of the advertised chart URLs in the
56+ // index differ from the defined URL.
57+ // Enabling this should be done with caution, as it can potentially result
58+ // in credentials getting stolen in a MITM-attack.
5759 // +optional
5860 PassCredentials bool `json:"passCredentials,omitempty"`
5961
60- // The interval at which to check the upstream for updates.
62+ // Interval at which to check the URL for updates.
6163 // +required
6264 Interval metav1.Duration `json:"interval"`
6365
64- // The timeout of index fetching , defaults to 60s.
66+ // Timeout of the index fetch operation , defaults to 60s.
6567 // +kubebuilder:default:="60s"
6668 // +optional
6769 Timeout * metav1.Duration `json:"timeout,omitempty"`
6870
69- // This flag tells the controller to suspend the reconciliation of this source.
71+ // Suspend tells the controller to suspend the reconciliation of this
72+ // HelmRepository.
7073 // +optional
7174 Suspend bool `json:"suspend,omitempty"`
7275
73- // AccessFrom defines an Access Control List for allowing cross-namespace references to this object.
76+ // AccessFrom specifies an Access Control List for allowing cross-namespace
77+ // references to this object.
78+ // NOTE: Not implemented, provisional as of https://github.com/fluxcd/flux2/pull/2092
7479 // +optional
7580 AccessFrom * acl.AccessFrom `json:"accessFrom,omitempty"`
7681}
7782
78- // HelmRepositoryStatus defines the observed state of the HelmRepository.
83+ // HelmRepositoryStatus records the observed state of the HelmRepository.
7984type HelmRepositoryStatus struct {
80- // ObservedGeneration is the last observed generation.
85+ // ObservedGeneration is the last observed generation of the HelmRepository
86+ // object.
8187 // +optional
8288 ObservedGeneration int64 `json:"observedGeneration,omitempty"`
8389
8490 // Conditions holds the conditions for the HelmRepository.
8591 // +optional
8692 Conditions []metav1.Condition `json:"conditions,omitempty"`
8793
88- // URL is the fetch link for the last index fetched.
94+ // URL is the dynamic fetch link for the latest Artifact.
95+ // It is provided on a "best effort" basis, and using the precise
96+ // HelmRepositoryStatus.Artifact data is recommended.
8997 // +optional
9098 URL string `json:"url,omitempty"`
9199
92- // Artifact represents the output of the last successful repository sync .
100+ // Artifact represents the last successful HelmRepository reconciliation .
93101 // +optional
94102 Artifact * Artifact `json:"artifact,omitempty"`
95103
96104 meta.ReconcileRequestStatus `json:",inline"`
97105}
98106
99107const (
100- // IndexationFailedReason represents the fact that the indexation of the given
101- // Helm repository failed.
108+ // IndexationFailedReason signals that the HelmRepository index fetch
109+ // failed.
102110 IndexationFailedReason string = "IndexationFailed"
103-
104- // IndexationSucceededReason represents the fact that the indexation of the
105- // given Helm repository succeeded.
106- IndexationSucceededReason string = "IndexationSucceed"
107111)
108112
109113// GetConditions returns the status conditions of the object.
@@ -116,28 +120,18 @@ func (in *HelmRepository) SetConditions(conditions []metav1.Condition) {
116120 in .Status .Conditions = conditions
117121}
118122
119- // GetRequeueAfter returns the duration after which the source must be reconciled again.
123+ // GetRequeueAfter returns the duration after which the source must be
124+ // reconciled again.
120125func (in HelmRepository ) GetRequeueAfter () time.Duration {
121126 return in .Spec .Interval .Duration
122127}
123128
124- // GetInterval returns the interval at which the source is reconciled.
125- // Deprecated: use GetRequeueAfter instead.
126- func (in HelmRepository ) GetInterval () metav1.Duration {
127- return in .Spec .Interval
128- }
129-
130- // GetArtifact returns the latest artifact from the source if present in the status sub-resource.
129+ // GetArtifact returns the latest artifact from the source if present in the
130+ // status sub-resource.
131131func (in * HelmRepository ) GetArtifact () * Artifact {
132132 return in .Status .Artifact
133133}
134134
135- // GetStatusConditions returns a pointer to the Status.Conditions slice.
136- // Deprecated: use GetConditions instead.
137- func (in * HelmRepository ) GetStatusConditions () * []metav1.Condition {
138- return & in .Status .Conditions
139- }
140-
141135// +genclient
142136// +genclient:Namespaced
143137// +kubebuilder:storageversion
@@ -149,7 +143,7 @@ func (in *HelmRepository) GetStatusConditions() *[]metav1.Condition {
149143// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.conditions[?(@.type==\"Ready\")].status",description=""
150144// +kubebuilder:printcolumn:name="Status",type="string",JSONPath=".status.conditions[?(@.type==\"Ready\")].message",description=""
151145
152- // HelmRepository is the Schema for the helmrepositories API
146+ // HelmRepository is the Schema for the helmrepositories API.
153147type HelmRepository struct {
154148 metav1.TypeMeta `json:",inline"`
155149 metav1.ObjectMeta `json:"metadata,omitempty"`
@@ -159,7 +153,7 @@ type HelmRepository struct {
159153 Status HelmRepositoryStatus `json:"status,omitempty"`
160154}
161155
162- // HelmRepositoryList contains a list of HelmRepository
156+ // HelmRepositoryList contains a list of HelmRepository objects.
163157// +kubebuilder:object:root=true
164158type HelmRepositoryList struct {
165159 metav1.TypeMeta `json:",inline"`
0 commit comments