From 9c5d826c4ac3b8bc686b438882df6f635d660eb9 Mon Sep 17 00:00:00 2001 From: Alejandro Mery Date: Mon, 29 Jul 2024 15:50:20 +0000 Subject: [PATCH] cluster: drop wg1 Signed-off-by: Alejandro Mery --- pkg/cluster/errors.go | 2 +- pkg/cluster/rings.go | 10 ---------- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/pkg/cluster/errors.go b/pkg/cluster/errors.go index 71c133f..d34bfce 100644 --- a/pkg/cluster/errors.go +++ b/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) } diff --git a/pkg/cluster/rings.go b/pkg/cluster/rings.go index 161f4a5..721fdcf 100644 --- a/pkg/cluster/rings.go +++ b/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, } )