-
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
Update to pack 0.15 and add debug support for CNB Platform API 0.4 #5064
Conversation
Codecov Report
@@ Coverage Diff @@
## master #5064 +/- ##
==========================================
+ Coverage 72.30% 72.33% +0.03%
==========================================
Files 368 368
Lines 12927 12964 +37
==========================================
+ Hits 9347 9378 +31
- Misses 2890 2893 +3
- Partials 690 693 +3
Continue to review full report at Codecov.
|
31126b6
to
e7dac68
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.
LGTM.
// indicates an image mis-configuration as we should have resolved the the | ||
// CNB_PROCESS_TYPE (if specified) or `web`. | ||
logrus.Warnf("no CNB launch found for %s/%s", ic.artifact, processType) | ||
logrus.Warnf("no CNB launch found for %s", ic.artifact) |
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 it possible to debug a container if CNB launch is not found?
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.
No. At this point we have an CNB launcher entrypoint (either /cnb/lifecycle/launcher
or /cnb/process/xxx
), but no corresponding process found. So we don't have a command-line should be executed.
Basically we'll return, the debug transforms won't be able to figure anything out, and the container / pod will remain un-touched. And the execution of the container will then fail as no process definition will be found.
// the original form. | ||
// Script-style launches support referencing environment variables since they are expanded by the shell. | ||
// | ||
// Configuring the launch depends on the CNB Platform API version being used, which is determined by |
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.
Thanks for the details, it was a little bit easier to understand the code.
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.
Going through this was painful :-)
e7dac68
to
015adfa
Compare
7b018cd
to
18169aa
Compare
Integration tests are failing; marking as draft and fixing
6fa5ef4
to
ebd77a5
Compare
Tests were failing as I wasn't rewriting the entrypoint, so that Platform 0.4-style process executables (/cnb/process/web) continued through and the debug transformers wouldn't recognize the executable. - fix adjustCommandLine() and add tests - fix testutil.isNil to handle function pointers - narrow isCNBImage() to only allow entrypoint to be 1-element array and add tests - go style nits (rename isCnbImage -> isCNBImage, godoc style)
ebd77a5
to
b288b3c
Compare
Marking TestDevPortForwardDeletePod to be skipped #4733. |
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.
this LGTM, its essentially an improved version of similar changes I made in #5038. thanks for the detailed comments @briandealwis
Fixes: #4796
Description
Update to pack 0.15.0, and update
skaffold debug
to support the Cloud Native Buildpacks Platform API 0.4, the default for the CNBpack
≥ 0.13.0 and lifecycle ≥ 0.9. Platform API 0.4 changes how processes are requested in an image:/cnb/lifecycle/launcher
, and the process is set via aCNB_PROCESS_TYPE
environment variable (defaulting toweb
if not present)/cnb/process/xxx
which are symlinks to/cnb/lifecycle/launcher
. When executed, they cause the corresponding process to be run. The default process is the entrypoint (e.g.,/cnb/process/web
).The Platform API version is set via the new
CNB_PLATFORM_API
environment variable.User facing changes (remove if N/A)
(This doesn't actually have any user-facing changes as to this point we still link with pack 0.12 and so create images with CNB Platform API 0.3.)