@@ -31,46 +31,57 @@ const (
31
31
)
32
32
33
33
const (
34
+ // GenericBucketProvider for any S3 API compatible storage Bucket.
34
35
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"
38
46
)
39
47
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.
41
50
type 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.
43
54
// +kubebuilder:validation:Enum=generic;aws;gcp;azure
44
55
// +kubebuilder:default:=generic
45
56
// +optional
46
57
Provider string `json:"provider,omitempty"`
47
58
48
- // The bucket name.
59
+ // BucketName is the name of the object storage bucket .
49
60
// +required
50
61
BucketName string `json:"bucketName"`
51
62
52
- // The bucket endpoint address.
63
+ // Endpoint is the object storage address the BucketName is located at .
53
64
// +required
54
65
Endpoint string `json:"endpoint"`
55
66
56
- // Insecure allows connecting to a non-TLS S3 HTTP endpoint .
67
+ // Insecure allows connecting to a non-TLS HTTP Endpoint .
57
68
// +optional
58
69
Insecure bool `json:"insecure,omitempty"`
59
70
60
- // The bucket region .
71
+ // Region of the Endpoint where the BucketName is located in .
61
72
// +optional
62
73
Region string `json:"region,omitempty"`
63
74
64
- // The name of the secret containing authentication credentials
75
+ // SecretRef specifies the Secret containing authentication credentials
65
76
// for the Bucket.
66
77
// +optional
67
78
SecretRef * meta.LocalObjectReference `json:"secretRef,omitempty"`
68
79
69
- // The interval at which to check for bucket updates.
80
+ // Interval at which to check the Endpoint for updates.
70
81
// +required
71
82
Interval metav1.Duration `json:"interval"`
72
83
73
- // The timeout for fetch operations, defaults to 60s.
84
+ // Timeout for fetch operations, defaults to 60s.
74
85
// +kubebuilder:default="60s"
75
86
// +optional
76
87
Timeout * metav1.Duration `json:"timeout,omitempty"`
@@ -81,43 +92,48 @@ type BucketSpec struct {
81
92
// +optional
82
93
Ignore * string `json:"ignore,omitempty"`
83
94
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.
85
97
// +optional
86
98
Suspend bool `json:"suspend,omitempty"`
87
99
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
89
103
// +optional
90
104
AccessFrom * acl.AccessFrom `json:"accessFrom,omitempty"`
91
105
}
92
106
93
- // BucketStatus defines the observed state of a bucket
107
+ // BucketStatus records the observed state of a Bucket.
94
108
type BucketStatus struct {
95
- // ObservedGeneration is the last observed generation.
109
+ // ObservedGeneration is the last observed generation of the Bucket object .
96
110
// +optional
97
111
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
98
112
99
113
// Conditions holds the conditions for the Bucket.
100
114
// +optional
101
115
Conditions []metav1.Condition `json:"conditions,omitempty"`
102
116
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.
104
120
// +optional
105
121
URL string `json:"url,omitempty"`
106
122
107
- // Artifact represents the output of the last successful Bucket sync .
123
+ // Artifact represents the last successful Bucket reconciliation .
108
124
// +optional
109
125
Artifact * Artifact `json:"artifact,omitempty"`
110
126
111
127
meta.ReconcileRequestStatus `json:",inline"`
112
128
}
113
129
114
130
const (
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.
117
133
BucketOperationSucceededReason string = "BucketOperationSucceeded"
118
134
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.
121
137
BucketOperationFailedReason string = "BucketOperationFailed"
122
138
)
123
139
@@ -136,23 +152,11 @@ func (in Bucket) GetRequeueAfter() time.Duration {
136
152
return in .Spec .Interval .Duration
137
153
}
138
154
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
-
145
155
// GetArtifact returns the latest artifact from the source if present in the status sub-resource.
146
156
func (in * Bucket ) GetArtifact () * Artifact {
147
157
return in .Status .Artifact
148
158
}
149
159
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
-
156
160
// +genclient
157
161
// +genclient:Namespaced
158
162
// +kubebuilder:storageversion
@@ -163,7 +167,7 @@ func (in *Bucket) GetStatusConditions() *[]metav1.Condition {
163
167
// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.conditions[?(@.type==\"Ready\")].status",description=""
164
168
// +kubebuilder:printcolumn:name="Status",type="string",JSONPath=".status.conditions[?(@.type==\"Ready\")].message",description=""
165
169
166
- // Bucket is the Schema for the buckets API
170
+ // Bucket is the Schema for the buckets API.
167
171
type Bucket struct {
168
172
metav1.TypeMeta `json:",inline"`
169
173
metav1.ObjectMeta `json:"metadata,omitempty"`
@@ -173,9 +177,8 @@ type Bucket struct {
173
177
Status BucketStatus `json:"status,omitempty"`
174
178
}
175
179
180
+ // BucketList contains a list of Bucket objects.
176
181
// +kubebuilder:object:root=true
177
-
178
- // BucketList contains a list of Bucket
179
182
type BucketList struct {
180
183
metav1.TypeMeta `json:",inline"`
181
184
metav1.ListMeta `json:"metadata,omitempty"`
0 commit comments