From 05cce1d4242a6729171b91736be93f2a3d029c2d Mon Sep 17 00:00:00 2001 From: Arnob kumar saha Date: Fri, 22 Sep 2023 16:57:59 +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..470fb8aef 100644 --- a/pkg/backup.go +++ b/pkg/backup.go @@ -721,6 +721,12 @@ func lockConfigServer(configSVRDSN, secondaryHost string) error { klog.Errorf("Error while running findAndModify to lock configServer : %s ; output : %s \n", err.Error(), output) 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 {