tka: make storage a parameter rather than an Authority struct member
Updates #5435 Based on the discussion in #5435, we can better support transactional data models by making the underlying storage layer a parameter (which can be specialized for the request) rather than a long-lived member of Authority. Now that Authority is just an instantaneous snapshot of state, we can do things like provide idempotent methods and make it cloneable, too. Signed-off-by: Tom DNetto <tom@tailscale.com>
This commit is contained in:
+2
-2
@@ -376,7 +376,7 @@ func TestAuthorityInformNonLinear(t *testing.T) {
|
||||
// and forcing Inform() to take the slow path.
|
||||
informAUMs := []AUM{c.AUMs["L1"], c.AUMs["L2"], c.AUMs["L3"], c.AUMs["L4"], c.AUMs["L5"]}
|
||||
|
||||
if err := a.Inform(informAUMs); err != nil {
|
||||
if err := a.Inform(storage, informAUMs); err != nil {
|
||||
t.Fatalf("Inform() failed: %v", err)
|
||||
}
|
||||
for i, update := range informAUMs {
|
||||
@@ -419,7 +419,7 @@ func TestAuthorityInformLinear(t *testing.T) {
|
||||
|
||||
informAUMs := []AUM{c.AUMs["L1"], c.AUMs["L2"], c.AUMs["L3"]}
|
||||
|
||||
if err := a.Inform(informAUMs); err != nil {
|
||||
if err := a.Inform(storage, informAUMs); err != nil {
|
||||
t.Fatalf("Inform() failed: %v", err)
|
||||
}
|
||||
for i, update := range informAUMs {
|
||||
|
||||
Reference in New Issue
Block a user