@@ -594,24 +594,25 @@ func GetSidPdbEdition(r client.Reader, config *rest.Config, ctx context.Context,
594
594
595
595
log := ctrllog .FromContext (ctx ).WithValues ("GetSidbPdbEdition" , req .NamespacedName )
596
596
597
- sidbReadyPod , _ , _ , _ , err := FindPods (r , "" , "" , req .Name , req .Namespace , ctx , req )
597
+ readyPod , _ , _ , _ , err := FindPods (r , "" , "" , req .Name , req .Namespace , ctx , req )
598
598
if err != nil {
599
599
log .Error (err , err .Error ())
600
- return "" , "" , "" , errors . New ("error while fetching sidb ready pod for sidb " + req .Name )
600
+ return "" , "" , "" , fmt . Errorf ("error while fetching ready pod %s : \n %s" , readyPod .Name , err . Error () )
601
601
}
602
- if sidbReadyPod .Name != "" {
603
- out , err := ExecCommand (r , config , sidbReadyPod .Name , sidbReadyPod .Namespace , "" ,
602
+ if readyPod .Name != "" {
603
+ out , err := ExecCommand (r , config , readyPod .Name , readyPod .Namespace , "" ,
604
604
ctx , req , false , "bash" , "-c" , GetSidPdbEditionCMD )
605
605
if err != nil {
606
606
log .Error (err , err .Error ())
607
- return "" , "" , "" , errors . New ( "error while execing GetSidPdbEditionCMD on sidb " + req . Name )
607
+ return "" , "" , "" , err
608
608
}
609
609
log .Info (out )
610
610
splitstr := strings .Split (strings .TrimSpace (out ), "," )
611
611
return splitstr [0 ], splitstr [1 ], splitstr [2 ], nil
612
612
}
613
-
614
- return "" , "" , "" , errors .New ("error while sidb ready pod name is nil" )
613
+ err = errors .New ("ready pod name is nil" )
614
+ log .Error (err , err .Error ())
615
+ return "" , "" , "" , err
615
616
}
616
617
617
618
// Get Datapatch Status
0 commit comments