]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
cephadm: use dashes for container names
authorSebastian Wagner <sewagner@redhat.com>
Thu, 8 Jul 2021 09:52:52 +0000 (11:52 +0200)
committerSebastian Wagner <sewagner@redhat.com>
Wed, 4 Aug 2021 12:52:53 +0000 (14:52 +0200)
commit67abea15b12c1a60a9da2db35e3470d8d8a128f7
tree5bfb8111a02579bac233ecd277e81950563b5365
parent50d582262066180ceb8a005106551efee71f80e2
cephadm: use dashes for container names

podman adds the current container name to the /etc/hosts
file. Turns out, python's `socket.getfqdn()` differs from
`hostname -f`, when we have the container names containing
dots in it.:

[root@sebastians-laptop /]# cat /etc/hosts
127.0.0.1   localhost
::1         localhost
127.0.1.1   sebastians-laptop foo.bar.baz.com
[root@sebastians-laptop /]# hostname -f
sebastians-laptop
[root@sebastians-laptop /]# python3 -c 'import socket; print(socket.getfqdn())'
foo.bar.baz.com

Fascinatingly, this doesn't happen when using dashes.

Fixes: https://tracker.ceph.com/issues/51590
Signed-off-by: Sebastian Wagner <sewagner@redhat.com>
src/cephadm/cephadm
src/cephadm/tests/fixtures.py
src/cephadm/tests/test_cephadm.py