@@ -39,7 +39,7 @@ func (b *bucketClaimListener) Add(ctx context.Context, bucketClaim *v1alpha1.Buc
39
39
if err != nil {
40
40
switch err {
41
41
case util .ErrInvalidBucketClass :
42
- klog .ErrorS (util .ErrInvalidBucketClass ,
42
+ klog .V ( 3 ). ErrorS (util .ErrInvalidBucketClass ,
43
43
"bucketClaim" , bucketClaim .ObjectMeta .Name ,
44
44
"ns" , bucketClaim .ObjectMeta .Namespace ,
45
45
"bucketClassName" , bucketClaim .Spec .BucketClassName )
@@ -50,7 +50,7 @@ func (b *bucketClaimListener) Add(ctx context.Context, bucketClaim *v1alpha1.Buc
50
50
)
51
51
return nil
52
52
default :
53
- klog .ErrorS (err ,
53
+ klog .V ( 3 ). ErrorS (err ,
54
54
"name" , bucketClaim .ObjectMeta .Name ,
55
55
"ns" , bucketClaim .ObjectMeta .Namespace ,
56
56
"err" , err )
@@ -77,10 +77,19 @@ func (b *bucketClaimListener) Update(ctx context.Context, old, new *v1alpha1.Buc
77
77
bucketName := bucketClaim .Status .BucketName
78
78
err := b .buckets ().Delete (ctx , bucketName , metav1.DeleteOptions {})
79
79
if err != nil {
80
+ klog .V (3 ).ErrorS (err , "Error deleting bucket" ,
81
+ "bucket" , bucketName ,
82
+ "bucketClaim" , bucketClaim .ObjectMeta .Name )
80
83
return err
81
84
}
85
+
86
+ klog .V (5 ).Infof ("Successfully deleted bucket: %s from bucketClaim: %s" , bucketName , bucketClaim .ObjectMeta .Name )
82
87
}
83
88
}
89
+
90
+ klog .V (3 ).InfoS ("Update BucketClaim success" ,
91
+ "name" , bucketClaim .ObjectMeta .Name ,
92
+ "ns" , bucketClaim .ObjectMeta .Namespace )
84
93
return nil
85
94
}
86
95
@@ -112,7 +121,7 @@ func (b *bucketClaimListener) provisionBucketClaimOperation(ctx context.Context,
112
121
bucketName = bucketClaim .Spec .ExistingBucketName
113
122
bucket , err := b .buckets ().Get (ctx , bucketName , metav1.GetOptions {})
114
123
if err != nil {
115
- klog .ErrorS (err , "Get Bucket with ExistingBucketName error" , "name" , bucketClaim .Spec .ExistingBucketName )
124
+ klog .V ( 3 ). ErrorS (err , "Get Bucket with ExistingBucketName error" , "name" , bucketClaim .Spec .ExistingBucketName )
116
125
return err
117
126
}
118
127
@@ -124,6 +133,9 @@ func (b *bucketClaimListener) provisionBucketClaimOperation(ctx context.Context,
124
133
125
134
_ , err = b .buckets ().Update (ctx , bucket , metav1.UpdateOptions {})
126
135
if err != nil {
136
+ klog .V (3 ).ErrorS (err , "Error updating existing bucket" ,
137
+ "bucket" , bucket .ObjectMeta .Name ,
138
+ "bucketClaim" , bucketClaim .ObjectMeta .Name )
127
139
return err
128
140
}
129
141
@@ -137,7 +149,7 @@ func (b *bucketClaimListener) provisionBucketClaimOperation(ctx context.Context,
137
149
138
150
bucketClass , err := b .bucketClasses ().Get (ctx , bucketClassName , metav1.GetOptions {})
139
151
if err != nil {
140
- klog .ErrorS (err , "Get Bucketclass Error" , "name" , bucketClassName )
152
+ klog .V ( 3 ). ErrorS (err , "Get Bucketclass Error" , "name" , bucketClassName )
141
153
return util .ErrInvalidBucketClass
142
154
}
143
155
@@ -164,7 +176,9 @@ func (b *bucketClaimListener) provisionBucketClaimOperation(ctx context.Context,
164
176
bucket .Spec .Protocols = protocolCopy
165
177
bucket , err = b .buckets ().Create (ctx , bucket , metav1.CreateOptions {})
166
178
if err != nil && ! errors .IsAlreadyExists (err ) {
167
- klog .ErrorS (err , "name" , bucketName )
179
+ klog .V (3 ).ErrorS (err , "Error creationg bucket" ,
180
+ "bucket" , bucketName ,
181
+ "bucketClaim" , bucketClaim .ObjectMeta .Name )
168
182
return err
169
183
}
170
184
@@ -176,7 +190,7 @@ func (b *bucketClaimListener) provisionBucketClaimOperation(ctx context.Context,
176
190
// operation doesn't happen on an outdated version of the bucketClaim.
177
191
bucketClaim , err = b .bucketClaims (bucketClaim .ObjectMeta .Namespace ).UpdateStatus (ctx , bucketClaim , metav1.UpdateOptions {})
178
192
if err != nil {
179
- klog .ErrorS (err , "Failed to update status of BucketClaim" , "name" , bucketClaim .ObjectMeta .Name )
193
+ klog .V ( 3 ). ErrorS (err , "Failed to update status of BucketClaim" , "name" , bucketClaim .ObjectMeta .Name )
180
194
return err
181
195
}
182
196
@@ -185,11 +199,11 @@ func (b *bucketClaimListener) provisionBucketClaimOperation(ctx context.Context,
185
199
controllerutil .AddFinalizer (bucketClaim , util .BucketClaimFinalizer )
186
200
_ , err = b .bucketClaims (bucketClaim .ObjectMeta .Namespace ).Update (ctx , bucketClaim , metav1.UpdateOptions {})
187
201
if err != nil {
188
- klog .ErrorS (err , "Failed to update BucketClaim" , "name" , bucketClaim .ObjectMeta .Name )
202
+ klog .V ( 3 ). ErrorS (err , "Failed to add finalizer BucketClaim" , "name" , bucketClaim .ObjectMeta .Name )
189
203
return err
190
204
}
191
205
192
- klog .Infof ("Finished creating Bucket %v" , bucketName )
206
+ klog .V ( 3 ). Infof ("Finished creating Bucket %v" , bucketName )
193
207
return nil
194
208
}
195
209
0 commit comments