Skip to content

Commit ebf16af

Browse files
Merge pull request #340 from sayan-biswas/fix-local-source-build
Fix local source build
2 parents 59a465f + cb0322a commit ebf16af

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

pkg/shp/cmd/build/upload.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,12 @@ func (u *UploadCommand) Complete(p *params.Params, _ *genericclioptions.IOStream
131131
if build.Spec.Source != nil {
132132
if build.Spec.Source.OCIArtifact != nil && build.Spec.Source.OCIArtifact.Image != "" {
133133
u.sourceBundleImage = build.Spec.Source.OCIArtifact.Image
134-
135-
} else {
136-
u.dataStreamer = streamer.NewStreamer(restConfig, clientset)
137134
}
138135
}
136+
137+
// Create a streamer instance to stream data onto pod for local source build.
138+
u.dataStreamer = streamer.NewStreamer(restConfig, clientset)
139+
139140
u.pw, err = p.NewPodWatcher(u.Cmd().Context())
140141
return err
141142
}

pkg/shp/streamer/streamer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ type Streamer struct {
2727
type WriterFn func(w io.Writer) error
2828

2929
// tarCmd base tar command to be executed on the POD, a target directory should be appended.
30-
var tarCmd = []string{"tar", "xfv", "-", "-C"}
30+
var tarCmd = []string{"tar", "--no-same-permissions", "--no-same-owner", "-xvf", "-", "-C"}
3131

3232
// doneCmd command to notify the container the data streaming is done, thus the container build
3333
// process can continue.

pkg/shp/streamer/streamer_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ func Test_Streamer(t *testing.T) {
4747
return err
4848
}, size)
4949
g.Expect(err).To(o.BeNil())
50-
g.Expect(re.Command()).To(o.Equal([]string{"tar", "xfv", "-", "-C", "/"}))
50+
g.Expect(re.Command()).To(o.Equal([]string{"tar", "--no-same-permissions", "--no-same-owner", "-xvf", "-", "-C", "/"}))
5151
g.Expect(re.Stdin()).To(o.Equal(stdin))
5252

5353
// calling out "done" command on target pod, and making sure the command informed is expected

0 commit comments

Comments
 (0)