]> git.apps.os.sepia.ceph.com Git - ceph.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>
Tue, 10 Aug 2021 14:36:32 +0000 (16:36 +0200)
commit00cc31d254520fc66f183d6eba23e3f049b75832
tree6708e8292330fb34fcc6c868915a61a726a086d1
parent3c0804fe898b9ceb6d9995da6bfa7cde9c11c0af
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>
(cherry picked from commit 67abea15b12c1a60a9da2db35e3470d8d8a128f7)
src/cephadm/cephadm
src/cephadm/tests/fixtures.py
src/cephadm/tests/test_cephadm.py