1
0
mirror of https://github.com/lxc/incus.git synced 2026-02-05 09:46:19 +01:00

incus-user: Use shorter interrface name for long UIDs

Closes #972

Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
This commit is contained in:
Stéphane Graber
2024-07-10 01:43:07 -04:00
parent 86a599e3aa
commit 177e1601c5

View File

@@ -153,6 +153,11 @@ func serverInitialConfiguration(client incus.InstanceServer) error {
func serverSetupUser(uid uint32) error {
projectName := fmt.Sprintf("user-%d", uid)
networkName := fmt.Sprintf("incusbr-%d", uid)
if len(networkName) > 15 {
// For long UIDs, use a shorter slightly less descriptive interface name.
networkName = fmt.Sprintf("user-%d", uid)
}
userPath := internalUtil.VarPath("users", fmt.Sprintf("%d", uid))
// User account.