Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Take an fs as an argument to RetrieveWorkspace #926

Merged
merged 1 commit into from
Jan 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pkg/build/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -1122,7 +1122,8 @@ func (b *Build) BuildPackage(ctx context.Context) error {

// Retrieve the post build workspace from the runner
b.Logger.Infof("retrieving workspace from builder: %s", cfg.PodID)
if err := b.RetrieveWorkspace(ctx); err != nil {
fs := apkofs.DirFS(b.WorkspaceDir)
if err := b.RetrieveWorkspace(ctx, fs); err != nil {
return fmt.Errorf("retrieving workspace: %w", err)
}
b.Logger.Printf("retrieved and wrote post-build workspace to: %s", b.WorkspaceDir)
Expand Down Expand Up @@ -1384,7 +1385,7 @@ func (b *Build) WorkspaceConfig() *container.Config {
// RetrieveWorkspace retrieves the workspace from the container and unpacks it
// to the workspace directory. The workspace retrieved from the runner is in a
// tar stream containing the workspace contents rooted at ./melange-out
func (b *Build) RetrieveWorkspace(ctx context.Context) error {
func (b *Build) RetrieveWorkspace(ctx context.Context, fs apkofs.FullFS) error {
ctx, span := otel.Tracer("melange").Start(ctx, "RetrieveWorkspace")
defer span.End()

Expand All @@ -1403,7 +1404,6 @@ func (b *Build) RetrieveWorkspace(ctx context.Context) error {
defer gr.Close()
tr := tar.NewReader(gr)

fs := apkofs.DirFS(b.WorkspaceDir)
for {
hdr, err := tr.Next()
if errors.Is(err, io.EOF) {
Expand Down
Loading