Closed kadel closed 5 years ago
@kadel There should be an option to support use case when dev wants to debug the code from the beginning. That would mean 'wait for debugger to attach, then start running my code'.
@kadel There should be an option to support use case when dev wants to debug the code from the beginning. That would mean 'wait for debugger to attach, then start running my code'.
We are changing directions. This command won't be needed. By default, the component will be started in a debug mode. More information in discussion https://github.com/openshift/odo/pull/1995#issuecomment-525259554
We will also provide the capability to set advance options like suspend=n
for Java, which suspends the process until the debugger is connected, to allow debugging the startup sequence.
But this is an advanced use case that will be added in the following interactions, not in the first implementation.
/close
@kadel: Closing this issue.
parent #822 debug proposal in #1995
odo debug start
Enables debug mode for the component. It does this by adding
DEBUG_MODE = true
environment variable.After adding environment variables the component (Deployment Config) is restarted. Once the pod is in running state
odo debug start
executesodo debug port-forward $DEBUG_PORT:$DEBUG_PORT
. This process is executed in the background and PID of the process is recorded in~/.odo/port-forward.json
file.port-forward.json format
Flags:
--port
: Optional. Controls value ofDEBUG_PORT
environment variable--context
: Optional. The same as in other commands (seeodo push --context
for example)--no-port-forward
: Optional. Just enable debugging but don't start forwarding port. User can useodo debug port-forward
manually or use other mechanisms.