-
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
Fix bug in sync #1709
Fix bug in sync #1709
Conversation
This PR fixes a bug in sync, in which desinations for synced files were being calculated incorrectly. For the hot-reload example, app.py was being synced to /src/app.py instead of /app.py, so it appeared as if sync wasn't actually working. To fix this issue, I fixed a bug in the intersect function to make sure destination calculation follows the Docker COPY command rules. For example, we had a unit test as follows: syncMap: **/**/*.js": "." file: dir1/dir2/node.js dst: /dir1/dir2/node.js when the destination should actually be /node.js based on Docker COPY command rules.
Codecov Report
@@ Coverage Diff @@
## master #1709 +/- ##
=======================================
Coverage 47.05% 47.05%
=======================================
Files 126 126
Lines 6142 6142
=======================================
Hits 2890 2890
Misses 2961 2961
Partials 291 291
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #1709 +/- ##
==========================================
- Coverage 47.05% 46.91% -0.15%
==========================================
Files 126 126
Lines 6142 6167 +25
==========================================
+ Hits 2890 2893 +3
- Misses 2961 2976 +15
- Partials 291 298 +7
Continue to review full report at Codecov.
|
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'm not sure I agree. Let me think about it before it's merged
There seems to be an issue with |
since go-containerregistry can't currently handle both
@priyawadhwa I think that's fine, can you check out the failing test in Kokoro though? doesn't look like a flake |
google/go-containerregistry#351 I kind of have a philosophical disagreement with that format of reference. I think it's misleading. I'm happy to take a PR to fix it, I just don't have time to figure out the regex voodoo myself. |
In GoogleContainerTools#1709 I introduced a regression to sync by removing the "-C /" from the tar extraction, which forced all files to be extracted at root. We actually still want this, since now that we append the workdir for relative paths all paths in the tarball are absolute paths and so should be extracted at root. This should fix GoogleContainerTools#1721.
In GoogleContainerTools#1709 I introduced a regression to sync by removing the "-C /" from the tar extraction, which forced all files to be extracted at root. We actually still want this, since now that we append the workdir for relative paths all paths in the tarball are absolute paths and so should be extracted at root. This should fix GoogleContainerTools#1721.
This PR fixes a bug in sync, in which desinations for synced files were
being calculated incorrectly. For the hot-reload example, app.py was
being synced to /src/app.py instead of /app.py, so it appeared as if
sync wasn't actually working.
To fix this issue, I fixed a bug in the intersect function to make sure
destination calculation follows the Docker COPY command rules.
For example, we had a unit test as follows:
I think the destination should actually be
/node.js
based on Docker COPYcommand rules.
should fix #1668