@@ -439,7 +439,7 @@ func (r *ReconcilePerconaServerMongoDB) updatePITR(ctx context.Context, cr *api.
439
439
440
440
enabled , ok := val .(bool )
441
441
if ! ok {
442
- return errors .Wrap ( err , "unexpected value of pitr.enabled" )
442
+ return errors .Errorf ( "unexpected value of pitr.enabled: %T" , val )
443
443
}
444
444
445
445
if enabled != cr .Spec .Backup .PITR .Enabled {
@@ -469,7 +469,7 @@ func (r *ReconcilePerconaServerMongoDB) updatePITR(ctx context.Context, cr *api.
469
469
470
470
oplogOnly , ok := val .(bool )
471
471
if ! ok {
472
- return errors .Wrap ( err , "unexpected value of pitr.oplogOnly" )
472
+ return errors .Errorf ( "unexpected value of pitr.oplogOnly: %T" , val )
473
473
}
474
474
475
475
if oplogOnly != cr .Spec .Backup .PITR .OplogOnly {
@@ -491,7 +491,7 @@ func (r *ReconcilePerconaServerMongoDB) updatePITR(ctx context.Context, cr *api.
491
491
492
492
oplogSpanMin , ok := val .(float64 )
493
493
if ! ok {
494
- return errors .Wrap ( err , "unexpected value of pitr.oplogSpanMin" )
494
+ return errors .Errorf ( "unexpected value of pitr.oplogSpanMin: %T" , val )
495
495
}
496
496
497
497
if oplogSpanMin != cr .Spec .Backup .PITR .OplogSpanMin .Float64 () {
@@ -512,7 +512,7 @@ func (r *ReconcilePerconaServerMongoDB) updatePITR(ctx context.Context, cr *api.
512
512
} else {
513
513
compression , ok = val .(string )
514
514
if ! ok {
515
- return errors .Wrap ( err , "unexpected value of pitr.compression" )
515
+ return errors .Errorf ( "unexpected value of pitr.compression: %T" , val )
516
516
}
517
517
}
518
518
@@ -543,11 +543,16 @@ func (r *ReconcilePerconaServerMongoDB) updatePITR(ctx context.Context, cr *api.
543
543
return errors .Wrap (err , "get pitr.compressionLevel" )
544
544
}
545
545
} else {
546
- tmpCompressionLevel , ok := val .(int )
547
- if ! ok {
548
- return errors .Wrap (err , "unexpected value of pitr.compressionLevel" )
549
- }
550
- compressionLevel = & tmpCompressionLevel
546
+ var iVal int
547
+ switch v := val .(type ) {
548
+ case int64 :
549
+ iVal = int (v )
550
+ case int32 :
551
+ iVal = int (v )
552
+ default :
553
+ return errors .Errorf ("unexpected value of pitr.compressionLevel: %T" , val )
554
+ }
555
+ compressionLevel = & iVal
551
556
}
552
557
553
558
if ! reflect .DeepEqual (compressionLevel , cr .Spec .Backup .PITR .CompressionLevel ) {
0 commit comments