-
Notifications
You must be signed in to change notification settings - Fork 35
Fix local source build #340
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
Fix local source build #340
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Little comments regarding the changes
pkg/shp/streamer/util.go
Outdated
|
|
||
| // Add explicit UID and GID | ||
| header.Uid = 0 | ||
| header.Gid = 0 | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As uid and gid 0 refers to superuser on Linux system, I'd rather set it to a different value.
Perhaps, -1 to set to the current user?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's right, 0 is probably incorrect.
I tried with -1 and it's syntactically incorrect.
Took a different approach here. Instead of setting the UID and GID while creating the tar, used tar command's flag --no-same-owner and --no-same-permission to ignore ownership and permission while extracting the tar through kubectl exec.
pkg/shp/cmd/build/upload.go
Outdated
| // Stream can be initialized irrespective of the Build source type | ||
| u.dataStreamer = streamer.NewStreamer(restConfig, clientset) | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd move down to line 126 and remove the comment // Stream can be initialized irrespective of the Build source type as it does not help the codebase but ease the current PR review...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed.
1c4984e to
12a9a38
Compare
12a9a38 to
927c52b
Compare
Fixes shipwright-io#332 Changes: - Data stream was only being initialized when the source is not OCI artifact. Hence, in cases where the source itself is not specified in the Build object, the struct was left uninitialized. Signed-off-by: Sayan Biswas <sayan-biswas@live.com>
927c52b to
7fc3831
Compare
Fixes shipwright-io#338 Changes: - Use flags "--no-same-permissions" and "--no-same-owner with "tar" command to prevent permission issue with local file having different UID and GID Signed-off-by: Sayan Biswas <sayan-biswas@live.com>
7fc3831 to
cb0322a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would like a 2nd review on this, but to me it is now /lgtm
CC: @qu1queee
|
Also, the release note linter check is failing @sayan-biswas |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/approve
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: SaschaSchwarze0 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/lgtm |
ebf16af
into
shipwright-io:main
Changes
Fixes #332
Fixes #338
Submitter Checklist
See the contributor guide
for details on coding conventions, github and prow interactions, and the code review process.
Release Notes