From 73aef6edfe5ae533f9cf547f924c98a9b0f7be59 Mon Sep 17 00:00:00 2001 From: Daniele Rondina Date: Fri, 11 Jun 2021 11:00:12 +0200 Subject: [PATCH] ReplaceFileTarWrapper: permit to override file name Signed-off-by: Daniele Rondina --- pkg/archive/archive.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/archive/archive.go b/pkg/archive/archive.go index 50b83c62c6..38cba551a8 100644 --- a/pkg/archive/archive.go +++ b/pkg/archive/archive.go @@ -278,7 +278,9 @@ func ReplaceFileTarWrapper(inputTarStream io.ReadCloser, mods map[string]TarModi return nil } - header.Name = name + if header.Name == "" { + header.Name = name + } header.Size = int64(len(data)) if err := tarWriter.WriteHeader(header); err != nil { return err