Skip to content

Commit

Permalink
fixed minor issues and tidied up. can pass docker uri in builder.toml
Browse files Browse the repository at this point in the history
Signed-off-by: Rashad Sirajudeen <[email protected]>
  • Loading branch information
rashadism committed Apr 1, 2024
1 parent ab68c2e commit 3ba1a29
Showing 1 changed file with 1 addition and 26 deletions.
27 changes: 1 addition & 26 deletions pkg/client/create_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,10 +262,6 @@ func (c *Client) fetchLifecycle(ctx context.Context, config pubbldr.LifecycleCon
return nil, err
}

Check warning on line 263 in pkg/client/create_builder.go

View check run for this annotation

Codecov / codecov/patch

pkg/client/create_builder.go#L260-L263

Added lines #L260 - L263 were not covered by tests

fmt.Print("---> stripped tar <---\n")
printTarContents(strippedTar)
fmt.Print("---> end <---\n")

blob, err = c.downloader.Download(ctx, strippedTar)
if err != nil {
return nil, errors.Wrap(err, "downloading lifecycle")
Expand Down Expand Up @@ -473,6 +469,7 @@ func stripTopLevelDir(inputTarFile string) (string, error) {
}

header.Name = strings.TrimPrefix(header.Name, topLevelDirName)
header.Name = strings.TrimPrefix(header.Name, "/")

if err := tarWriter.WriteHeader(header); err != nil {
return "", err
Expand All @@ -487,25 +484,3 @@ func stripTopLevelDir(inputTarFile string) (string, error) {

return outputTarFile, nil

Check warning on line 485 in pkg/client/create_builder.go

View check run for this annotation

Codecov / codecov/patch

pkg/client/create_builder.go#L485

Added line #L485 was not covered by tests
}

func printTarContents(tarFileName string) error {
file, err := os.Open(tarFileName)
if err != nil {
return err
}
defer file.Close()

tarReader := tar.NewReader(file)

for {
header, err := tarReader.Next()
if err != nil {
if err == tar.ErrHeader {
break
}
return err
}
fmt.Println(header.Name)
}
return nil
}

0 comments on commit 3ba1a29

Please sign in to comment.