Use a more lenient cluster config check (fixes #148)
This commit is contained in:
parent
e73b7e0398
commit
71684bfa45
@ -117,8 +117,6 @@ func compareClusterConfig(local, remote protocol.ClusterConfigMessage) error {
|
|||||||
if lflags&protocol.FlagShareBits != rflags&protocol.FlagShareBits {
|
if lflags&protocol.FlagShareBits != rflags&protocol.FlagShareBits {
|
||||||
return ClusterConfigMismatch(fmt.Errorf("remote has different sharing flags for node %q in repository %q", node, repo))
|
return ClusterConfigMismatch(fmt.Errorf("remote has different sharing flags for node %q in repository %q", node, repo))
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
return ClusterConfigMismatch(fmt.Errorf("remote is missing node %q in repository %q", node, repo))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -126,14 +124,8 @@ func compareClusterConfig(local, remote protocol.ClusterConfigMessage) error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for repo, rnodes := range rm {
|
for repo := range rm {
|
||||||
if lnodes, ok := lm[repo]; ok {
|
if _, ok := lm[repo]; !ok {
|
||||||
for node := range rnodes {
|
|
||||||
if _, ok := lnodes[node]; !ok {
|
|
||||||
return ClusterConfigMismatch(fmt.Errorf("remote has extra node %q in repository %q", node, repo))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
return ClusterConfigMismatch(fmt.Errorf("remote has extra repository %q", repo))
|
return ClusterConfigMismatch(fmt.Errorf("remote has extra repository %q", repo))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -103,7 +103,7 @@ var testcases = []struct {
|
|||||||
{ID: "bar"},
|
{ID: "bar"},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
err: `remote is missing node "a" in repository "foo"`,
|
err: "",
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
@ -130,7 +130,7 @@ var testcases = []struct {
|
|||||||
{ID: "bar"},
|
{ID: "bar"},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
err: `remote has extra node "b" in repository "foo"`,
|
err: "",
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user