@@ -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,11 @@ const (
30
28
BucketKind = "Bucket"
31
29
)
32
30
31
+ const (
32
+ GenericBucketProvider string = "generic"
33
+ AmazonBucketProvider string = "aws"
34
+ )
35
+
33
36
// BucketSpec defines the desired state of an S3 compatible bucket
34
37
type BucketSpec struct {
35
38
// The S3 compatible storage provider name, default ('generic').
@@ -79,11 +82,6 @@ type BucketSpec struct {
79
82
Suspend bool `json:"suspend,omitempty"`
80
83
}
81
84
82
- const (
83
- GenericBucketProvider string = "generic"
84
- AmazonBucketProvider string = "aws"
85
- )
86
-
87
85
// BucketStatus defines the observed state of a bucket
88
86
type BucketStatus struct {
89
87
// ObservedGeneration is the last observed generation.
@@ -115,45 +113,6 @@ const (
115
113
BucketOperationFailedReason string = "BucketOperationFailed"
116
114
)
117
115
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
116
// GetConditions returns the status conditions of the object.
158
117
func (in Bucket ) GetConditions () []metav1.Condition {
159
118
return in .Status .Conditions
0 commit comments