-
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: correctly rewrite debug container entrypoint and bind host port #6682
Conversation
Codecov Report
@@ Coverage Diff @@
## main #6682 +/- ##
==========================================
- Coverage 70.48% 69.77% -0.71%
==========================================
Files 515 525 +10
Lines 23150 24009 +859
==========================================
+ Hits 16317 16753 +436
- Misses 5776 6157 +381
- Partials 1057 1099 +42
Continue to review full report at Codecov.
|
461a6b7
to
f27a4ab
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.
It would be helpful if there were some tests to ensure the right ports were opened for an artifacts with and without debugging.
pkg/skaffold/deploy/docker/deploy.go
Outdated
} | ||
} | ||
|
||
bindings, err := d.portManager.getPorts(artifact.ImageName, d.resources, containerCfg, debugBindings) |
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.
Aside: I think users will need the ability to specify additional ports to expose for our docker deployer. It might be worth turning the []string
into an array of objects sooner than later.
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.
yeah the configuration definitely needs improvement, a []string
was basically an MVP to get things working. thanks for pointing this out though, will keep a note of it
done. PTAL @briandealwis |
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.
Some suggestions
Test failed due to timeout which is fixed on master |
Two issues fixed in this change:
CMD
was being rewritten with the debugging entrypoint. This was erroneous as it wasn't actually intercepting the entrypoint for the container. This change makes it so the actualENTRYPOINT
is being rewritten in the application container.DebugManager
to theDeployer
, which passes them to thePortManager
to ensure no collisions go undetected. This also ensures the correct events are issued through the API, so the clients can successfully attached to the exposed debugger.Verified using the Cloud Code Hello World Sample App.