Skip to content

Commit 16e8f06

Browse files
committed
Fix: Include a root directory in the archive
* This will allow un-tarring the archive conveniently into its own directory * The directory has the same name as the archive
1 parent 74d3bd5 commit 16e8f06

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pkg/data_collector/data_collector.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ func (c *DataCollector) WrapUp() (string, error) {
7070
unixTime := time.Now().Unix()
7171
unixTimeString := strconv.FormatInt(unixTime, 10)
7272
tarballName := fmt.Sprintf("kic-supportpkg-%s.tar.gz", unixTimeString)
73+
tarballRootDirName := fmt.Sprintf("kic-supportpkg-%s", unixTimeString)
7374

7475
file, err := os.Create(tarballName)
7576
if err != nil {
@@ -97,7 +98,7 @@ func (c *DataCollector) WrapUp() (string, error) {
9798
if err != nil {
9899
return err
99100
}
100-
header.Name = relativePath
101+
header.Name = tarballRootDirName + "/" + relativePath
101102

102103
if err = tw.WriteHeader(header); err != nil {
103104
return err

0 commit comments

Comments
 (0)