From 3d68866f6a1da112a88606e8ffec5c2a7ea3c4f9 Mon Sep 17 00:00:00 2001 From: Hugo Gonzalez Date: Tue, 7 Jan 2025 10:20:53 +0100 Subject: [PATCH] handle empty traces --- changelog/unreleased/better-eos-traces.md | 3 +++ pkg/eosclient/eosbinary/eosbinary.go | 5 ++++- pkg/storage/fs/cephfs/errors.go | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 changelog/unreleased/better-eos-traces.md diff --git a/changelog/unreleased/better-eos-traces.md b/changelog/unreleased/better-eos-traces.md new file mode 100644 index 0000000000..cdd929f71d --- /dev/null +++ b/changelog/unreleased/better-eos-traces.md @@ -0,0 +1,3 @@ +Enhancement: Handle empty EOS traces + +https://github.com/cs3org/reva/pull/5028 diff --git a/pkg/eosclient/eosbinary/eosbinary.go b/pkg/eosclient/eosbinary/eosbinary.go index 1541735246..cd38d26d45 100644 --- a/pkg/eosclient/eosbinary/eosbinary.go +++ b/pkg/eosclient/eosbinary/eosbinary.go @@ -247,7 +247,10 @@ func (c *Client) executeEOS(ctx context.Context, cmdArgs []string, auth eosclien cmd.Args = append(cmd.Args, cmdArgs...) - cmd.Args = append(cmd.Args, "--comment", trace.Get(ctx)) + t := trace.Get(ctx) + if t != "" { + cmd.Args = append(cmd.Args, "--comment", t) + } err := cmd.Run() diff --git a/pkg/storage/fs/cephfs/errors.go b/pkg/storage/fs/cephfs/errors.go index 8182635bea..abc8079941 100644 --- a/pkg/storage/fs/cephfs/errors.go +++ b/pkg/storage/fs/cephfs/errors.go @@ -28,8 +28,8 @@ package cephfs */ import "C" import ( - "fmt" "context" + "fmt" "github.com/cs3org/reva/pkg/appctx" "github.com/cs3org/reva/pkg/errtypes" )