From 8741f7dedb6ad29fa1fd1f1f66db3a23c2d3ac66 Mon Sep 17 00:00:00 2001 From: "Grot (@grafanabot)" <43478413+grafanabot@users.noreply.github.com> Date: Tue, 4 Oct 2022 16:34:51 +0200 Subject: [PATCH] Replace filename with path without the local dir (#56296) (#56309) (cherry picked from commit d94af21cacab389c9cf05b11525401d75da4ecfe) Co-authored-by: Dimitris Sotirakis --- pkg/build/gcloud/storage/gsutil.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/build/gcloud/storage/gsutil.go b/pkg/build/gcloud/storage/gsutil.go index ca3484c5df7..461fd58c98a 100644 --- a/pkg/build/gcloud/storage/gsutil.go +++ b/pkg/build/gcloud/storage/gsutil.go @@ -268,8 +268,9 @@ func ListLocalFiles(dir string) ([]File, error) { err := filepath.Walk(dir, func(path string, info os.FileInfo, err error) error { if !info.IsDir() { files = append(files, File{ - FullPath: path, - PathTrimmed: info.Name(), + FullPath: path, + // Strip the dir name from the filepath + PathTrimmed: strings.ReplaceAll(path, dir, ""), }) } return nil