-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Get tmp Directory from os env in kaniko local context storing #1285
Get tmp Directory from os env in kaniko local context storing #1285
Conversation
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. |
Codecov Report
@@ Coverage Diff @@
## master #1285 +/- ##
=======================================
Coverage 44.24% 44.24%
=======================================
Files 104 104
Lines 4629 4629
=======================================
Hits 2048 2048
Misses 2372 2372
Partials 209 209 Continue to review full report at Codecov.
|
241d1ed
to
0dd6e37
Compare
0dd6e37
to
8cb889a
Compare
8cb889a
to
9789cde
Compare
CLAs look good, thanks! |
@@ -105,12 +105,13 @@ func (g *LocalDir) ModifyPod(ctx context.Context, p *v1.Pod) error { | |||
return errors.Wrap(err, "waiting for pod to initialize") | |||
} | |||
// Copy over the buildcontext tarball into the init container | |||
copy := exec.CommandContext(ctx, "kubectl", "cp", g.tarPath, fmt.Sprintf("%s:/%s", p.Name, g.tarPath), "-c", initContainer, "-n", p.Namespace) | |||
tarCopyPath := fmt.Sprintf("/tmp/%s", filepath.Base(g.tarPath)) | |||
copy := exec.CommandContext(ctx, "kubectl", "cp", g.tarPath, fmt.Sprintf("%s:%s", p.Name, tarCopyPath), "-c", initContainer, "-n", p.Namespace) |
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 don't think we need the tarCopyPath
variable, since copying to g.tarPath
should accomplish the same thing, right?
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.
@priyawadhwa It doesn't work in windows unfortunately. That is the reason I had to use tarCopyPath
.
g.tarPath
= os.TempDir()
in windows ~ C:\Users<user-id>\AppData\Local\Temp
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.
ah gotcha, sounds good!
Thanks for fixing this! |
Skaffold build fails in windows environment, since there is no /tmp directory