-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
always add short container id as net alias #11751
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Luap99 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@mheon PTAL
I reworked the logic. Instead of adding the ID to the DB I will just append it to the aliases when they are queried . This is better because we do not have to create the buckets if they are no extra aliases. I also moved network aliases validation to container create instead of the network backend. Otherwise we could make old containers with aliases non functional. |
afc6e0d
to
98eb456
Compare
/lgtm |
@edsantiago PTAL at the system test error
I don't understand what's wrong with that? |
The brackets. The way the |
test/system/500-networking.bats
Outdated
@@ -415,6 +415,10 @@ load helpers | |||
run_podman inspect $cid --format "{{(index .NetworkSettings.Networks \"$netname\").MacAddress}}" | |||
mac="$output" | |||
|
|||
# check network alias for container short id | |||
run_podman inspect $cid --format "{{(index .NetworkSettings.Networks \"$netname\").Aliases}}" | |||
is "$output" "[${cid:0:12}]" "short container id in network aliases" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternatively, try \\[...\\]
(double backslashes). Or maybe single backslashes, or maybe triple.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A single backslash worked
This matches what docker does. Also make sure the net aliases are also shown when the container is stopped. docker-compose uses this special alias entry to check if it is already correctly connected to the network. [1] Because we do not support static ips on network connect at the moment calling disconnect && connect will loose the static ip. Fixes containers#11748 [1] https://github.com/docker/compose/blob/0bea52b18dda3de8c28fcfb0c80cc08b8950645e/compose/service.py#L663-L667 Signed-off-by: Paul Holzinger <[email protected]>
Signed-off-by: Paul Holzinger <[email protected]>
Podman 4.0 currently errors when you use network aliases for a network which has dns disabled. Because the error happens on network setup this can cause regression for old working containers. The network backend should not validate this. Instead podman should check this at container create time and also for network connect. Signed-off-by: Paul Holzinger <[email protected]>
@edsantiago Can I recommend changing the error output from |
That whole function needs serious cleanup, and one of the first priorities is to actually try a simple |
LGTM. |
/lgtm |
/hold cancel |
This matches what docker does. Also make sure the net aliases are also
shown when the container is stopped.
docker-compose uses this special alias entry to check if it is already
correctly connected to the network. [1]
Because we do not support static ips on network connect at the moment
calling disconnect && connect will loose the static ip.
Fixes #11748
[1] https://github.com/docker/compose/blob/0bea52b18dda3de8c28fcfb0c80cc08b8950645e/compose/service.py#L663-L667