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

Replace unzip with bsdtar in the Batch Change Volume Workspace image #1020

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion docker/batch-change-volume-workspace/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

FROM alpine:3.15.0@sha256:21a3deaa0d32a8057914f36584b5288d2e5ecc984380bc0118285c70fa8c9300

RUN apk add --update git unzip
RUN apk add --update git libarchive-tools
2 changes: 1 addition & 1 deletion internal/batches/workspace/volume_workspace.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ func (wc *dockerVolumeWorkspaceCreator) unzipRepoIntoVolume(ctx context.Context,
opts,
DockerVolumeWorkspaceImage,
"sh", "-c",
fmt.Sprintf("unzip /tmp/zip; rm /work/%s", dummy),
fmt.Sprintf("bsdtar -xf /tmp/zip && rm /work/%s", dummy),
)

if out, err := exec.CommandContext(ctx, "docker", opts...).CombinedOutput(); err != nil {
Expand Down
12 changes: 6 additions & 6 deletions internal/batches/workspace/volume_workspace_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func TestVolumeWorkspaceCreator(t *testing.T) {
"--user", "0:0",
"--mount", "type=volume,source="+volumeID+",target=/work",
DockerVolumeWorkspaceImage,
"sh", "-c", "unzip /tmp/zip; rm /work/*",
"sh", "-c", "bsdtar -xf /tmp/zip && rm /work/*",
),
expect.NewGlob(
expect.Success,
Expand Down Expand Up @@ -122,7 +122,7 @@ func TestVolumeWorkspaceCreator(t *testing.T) {
"--user", "0:0",
"--mount", "type=volume,source="+volumeID+",target=/work",
DockerVolumeWorkspaceImage,
"sh", "-c", "unzip /tmp/zip; rm /work/*",
"sh", "-c", "bsdtar -xf /tmp/zip && rm /work/*",
),
expect.NewGlob(
expect.Success,
Expand Down Expand Up @@ -163,7 +163,7 @@ func TestVolumeWorkspaceCreator(t *testing.T) {
"--user", "1:2",
"--mount", "type=volume,source="+volumeID+",target=/work",
DockerVolumeWorkspaceImage,
"sh", "-c", "unzip /tmp/zip; rm /work/*",
"sh", "-c", "bsdtar -xf /tmp/zip && rm /work/*",
),
expect.NewGlob(
expect.Success,
Expand Down Expand Up @@ -242,7 +242,7 @@ func TestVolumeWorkspaceCreator(t *testing.T) {
"--user", "0:0",
"--mount", "type=volume,source="+volumeID+",target=/work",
DockerVolumeWorkspaceImage,
"sh", "-c", "unzip /tmp/zip; rm /work/*",
"sh", "-c", "bsdtar -xf /tmp/zip && rm /work/*",
),
expect.NewGlob(
expect.Behaviour{ExitCode: 1},
Expand Down Expand Up @@ -284,7 +284,7 @@ func TestVolumeWorkspaceCreator(t *testing.T) {
"--user", "0:0",
"--mount", "type=volume,source="+volumeID+",target=/work",
DockerVolumeWorkspaceImage,
"sh", "-c", "unzip /tmp/zip; rm /work/*",
"sh", "-c", "bsdtar -xf /tmp/zip && rm /work/*",
),
},
steps: []batcheslib.Step{
Expand Down Expand Up @@ -318,7 +318,7 @@ func TestVolumeWorkspaceCreator(t *testing.T) {
"--user", "0:0",
"--mount", "type=volume,source="+volumeID+",target=/work",
DockerVolumeWorkspaceImage,
"sh", "-c", "unzip /tmp/zip; rm /work/*",
"sh", "-c", "bsdtar -xf /tmp/zip && rm /work/*",
),
expect.NewGlob(
expect.Success,
Expand Down