Browse Source

cluster: drop wg1.conf generation

Signed-off-by: Alejandro Mery <amery@jpi.io>
pull/58/head
Alejandro Mery 5 months ago
parent
commit
9810f5c6c1
  1. 2
      pkg/cluster/errors.go
  2. 10
      pkg/cluster/rings.go

2
pkg/cluster/errors.go

@ -25,5 +25,5 @@ var (
// ErrInvalidRing returns an error indicating the [rings.RingID]
// can't be used for the intended purpose
func ErrInvalidRing(ringID rings.RingID) error {
return core.QuietWrap(fs.ErrInvalid, "invalid ring %v", ringID)
return core.QuietWrap(fs.ErrInvalid, "invalid ring %v", ringID-1)
}

10
pkg/cluster/rings.go

@ -27,8 +27,6 @@ func AsWireguardInterfaceID(ring rings.RingID) (WireguardInterfaceID, error) {
switch ring {
case rings.RingZeroID:
return 0, nil
case rings.RingOneID:
return 1, nil
default:
return 0, ErrInvalidRing(ring)
}
@ -148,17 +146,9 @@ var (
Decode: rings.DecodeRingZeroAddress,
Encode: rings.RingZeroAddress,
}
// RingOne is a wg1 address encoder/decoder
RingOne = RingAddressEncoder{
ID: rings.RingOneID,
Port: RingOnePort,
Decode: rings.DecodeRingOneAddress,
Encode: rings.RingOneAddress,
}
// Rings provides indexed access to the ring address encoders
Rings = []RingAddressEncoder{
RingZero,
RingOne,
}
)

Loading…
Cancel
Save