set preferred hypervisor

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2024-11-01 08:45:52 -05:00
parent f36c19f04f
commit 1a72fdceef
2 changed files with 5 additions and 2 deletions

4
add.go
View File

@ -125,6 +125,10 @@ func (c *NewCluster) AddDropletLocal(name string, hypername string) *Droplet {
Hostname: name,
}
d.LocalOnly = "yes on: " + hypername
// by default, on locally imported domains, set the preferred hypervisor!
d.PreferredHypervisor = hypername
d.Current = new(Current)
d.Current.Hypervisor = hypername
d.StartState = DropletState_OFF

View File

@ -110,11 +110,10 @@ func FormatDuration(d time.Duration) string {
}
func (d *Droplet) SprintHeader() string {
header := fmt.Sprintf("%-3.3s %-9.9s %-20.20s", d.Current.State, d.Current.Hypervisor, d.Hostname)
if d.Current == nil {
d.Current = new(Current)
}
header := fmt.Sprintf("%-3.3s %-9.9s %-20.20s", d.Current.State, d.Current.Hypervisor, d.Hostname)
switch d.Current.State {
case DropletState_ON: