Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ce7eac8e58 | |||
| 935e69b0e9 | |||
| cbc863b14c | |||
| 0eb0647992 | |||
| a725b66d14 | |||
| 851274954e | |||
| 770f55c8f1 | |||
| 188f0a765f | |||
| 634941a1ef | |||
| 1da505fd3d | |||
| 8d62bb0aae | |||
| e748babf08 | |||
| 71fafb1f21 |
+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.IsActive(), p.PublicAddresses...)
|
||||
err = mgr.AddHost(ctx, z.Name, p.ID, p.Active(), p.PublicAddresses...)
|
||||
return err != nil
|
||||
})
|
||||
|
||||
|
||||
@@ -44,8 +44,8 @@ func (m *Machine) FullName() string {
|
||||
return strings.Join(name, ".")
|
||||
}
|
||||
|
||||
// IsActive indicates the machine is to be included in regions' DNS entries
|
||||
func (m *Machine) IsActive() bool {
|
||||
// Active indicates the machine is to be included in regions' DNS entries
|
||||
func (m *Machine) Active() 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.IsActive() {
|
||||
if p.Active() {
|
||||
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.IsActive() {
|
||||
if p.Active() {
|
||||
err = p.RemoveFile("region")
|
||||
} else {
|
||||
err = p.WriteStringFile("none\n", "region")
|
||||
|
||||
+10
-8
@@ -54,23 +54,25 @@ func (pub PublicKey) String() string {
|
||||
// UnmarshalText loads the value from base64
|
||||
func (key *PrivateKey) UnmarshalText(b []byte) error {
|
||||
v, err := PrivateKeyFromBase64(string(b))
|
||||
if err != nil {
|
||||
switch {
|
||||
case 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))
|
||||
if err != nil {
|
||||
switch {
|
||||
case 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