@@ -594,22 +594,23 @@ 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
+ log .Info ("Finding Pods for the database " + req .Name )
597
598
sidbReadyPod , _ , _ , _ , err := FindPods (r , "" , "" , req .Name , req .Namespace , ctx , req )
598
599
if err != nil {
599
600
log .Error (err , err .Error ())
600
601
return "" , "" , "" , errors .New ("error while fetching sidb ready pod for sidb " + req .Name )
601
602
}
603
+ log .Info ("Sidb Ready Pod name is " + sidbReadyPod .Name )
602
604
if sidbReadyPod .Name != "" {
603
605
out , err := ExecCommand (r , config , sidbReadyPod .Name , sidbReadyPod .Namespace , "" ,
604
606
ctx , req , false , "bash" , "-c" , GetSidPdbEditionCMD )
605
607
if err != nil {
606
608
log .Error (err , err .Error ())
607
609
return "" , "" , "" , errors .New ("error while execing GetSidPdbEditionCMD on sidb " + req .Name )
608
610
}
611
+ log .Info (out )
609
612
splitstr := strings .Split (out , "," )
610
- if len (splitstr ) == 3 {
611
- return splitstr [0 ], splitstr [1 ], splitstr [2 ], nil
612
- }
613
+ return splitstr [0 ], splitstr [1 ], splitstr [2 ], nil
613
614
}
614
615
615
616
return "" , "" , "" , errors .New ("error while sidb ready pod name is nil" )
0 commit comments