@@ -229,22 +229,28 @@ mod tests {
229229 . with_min_available ( 42 )
230230 . build ( ) ;
231231
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( ) ) ] ) ) ,
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 ( )
243250 } ) ,
244251 ..Default :: default ( )
245- } ) ,
246- ..Default :: default ( )
247- } )
252+ }
253+ )
248254 }
249255
250256 #[ test]
@@ -283,54 +289,57 @@ mod tests {
283289 . with_max_unavailable ( 2 )
284290 . build ( ) ;
285291
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( [
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( [
320299 ( "app.kubernetes.io/name" . to_string( ) , "trino" . to_string( ) ) ,
321300 (
322301 "app.kubernetes.io/instance" . to_string( ) ,
323302 "simple-trino" . to_string( )
324303 ) ,
304+ (
305+ "app.kubernetes.io/managed-by" . to_string( ) ,
306+ "trino.stackable.tech_trino-operator-trino-controller" . to_string( )
307+ ) ,
325308 (
326309 "app.kubernetes.io/component" . to_string( ) ,
327310 "worker" . to_string( )
328311 )
329312 ] ) ) ,
313+ owner_references: Some ( vec![
314+ OwnerReferenceBuilder :: new( )
315+ . initialize_from_resource( & trino)
316+ . block_owner_deletion_opt( None )
317+ . controller_opt( Some ( true ) )
318+ . build( )
319+ . unwrap( )
320+ ] ) ,
321+ ..Default :: default ( )
322+ } ,
323+ spec: Some ( PodDisruptionBudgetSpec {
324+ max_unavailable: Some ( IntOrString :: Int ( 2 ) ) ,
325+ selector: Some ( LabelSelector {
326+ match_expressions: None ,
327+ match_labels: Some ( BTreeMap :: from( [
328+ ( "app.kubernetes.io/name" . to_string( ) , "trino" . to_string( ) ) ,
329+ (
330+ "app.kubernetes.io/instance" . to_string( ) ,
331+ "simple-trino" . to_string( )
332+ ) ,
333+ (
334+ "app.kubernetes.io/component" . to_string( ) ,
335+ "worker" . to_string( )
336+ )
337+ ] ) ) ,
338+ } ) ,
339+ ..Default :: default ( )
330340 } ) ,
331341 ..Default :: default ( )
332- } ) ,
333- ..Default :: default ( )
334- } )
342+ }
343+ )
335344 }
336345}
0 commit comments