@@ -20,8 +20,6 @@ import (
20
20
"time"
21
21
22
22
"github.com/fluxcd/pkg/apis/meta"
23
- "github.com/fluxcd/pkg/runtime/conditions"
24
- apimeta "k8s.io/apimachinery/pkg/api/meta"
25
23
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
26
24
)
27
25
@@ -30,6 +28,18 @@ const (
30
28
BucketKind = "Bucket"
31
29
)
32
30
31
+ const (
32
+ GenericBucketProvider string = "generic"
33
+ AmazonBucketProvider string = "aws"
34
+ )
35
+
36
+ const (
37
+ // DownloadFailedCondition indicates a transient or persistent download failure. If True, observations on the
38
+ // upstream Source revision are not possible, and the Artifact available for the Source may be outdated.
39
+ // This is a "negative polarity" or "abnormal-true" type, and is only present on the resource if it is True.
40
+ DownloadFailedCondition string = "DownloadFailed"
41
+ )
42
+
33
43
// BucketSpec defines the desired state of an S3 compatible bucket
34
44
type BucketSpec struct {
35
45
// The S3 compatible storage provider name, default ('generic').
@@ -79,11 +89,6 @@ type BucketSpec struct {
79
89
Suspend bool `json:"suspend,omitempty"`
80
90
}
81
91
82
- const (
83
- GenericBucketProvider string = "generic"
84
- AmazonBucketProvider string = "aws"
85
- )
86
-
87
92
// BucketStatus defines the observed state of a bucket
88
93
type BucketStatus struct {
89
94
// ObservedGeneration is the last observed generation.
@@ -115,45 +120,6 @@ const (
115
120
BucketOperationFailedReason string = "BucketOperationFailed"
116
121
)
117
122
118
- // BucketProgressing resets the conditions of the Bucket to metav1.Condition of
119
- // type meta.ReadyCondition with status 'Unknown' and meta.ProgressingReason
120
- // reason and message. It returns the modified Bucket.
121
- func BucketProgressing (bucket Bucket ) Bucket {
122
- bucket .Status .ObservedGeneration = bucket .Generation
123
- bucket .Status .URL = ""
124
- bucket .Status .Conditions = []metav1.Condition {}
125
- conditions .MarkUnknown (& bucket , meta .ReadyCondition , meta .ProgressingReason , "reconciliation in progress" )
126
- return bucket
127
- }
128
-
129
- // BucketReady sets the given Artifact and URL on the Bucket and sets the
130
- // meta.ReadyCondition to 'True', with the given reason and message. It returns
131
- // the modified Bucket.
132
- func BucketReady (bucket Bucket , artifact Artifact , url , reason , message string ) Bucket {
133
- bucket .Status .Artifact = & artifact
134
- bucket .Status .URL = url
135
- conditions .MarkTrue (& bucket , meta .ReadyCondition , reason , message )
136
- return bucket
137
- }
138
-
139
- // BucketNotReady sets the meta.ReadyCondition on the Bucket to 'False', with
140
- // the given reason and message. It returns the modified Bucket.
141
- func BucketNotReady (bucket Bucket , reason , message string ) Bucket {
142
- conditions .MarkFalse (& bucket , meta .ReadyCondition , reason , message )
143
- return bucket
144
- }
145
-
146
- // BucketReadyMessage returns the message of the metav1.Condition of type
147
- // meta.ReadyCondition with status 'True' if present, or an empty string.
148
- func BucketReadyMessage (bucket Bucket ) string {
149
- if c := apimeta .FindStatusCondition (bucket .Status .Conditions , meta .ReadyCondition ); c != nil {
150
- if c .Status == metav1 .ConditionTrue {
151
- return c .Message
152
- }
153
- }
154
- return ""
155
- }
156
-
157
123
// GetConditions returns the status conditions of the object.
158
124
func (in Bucket ) GetConditions () []metav1.Condition {
159
125
return in .Status .Conditions
0 commit comments