@@ -205,7 +205,7 @@ mod tests {
205205 api:: policy:: v1:: { PodDisruptionBudget , PodDisruptionBudgetSpec } ,
206206 apimachinery:: pkg:: { apis:: meta:: v1:: LabelSelector , util:: intstr:: IntOrString } ,
207207 } ;
208- use kube:: { core:: ObjectMeta , CustomResource } ;
208+ use kube:: { CustomResource , core:: ObjectMeta } ;
209209 use schemars:: JsonSchema ;
210210 use serde:: { Deserialize , Serialize } ;
211211
@@ -229,28 +229,22 @@ mod tests {
229229 . with_min_available ( 42 )
230230 . build ( ) ;
231231
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( ) ) ] ) ) ,
250243 } ) ,
251244 ..Default :: default ( )
252- }
253- )
245+ } ) ,
246+ ..Default :: default ( )
247+ } )
254248 }
255249
256250 #[ test]
@@ -289,55 +283,54 @@ mod tests {
289283 . with_max_unavailable ( 2 )
290284 . build ( ) ;
291285
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( [
299320 ( "app.kubernetes.io/name" . to_string( ) , "trino" . to_string( ) ) ,
300321 (
301322 "app.kubernetes.io/instance" . to_string( ) ,
302323 "simple-trino" . to_string( )
303324 ) ,
304- (
305- "app.kubernetes.io/managed-by" . to_string( ) ,
306- "trino.stackable.tech_trino-operator-trino-controller" . to_string( )
307- ) ,
308325 (
309326 "app.kubernetes.io/component" . to_string( ) ,
310327 "worker" . to_string( )
311328 )
312329 ] ) ) ,
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 ( )
338330 } ) ,
339331 ..Default :: default ( )
340- }
341- )
332+ } ) ,
333+ ..Default :: default ( )
334+ } )
342335 }
343336}
0 commit comments