-
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
Avoid aliasing in image configuration #5804
Avoid aliasing in image configuration #5804
Conversation
Codecov Report
@@ Coverage Diff @@
## master #5804 +/- ##
==========================================
+ Coverage 70.87% 70.98% +0.11%
==========================================
Files 421 440 +19
Lines 16087 16572 +485
==========================================
+ Hits 11401 11764 +363
- Misses 3850 3945 +95
- Partials 836 863 +27
Continue to review full report at Codecov.
|
If I understand correctly, |
Port-forwarding attempts to preserve previously-made mappings. So if a pod had been allocated port 9229, it will continue to be allocated 9229. This is useful should a port-forward become disconnected for some reason. In trying this change scenario out with the nodejs-guestbook sample, you can see the frontend is allocated local 9230 and the backend was allocated 9229:
|
Sorry. I still don't understand why this solves the issue. Is my understanding correct that
|
That correct: on the second round, the image configuration appeared to already have an An alternative solution would be to change the code, like |
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.
seems good to me, restarting a few CI jobs to see if we can get around the pesky rate limit
Fixes: #5704
Description
In examining a debug trace, we discovered that the retrieved image configuration for the unchanged image was actually different:
round 1:
round 2 (notice the entrypoint now has an
--inspect=0.0.0.0:9229
)The problem is due to aliasing of underlying arrays when copying slices. We retrieve the image manifest and configuration for the image from the local docker daemon:
skaffold/pkg/skaffold/debug/debug.go
Line 114 in 01feff8
and then copy the values, but the slices and maps retain pointers to their underlying arrays:
skaffold/pkg/skaffold/debug/debug.go
Lines 120 to 129 in 01feff8
This struct is then changed with new arguments values copied into the array:
skaffold/pkg/skaffold/debug/transform_nodejs.go
Lines 196 to 203 in 01feff8
The solution here is to duplicate the arrays and maps taken from the image configuration.