@@ -31,46 +31,57 @@ const (
3131)
3232
3333const (
34+ // GenericBucketProvider for any S3 API compatible storage Bucket.
3435 GenericBucketProvider string = "generic"
35- AmazonBucketProvider string = "aws"
36- GoogleBucketProvider string = "gcp"
37- AzureBucketProvider string = "azure"
36+ // AmazonBucketProvider for an AWS S3 object storage Bucket.
37+ // Provides support for retrieving credentials from the AWS EC2 service.
38+ AmazonBucketProvider string = "aws"
39+ // GoogleBucketProvider for a Google Cloud Storage Bucket.
40+ // Provides support for authentication using a workload identity.
41+ GoogleBucketProvider string = "gcp"
42+ // AzureBucketProvider for an Azure Blob Storage Bucket.
43+ // Provides support for authentication using a Service Principal,
44+ // Managed Identity or Shared Key.
45+ AzureBucketProvider string = "azure"
3846)
3947
40- // BucketSpec defines the desired state of an S3 compatible bucket
48+ // BucketSpec specifies the required configuration to produce an Artifact for
49+ // an object storage bucket.
4150type BucketSpec struct {
42- // The S3 compatible storage provider name, default ('generic').
51+ // Provider of the object storage bucket.
52+ // Defaults to 'generic', which expects an S3 (API) compatible object
53+ // storage.
4354 // +kubebuilder:validation:Enum=generic;aws;gcp;azure
4455 // +kubebuilder:default:=generic
4556 // +optional
4657 Provider string `json:"provider,omitempty"`
4758
48- // The bucket name.
59+ // BucketName is the name of the object storage bucket .
4960 // +required
5061 BucketName string `json:"bucketName"`
5162
52- // The bucket endpoint address.
63+ // Endpoint is the object storage address the BucketName is located at .
5364 // +required
5465 Endpoint string `json:"endpoint"`
5566
56- // Insecure allows connecting to a non-TLS S3 HTTP endpoint .
67+ // Insecure allows connecting to a non-TLS HTTP Endpoint .
5768 // +optional
5869 Insecure bool `json:"insecure,omitempty"`
5970
60- // The bucket region .
71+ // Region of the Endpoint where the BucketName is located in .
6172 // +optional
6273 Region string `json:"region,omitempty"`
6374
64- // The name of the secret containing authentication credentials
75+ // SecretRef specifies the Secret containing authentication credentials
6576 // for the Bucket.
6677 // +optional
6778 SecretRef * meta.LocalObjectReference `json:"secretRef,omitempty"`
6879
69- // The interval at which to check for bucket updates.
80+ // Interval at which to check the Endpoint for updates.
7081 // +required
7182 Interval metav1.Duration `json:"interval"`
7283
73- // The timeout for fetch operations, defaults to 60s.
84+ // Timeout for fetch operations, defaults to 60s.
7485 // +kubebuilder:default="60s"
7586 // +optional
7687 Timeout * metav1.Duration `json:"timeout,omitempty"`
@@ -81,43 +92,48 @@ type BucketSpec struct {
8192 // +optional
8293 Ignore * string `json:"ignore,omitempty"`
8394
84- // This flag tells the controller to suspend the reconciliation of this source.
95+ // Suspend tells the controller to suspend the reconciliation of this
96+ // Bucket.
8597 // +optional
8698 Suspend bool `json:"suspend,omitempty"`
8799
88- // AccessFrom defines an Access Control List for allowing cross-namespace references to this object.
100+ // AccessFrom specifies an Access Control List for allowing cross-namespace
101+ // references to this object.
102+ // NOTE: Not implemented, provisional as of https://github.com/fluxcd/flux2/pull/2092
89103 // +optional
90104 AccessFrom * acl.AccessFrom `json:"accessFrom,omitempty"`
91105}
92106
93- // BucketStatus defines the observed state of a bucket
107+ // BucketStatus records the observed state of a Bucket.
94108type BucketStatus struct {
95- // ObservedGeneration is the last observed generation.
109+ // ObservedGeneration is the last observed generation of the Bucket object .
96110 // +optional
97111 ObservedGeneration int64 `json:"observedGeneration,omitempty"`
98112
99113 // Conditions holds the conditions for the Bucket.
100114 // +optional
101115 Conditions []metav1.Condition `json:"conditions,omitempty"`
102116
103- // URL is the fetch link for the artifact output of the last Bucket sync.
117+ // URL is the dynamic fetch link for the latest Artifact.
118+ // It is provided on a "best effort" basis, and using the precise
119+ // BucketStatus.Artifact data is recommended.
104120 // +optional
105121 URL string `json:"url,omitempty"`
106122
107- // Artifact represents the output of the last successful Bucket sync .
123+ // Artifact represents the last successful Bucket reconciliation .
108124 // +optional
109125 Artifact * Artifact `json:"artifact,omitempty"`
110126
111127 meta.ReconcileRequestStatus `json:",inline"`
112128}
113129
114130const (
115- // BucketOperationSucceededReason represents the fact that the bucket listing and
116- // fetch operations succeeded.
131+ // BucketOperationSucceededReason signals that the Bucket listing and fetch
132+ // operations succeeded.
117133 BucketOperationSucceededReason string = "BucketOperationSucceeded"
118134
119- // BucketOperationFailedReason represents the fact that the bucket listing or
120- // fetch operations failed.
135+ // BucketOperationFailedReason signals that the Bucket listing or fetch
136+ // operations failed.
121137 BucketOperationFailedReason string = "BucketOperationFailed"
122138)
123139
@@ -136,23 +152,11 @@ func (in Bucket) GetRequeueAfter() time.Duration {
136152 return in .Spec .Interval .Duration
137153}
138154
139- // GetInterval returns the interval at which the source is reconciled.
140- // Deprecated: use GetRequeueAfter instead.
141- func (in Bucket ) GetInterval () metav1.Duration {
142- return in .Spec .Interval
143- }
144-
145155// GetArtifact returns the latest artifact from the source if present in the status sub-resource.
146156func (in * Bucket ) GetArtifact () * Artifact {
147157 return in .Status .Artifact
148158}
149159
150- // GetStatusConditions returns a pointer to the Status.Conditions slice.
151- // Deprecated: use GetConditions instead.
152- func (in * Bucket ) GetStatusConditions () * []metav1.Condition {
153- return & in .Status .Conditions
154- }
155-
156160// +genclient
157161// +genclient:Namespaced
158162// +kubebuilder:storageversion
@@ -163,7 +167,7 @@ func (in *Bucket) GetStatusConditions() *[]metav1.Condition {
163167// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.conditions[?(@.type==\"Ready\")].status",description=""
164168// +kubebuilder:printcolumn:name="Status",type="string",JSONPath=".status.conditions[?(@.type==\"Ready\")].message",description=""
165169
166- // Bucket is the Schema for the buckets API
170+ // Bucket is the Schema for the buckets API.
167171type Bucket struct {
168172 metav1.TypeMeta `json:",inline"`
169173 metav1.ObjectMeta `json:"metadata,omitempty"`
@@ -173,9 +177,8 @@ type Bucket struct {
173177 Status BucketStatus `json:"status,omitempty"`
174178}
175179
180+ // BucketList contains a list of Bucket objects.
176181// +kubebuilder:object:root=true
177-
178- // BucketList contains a list of Bucket
179182type BucketList struct {
180183 metav1.TypeMeta `json:",inline"`
181184 metav1.ListMeta `json:"metadata,omitempty"`
0 commit comments