]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
mgr/cephadm: enforce that a host is a valid DNS name
authorSage Weil <sage@redhat.com>
Wed, 5 Feb 2020 17:19:59 +0000 (11:19 -0600)
committerSage Weil <sage@redhat.com>
Wed, 5 Feb 2020 18:49:49 +0000 (12:49 -0600)
commit93dba1e711067e9853d0d0ae8c630dadac08948e
tree6659455bb6b899fc8fe89ac8bd519cbfb88ba356
parent7a1439a368d2828bdea5e1817aa4d4c72686cbdf
mgr/cephadm: enforce that a host is a valid DNS name

This combines the hostname restrictions

 * 1-63 chars
 * a-z, A-Z, 0-9, -

and the DNS name restrictions

 * .-delimited
 * no empty components (or leading or trailing .)
 * 250 chars total max

Note that this allows bare IPv4 addresses (which are indistinguishable from
a valid DNS name, AFAICS), but disallows bare IPv6 addresses.

Signed-off-by: Sage Weil <sage@redhat.com>
src/pybind/mgr/cephadm/module.py