-
Notifications
You must be signed in to change notification settings - Fork 243
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for composite run/debug commands (#5841)
* Change integration test expectations regarding composite run commands * Add integration test supporting composite debug commands * Rename in-container pid file from '.odo_devfile_cmd_<name>.pid' into '.odo_cmd_<name>.pid' The implementation in kubeexec.go is indeed able to run any kind of commands, not only Devfile-related. * Pave the way to supporting composite run/debug commands Drop validation rules that prevented from going further with composite run or debug commands. * Update logic for determining which containers should have their entrypoint overridden or env vars updated The previous implementation was limited to Exec commands solely. This now makes it easier to support other kind of commands. For example, when handling a composite command, we are now recursively determining the containers (a.k.a components) that would get used by this composite command. * Store the process exit code in the pid file handled by kubeexec.go This allows to more accurately determine how the process could be reported. * Fix issue with util#DisplayLogs potentially not picking the last element of lines * Make sure to execute the Build command only once when running a composite command * Test that the Build command is executed once running a composite command * Make sure not to retrieve the parent default command uselessly * Log the command Id when it is about to be restarted * Redirect build command logs to PID 1 process This way, users would be able to display them (and follow them) with `odo logs` or `kubectl logs` * Handle Errored case when logging information about the process that exited * Make sure to override container entrypoint if needed for Build commands Build commands (which could also be composite ones) might be executed in a container different from the run or debug ones. * Redirect output from commands handled by component.exec_handler to PID 1 process streams This way, we can also have them displayed with `odo logs` or `kubectl logs`. This includes Build and Devfile events commands. * Make remotecmd#ExecuteCommand log stdout or stderr content only if there not empty This reduces the clutter in case of an error with the command execution. * Add integration test with more complex Devfile (composite build/run/debug commands running in different containers and with a shared volume) * Update the 'Executing the application' spinner accordingly when the related command is done
- Loading branch information
Showing
22 changed files
with
1,247 additions
and
288 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.