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