Skip to content
/ incus Public
forked from lxc/incus

Commit

Permalink
incusd/loki: Use hostname as default instance property on standalone …
Browse files Browse the repository at this point in the history
…systems

Closes lxc#762

Signed-off-by: Stéphane Graber <[email protected]>
  • Loading branch information
stgraber committed Apr 17, 2024
1 parent dc8e927 commit f7312aa
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion cmd/incusd/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,16 @@ func (d *Daemon) setupLoki(URL string, cert string, key string, caCert string, i

// Figure out the instance name.
if instanceName == "" {
instanceName = d.serverName
if d.serverClustered {
instanceName = d.serverName
} else {
hostname, err := os.Hostname()
if err != nil {
return err
}

instanceName = hostname
}
}

// Start a new client.
Expand Down

0 comments on commit f7312aa

Please sign in to comment.