Skip to content

Commit bf0698b

Browse files
committed
adding logs to debug-1
1 parent a5772a8 commit bf0698b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

commons/database/utils.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -594,22 +594,23 @@ func GetSidPdbEdition(r client.Reader, config *rest.Config, ctx context.Context,
594594

595595
log := ctrllog.FromContext(ctx).WithValues("GetSidbPdbEdition", req.NamespacedName)
596596

597+
log.Info("Finding Pods for the database " + req.Name)
597598
sidbReadyPod, _, _, _, err := FindPods(r, "", "", req.Name, req.Namespace, ctx, req)
598599
if err != nil {
599600
log.Error(err, err.Error())
600601
return "", "", "", errors.New("error while fetching sidb ready pod for sidb " + req.Name)
601602
}
603+
log.Info("Sidb Ready Pod name is " + sidbReadyPod.Name)
602604
if sidbReadyPod.Name != "" {
603605
out, err := ExecCommand(r, config, sidbReadyPod.Name, sidbReadyPod.Namespace, "",
604606
ctx, req, false, "bash", "-c", GetSidPdbEditionCMD)
605607
if err != nil {
606608
log.Error(err, err.Error())
607609
return "", "", "", errors.New("error while execing GetSidPdbEditionCMD on sidb " + req.Name)
608610
}
611+
log.Info(out)
609612
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
613614
}
614615

615616
return "", "", "", errors.New("error while sidb ready pod name is nil")

0 commit comments

Comments
 (0)