Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4c07bf85d3 | |||
| d71dd99c15 | |||
| 135f098bf1 | |||
| f79123caee | |||
| 99998dc7e8 | |||
| 892d849740 | |||
| 242c1e9067 | |||
| 125a4c0dbe | |||
| 7c811d7813 |
+1
-1
@@ -52,7 +52,7 @@ func populateDNSManager(mgr *dns.Manager, m *cluster.Cluster) error {
|
||||
|
||||
m.ForEachZone(func(z *cluster.Zone) bool {
|
||||
z.ForEachMachine(func(p *cluster.Machine) bool {
|
||||
err = mgr.AddHost(ctx, z.Name, p.ID, p.Active(), p.PublicAddresses...)
|
||||
err = mgr.AddHost(ctx, z.Name, p.ID, p.IsActive(), p.PublicAddresses...)
|
||||
return err != nil
|
||||
})
|
||||
|
||||
|
||||
@@ -44,8 +44,8 @@ func (m *Machine) FullName() string {
|
||||
return strings.Join(name, ".")
|
||||
}
|
||||
|
||||
// Active indicates the machine is to be included in regions' DNS entries
|
||||
func (m *Machine) Active() bool {
|
||||
// IsActive indicates the machine is to be included in regions' DNS entries
|
||||
func (m *Machine) IsActive() bool {
|
||||
return !m.Inactive
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ func (r *Region) ForEachMachine(fn func(*Machine) bool) {
|
||||
var term bool
|
||||
|
||||
z.ForEachMachine(func(p *Machine) bool {
|
||||
if p.Active() {
|
||||
if p.IsActive() {
|
||||
term = fn(p)
|
||||
}
|
||||
return term
|
||||
@@ -178,7 +178,7 @@ func (z *Zone) SyncRegions() error {
|
||||
err := z.syncZoneRegions()
|
||||
if err == nil {
|
||||
z.ForEachMachine(func(p *Machine) bool {
|
||||
if p.Active() {
|
||||
if p.IsActive() {
|
||||
err = p.RemoveFile("region")
|
||||
} else {
|
||||
err = p.WriteStringFile("none\n", "region")
|
||||
|
||||
+8
-10
@@ -54,25 +54,23 @@ func (pub PublicKey) String() string {
|
||||
// UnmarshalText loads the value from base64
|
||||
func (key *PrivateKey) UnmarshalText(b []byte) error {
|
||||
v, err := PrivateKeyFromBase64(string(b))
|
||||
switch {
|
||||
case err != nil:
|
||||
if err != nil {
|
||||
return err
|
||||
default:
|
||||
*key = v
|
||||
return nil
|
||||
}
|
||||
|
||||
*key = v
|
||||
return nil
|
||||
}
|
||||
|
||||
// UnmarshalText loads the value from base64
|
||||
func (pub *PublicKey) UnmarshalText(b []byte) error {
|
||||
v, err := PublicKeyFromBase64(string(b))
|
||||
switch {
|
||||
case err != nil:
|
||||
if err != nil {
|
||||
return err
|
||||
default:
|
||||
*pub = v
|
||||
return nil
|
||||
}
|
||||
|
||||
*pub = v
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalJSON encodes the key for JSON, omitting empty.
|
||||
|
||||
Reference in New Issue
Block a user