@@ -205,7 +205,7 @@ mod tests {
205
205
api:: policy:: v1:: { PodDisruptionBudget , PodDisruptionBudgetSpec } ,
206
206
apimachinery:: pkg:: { apis:: meta:: v1:: LabelSelector , util:: intstr:: IntOrString } ,
207
207
} ;
208
- use kube:: { core:: ObjectMeta , CustomResource } ;
208
+ use kube:: { CustomResource , core:: ObjectMeta } ;
209
209
use schemars:: JsonSchema ;
210
210
use serde:: { Deserialize , Serialize } ;
211
211
@@ -229,28 +229,22 @@ mod tests {
229
229
. with_min_available ( 42 )
230
230
. build ( ) ;
231
231
232
- assert_eq ! (
233
- pdb,
234
- PodDisruptionBudget {
235
- metadata: ObjectMeta {
236
- name: Some ( "trino" . to_string( ) ) ,
237
- namespace: Some ( "default" . to_string( ) ) ,
238
- ..Default :: default ( )
239
- } ,
240
- spec: Some ( PodDisruptionBudgetSpec {
241
- min_available: Some ( IntOrString :: Int ( 42 ) ) ,
242
- selector: Some ( LabelSelector {
243
- match_expressions: None ,
244
- match_labels: Some ( BTreeMap :: from( [ (
245
- "foo" . to_string( ) ,
246
- "bar" . to_string( )
247
- ) ] ) ) ,
248
- } ) ,
249
- ..Default :: default ( )
232
+ assert_eq ! ( pdb, PodDisruptionBudget {
233
+ metadata: ObjectMeta {
234
+ name: Some ( "trino" . to_string( ) ) ,
235
+ namespace: Some ( "default" . to_string( ) ) ,
236
+ ..Default :: default ( )
237
+ } ,
238
+ spec: Some ( PodDisruptionBudgetSpec {
239
+ min_available: Some ( IntOrString :: Int ( 42 ) ) ,
240
+ selector: Some ( LabelSelector {
241
+ match_expressions: None ,
242
+ match_labels: Some ( BTreeMap :: from( [ ( "foo" . to_string( ) , "bar" . to_string( ) ) ] ) ) ,
250
243
} ) ,
251
244
..Default :: default ( )
252
- }
253
- )
245
+ } ) ,
246
+ ..Default :: default ( )
247
+ } )
254
248
}
255
249
256
250
#[ test]
@@ -289,55 +283,54 @@ mod tests {
289
283
. with_max_unavailable ( 2 )
290
284
. build ( ) ;
291
285
292
- assert_eq ! (
293
- pdb,
294
- PodDisruptionBudget {
295
- metadata: ObjectMeta {
296
- name: Some ( "simple-trino-worker" . to_string( ) ) ,
297
- namespace: Some ( "default" . to_string( ) ) ,
298
- labels: Some ( BTreeMap :: from( [
286
+ assert_eq ! ( pdb, PodDisruptionBudget {
287
+ metadata: ObjectMeta {
288
+ name: Some ( "simple-trino-worker" . to_string( ) ) ,
289
+ namespace: Some ( "default" . to_string( ) ) ,
290
+ labels: Some ( BTreeMap :: from( [
291
+ ( "app.kubernetes.io/name" . to_string( ) , "trino" . to_string( ) ) ,
292
+ (
293
+ "app.kubernetes.io/instance" . to_string( ) ,
294
+ "simple-trino" . to_string( )
295
+ ) ,
296
+ (
297
+ "app.kubernetes.io/managed-by" . to_string( ) ,
298
+ "trino.stackable.tech_trino-operator-trino-controller" . to_string( )
299
+ ) ,
300
+ (
301
+ "app.kubernetes.io/component" . to_string( ) ,
302
+ "worker" . to_string( )
303
+ )
304
+ ] ) ) ,
305
+ owner_references: Some ( vec![
306
+ OwnerReferenceBuilder :: new( )
307
+ . initialize_from_resource( & trino)
308
+ . block_owner_deletion_opt( None )
309
+ . controller_opt( Some ( true ) )
310
+ . build( )
311
+ . unwrap( )
312
+ ] ) ,
313
+ ..Default :: default ( )
314
+ } ,
315
+ spec: Some ( PodDisruptionBudgetSpec {
316
+ max_unavailable: Some ( IntOrString :: Int ( 2 ) ) ,
317
+ selector: Some ( LabelSelector {
318
+ match_expressions: None ,
319
+ match_labels: Some ( BTreeMap :: from( [
299
320
( "app.kubernetes.io/name" . to_string( ) , "trino" . to_string( ) ) ,
300
321
(
301
322
"app.kubernetes.io/instance" . to_string( ) ,
302
323
"simple-trino" . to_string( )
303
324
) ,
304
- (
305
- "app.kubernetes.io/managed-by" . to_string( ) ,
306
- "trino.stackable.tech_trino-operator-trino-controller" . to_string( )
307
- ) ,
308
325
(
309
326
"app.kubernetes.io/component" . to_string( ) ,
310
327
"worker" . to_string( )
311
328
)
312
329
] ) ) ,
313
- owner_references: Some ( vec![ OwnerReferenceBuilder :: new( )
314
- . initialize_from_resource( & trino)
315
- . block_owner_deletion_opt( None )
316
- . controller_opt( Some ( true ) )
317
- . build( )
318
- . unwrap( ) ] ) ,
319
- ..Default :: default ( )
320
- } ,
321
- spec: Some ( PodDisruptionBudgetSpec {
322
- max_unavailable: Some ( IntOrString :: Int ( 2 ) ) ,
323
- selector: Some ( LabelSelector {
324
- match_expressions: None ,
325
- match_labels: Some ( BTreeMap :: from( [
326
- ( "app.kubernetes.io/name" . to_string( ) , "trino" . to_string( ) ) ,
327
- (
328
- "app.kubernetes.io/instance" . to_string( ) ,
329
- "simple-trino" . to_string( )
330
- ) ,
331
- (
332
- "app.kubernetes.io/component" . to_string( ) ,
333
- "worker" . to_string( )
334
- )
335
- ] ) ) ,
336
- } ) ,
337
- ..Default :: default ( )
338
330
} ) ,
339
331
..Default :: default ( )
340
- }
341
- )
332
+ } ) ,
333
+ ..Default :: default ( )
334
+ } )
342
335
}
343
336
}
0 commit comments