-
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.
On Podman, detect if application is listening on the loopback interfa…
…ce, and either error out or not depending on `--ignore-localhost` (#6620) * Add functions allowing to detect ports opened in a given container Specifically, this will be useful in Podman to detect applications that are bound to the loopback interface * Make `odo dev` fail on Podman if we detect that the application is bound to the loopback interface (on any ports supposed to be forwarded) Next step will be to provide an option for end-users to override this behavior, by either: - ignoring this error (--ignore-localhost); - or explicitly adding a redirect via a side container (--forward-localhost) More context in #6510 (comment) * Add '--ignore-localhost' flag to 'odo dev' on Podman Currently, `odo dev` on Podman will error out if it detects that the application is listening on the container loopback interface. Instead of erroring out, this flag allows users to ignore such failure; a warning will be displayed anyway if the application is listening on the container loopback interface, but odo will not error out. Ports will be marked as forwarded, but Podman might fail to redirect traffic to the application if it is bound to this loopback interface. * Add test cases * Fix existing integration tests by passing --ignore-localhost on Podman - odo describe component - odo dev --debug Some projects used there are listening to the loopback interface, so they won't work on Podman unless --ignore-localhost is passed. Next, we'll pass --forward-localhost when it is implemented, so we can have a fully working project with port-forwarding. * Extract logic for handling loopback ports in a separate method Requested in review
- Loading branch information
Showing
14 changed files
with
1,619 additions
and
22 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
Oops, something went wrong.