@@ -439,7 +439,7 @@ func (r *ReconcilePerconaServerMongoDB) updatePITR(ctx context.Context, cr *api.
439439
440440 enabled , ok := val .(bool )
441441 if ! ok {
442- return errors .Wrap ( err , "unexpected value of pitr.enabled" )
442+ return errors .Errorf ( "unexpected value of pitr.enabled: %T" , val )
443443 }
444444
445445 if enabled != cr .Spec .Backup .PITR .Enabled {
@@ -469,7 +469,7 @@ func (r *ReconcilePerconaServerMongoDB) updatePITR(ctx context.Context, cr *api.
469469
470470 oplogOnly , ok := val .(bool )
471471 if ! ok {
472- return errors .Wrap ( err , "unexpected value of pitr.oplogOnly" )
472+ return errors .Errorf ( "unexpected value of pitr.oplogOnly: %T" , val )
473473 }
474474
475475 if oplogOnly != cr .Spec .Backup .PITR .OplogOnly {
@@ -491,7 +491,7 @@ func (r *ReconcilePerconaServerMongoDB) updatePITR(ctx context.Context, cr *api.
491491
492492 oplogSpanMin , ok := val .(float64 )
493493 if ! ok {
494- return errors .Wrap ( err , "unexpected value of pitr.oplogSpanMin" )
494+ return errors .Errorf ( "unexpected value of pitr.oplogSpanMin: %T" , val )
495495 }
496496
497497 if oplogSpanMin != cr .Spec .Backup .PITR .OplogSpanMin .Float64 () {
@@ -512,7 +512,7 @@ func (r *ReconcilePerconaServerMongoDB) updatePITR(ctx context.Context, cr *api.
512512 } else {
513513 compression , ok = val .(string )
514514 if ! ok {
515- return errors .Wrap ( err , "unexpected value of pitr.compression" )
515+ return errors .Errorf ( "unexpected value of pitr.compression: %T" , val )
516516 }
517517 }
518518
@@ -543,11 +543,16 @@ func (r *ReconcilePerconaServerMongoDB) updatePITR(ctx context.Context, cr *api.
543543 return errors .Wrap (err , "get pitr.compressionLevel" )
544544 }
545545 } 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
551556 }
552557
553558 if ! reflect .DeepEqual (compressionLevel , cr .Spec .Backup .PITR .CompressionLevel ) {
0 commit comments