Skip to content

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 #762

Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
  • Loading branch information
stgraber committed May 27, 2024
1 parent 119726f commit e004041
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 e004041

Please sign in to comment.