I’ve hit a bit of snag in implementing CRI for LXD. When running the validation suite more than half the tests are failing with
Container name isn't a valid hostname.
This is because the names that validation suite generates are >64 characters. Because the name isn’t really a name, but more an ID…
To quote the Kubernetes docs on that matter:
By convention, the names of Kubernetes resources should be up to maximum length of 253 characters and consist of lower case alphanumeric characters,
., but certain resources have more specific restrictions.
so now i’m wondering if there’s any sensible way to do this. Especially since
lxc itself does not seem to automatically set the container name as hostname.
As far as the LXD API is concerned, I know i can store the id as
Config["user.id"] — but there’s no easy way to retrieve this, which makes operations (that require reverse-mapping) such as
ContainerState(<name NOT id>) tricky.