From ddccb15b281bd2684bfa46c2bbbe1f7a6ccd29a7 Mon Sep 17 00:00:00 2001 From: Arnob kumar saha Date: Fri, 22 Sep 2023 16:53:35 +0600 Subject: [PATCH] run tail to avoid extra logs Signed-off-by: Arnob kumar saha --- pkg/backup.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/backup.go b/pkg/backup.go index bad64da85..923761012 100644 --- a/pkg/backup.go +++ b/pkg/backup.go @@ -722,6 +722,12 @@ func lockConfigServer(configSVRDSN, secondaryHost string) error { return err } + s := fmt.Sprintf(`/bin/echo '%s' | /usr/bin/tail -1`, strings.TrimSuffix(string(output), "\n")) + output, err = sh.Command("/bin/sh", "-c", s).Output() + if err != nil { + klog.Errorf("Error while running tail in findAndModify to lock configServer : %s ; output : %s \n", err.Error(), output) + return err + } err = json.Unmarshal(output, &v) if err != nil { klog.Errorf("Unmarshal error while running findAndModify to lock configServer : %s \n", err.Error())