@@ -594,24 +594,25 @@ func GetSidPdbEdition(r client.Reader, config *rest.Config, ctx context.Context,
594594
595595 log := ctrllog .FromContext (ctx ).WithValues ("GetSidbPdbEdition" , req .NamespacedName )
596596
597- sidbReadyPod , _ , _ , _ , err := FindPods (r , "" , "" , req .Name , req .Namespace , ctx , req )
597+ readyPod , _ , _ , _ , err := FindPods (r , "" , "" , req .Name , req .Namespace , ctx , req )
598598 if err != nil {
599599 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 () )
601601 }
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 , "" ,
604604 ctx , req , false , "bash" , "-c" , GetSidPdbEditionCMD )
605605 if err != nil {
606606 log .Error (err , err .Error ())
607- return "" , "" , "" , errors . New ( "error while execing GetSidPdbEditionCMD on sidb " + req . Name )
607+ return "" , "" , "" , err
608608 }
609609 log .Info (out )
610610 splitstr := strings .Split (strings .TrimSpace (out ), "," )
611611 return splitstr [0 ], splitstr [1 ], splitstr [2 ], nil
612612 }
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
615616}
616617
617618// Get Datapatch Status
0 commit comments