-
Notifications
You must be signed in to change notification settings - Fork 244
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement
odo dev --no-commands
(#6855)
* Document the '--no-commands' flag Co-authored-by: Philippe Martin <phmartin@redhat.com> * Add integration tests highlighting the expectations * Add '--no-commands' flag to the 'dev' sub-command * Implement '--no-command' on Podman * Implement '--no-command' on cluster * Validate the '--no-commands' flag in the CLI For example, it should not be possible to call it alongside '--build-command' or '--run-command', because we won't be able to know what to do. * Fix 'odo dev' tests when the run/debug does not exist For consistency with how e.g., the build command works, instead of erroring out, `odo dev` will now simply log the error message and wait for new input. * Check for command existence when we want to run them As suggested in review, this makes it more adaptable. As a consequence, if the default (or single) build/run command does not exist, "odo dev" will not error out immediately; instead, it will behave a bit like "odo dev --no-commands" (by starting, but printing a warning about the missing command). The difference here is that if a run command is added later on during the dev session, "odo dev" will pick it up and run it, but "odo dev --no-commands" will continue to purposely ignore it. The existence of the optional default Build is already checked by the 'libdevfile.Build' command. It does not error out if there is no default (or single) Build command. It errors out only if the specified '--build-command' does not exist in the Devfile. Co-authored-by: Philippe Martin <phmartin@redhat.com> * Check for application ports only if the Devfile has run or debug command and if there are ports to forward This prevents: i) displaying the "Waiting for the application to be ready" spinner for nothing, if there are no ports to forward ii) waiting until the timeout of 1m has expired if there was no run/debug command executed, in which case, it is less unlikely that the application ports defined in the Devfile will ever be reachable. * Test "odo run" command against a Dev Session started with and without "--no-commands" --------- Co-authored-by: Philippe Martin <phmartin@redhat.com>
- Loading branch information
Showing
11 changed files
with
593 additions
and
290 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
Oops, something went wrong.