Browse Source

zones: introduce Machine.FullName()

Signed-off-by: Alejandro Mery <amery@jpi.io>
pull/1/head
Alejandro Mery 1 year ago
parent
commit
5f924dcb00
  1. 15
      pkg/zones/machine.go

15
pkg/zones/machine.go

@ -2,6 +2,7 @@ package zones
import (
"strconv"
"strings"
"sync"
)
@ -38,3 +39,17 @@ func (m *Machine) ID() int {
return m.id
}
// FullName returns the Name of the machine including domain name
func (m *Machine) FullName() string {
if domain := m.zone.zones.domain; domain != "" {
var s = []string{
m.Name,
domain,
}
return strings.Join(s, ".")
}
return m.Name
}

Loading…
Cancel
Save