-
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 a timeout when initializing the Podman client (broken Podman shou…
…ld not affect `odo dev` on cluster) (#6808) * Add test highlighting the issue and setting the expectations * Add a timeout of 1s to the 'podman version' command This command is called at dependency injection time to initialize a (nil-able) Podman client, even if users won't use Podman at all. As discussed, this command is supposed to be quite fast to return, hence this timeout of 1 second. Initially, we were using cmd.Output to get the command output, but as reported in [1], cmd.Output does not respect the context timeout. This explains the workaround of reading from both stdout and stderr pipes, *and* relying on cmd.Wait() to close those pipes properly when the program exits (either as expected or when the timeout is reached). [1] golang/go#57129 Co-authored-by: Philippe Martin <phmartin@redhat.com> * Log the errors returned at dependency injection time when the optional Kubernetes/Podman clients could not be initialized This helps debug such potential issues instead of swallowing the errors. * Make the timeout configurable via the 'PODMAN_CMD_INIT_TIMEOUT' env var This will allow setting a different value for environments like in GitHub where the Podman client would take slightly more time to return (I guess because of we are running a lot of Podman commands in parallel?). * Increase the timeout for Podman tests to an arbitrary value of 10s Some tests did not pass because the Podman client did not initialize in 1s; I guess because we are running a lot of Podman commands in parallel? This should hopefully improve this situation. * fixup! Add a timeout of 1s to the 'podman version' command --------- Co-authored-by: Philippe Martin <phmartin@redhat.com>
- Loading branch information
Showing
11 changed files
with
177 additions
and
30 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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