Skip to content

Commit

Permalink
fix: reproducible tarballs on windows (#2293)
Browse files Browse the repository at this point in the history
## Description

Small change to do a `filepath.ToSlash` on paths within tarballs to make
cross platform packages happy.

## Type of change

- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Other (security config, docs update, etc)

## Checklist before merging

- [x] Test, docs, adr added or updated as needed
- [x] [Contributor Guide
Steps](https://github.com/defenseunicorns/zarf/blob/main/CONTRIBUTING.md#developer-workflow)
followed

---------

Signed-off-by: razzle <[email protected]>
  • Loading branch information
Noxsios authored Feb 7, 2024
1 parent 731e93c commit 1320831
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/pkg/cluster/injector.go
Original file line number Diff line number Diff line change
Expand Up @@ -436,8 +436,6 @@ func (c *Cluster) getImagesAndNodesForInjection(timeoutDuration time.Duration) (
result := make(imageNodeMap)

for {
// Delay check 2 seconds
time.Sleep(2 * time.Second)
select {

// On timeout abort
Expand Down Expand Up @@ -493,6 +491,7 @@ func (c *Cluster) getImagesAndNodesForInjection(timeoutDuration time.Duration) (

if len(result) < 1 {
c.Log("no images found: %w")
time.Sleep(2 * time.Second)
} else {
return result, nil
}
Expand Down
4 changes: 3 additions & 1 deletion src/pkg/utils/io.go
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,9 @@ func CreateReproducibleTarballFromDir(dirPath, dirPrefix, tarballPath string) er
if err != nil {
return fmt.Errorf("error getting relative path: %w", err)
}
header.Name = filepath.Join(dirPrefix, name)
name = filepath.Join(dirPrefix, name)
name = filepath.ToSlash(name)
header.Name = name

// Write the header to the tarball
if err := tw.WriteHeader(header); err != nil {
Expand Down

0 comments on commit 1320831

Please sign in to comment.