فهرست منبع

Allow repo mismatches to proceed (ref #223)

Jakob Borg 11 سال پیش
والد
کامیت
5369a62fd5
3فایلهای تغییر یافته به همراه3 افزوده شده و 11 حذف شده
  1. 1 1
      config/config.go
  2. 2 1
      model/model.go
  3. 0 9
      model/util.go

+ 1 - 1
config/config.go

@@ -244,7 +244,7 @@ func Load(rd io.Reader, myID string) (Configuration, error) {
 		repo := &cfg.Repositories[i]
 
 		if len(repo.Directory) == 0 {
-			repo.Invalid = "empty directory"
+			repo.Invalid = "no directory configured"
 			continue
 		}
 

+ 2 - 1
model/model.go

@@ -275,7 +275,8 @@ func (m *Model) Index(nodeID string, repo string, fs []protocol.FileInfo) {
 	if r, ok := m.repoFiles[repo]; ok {
 		r.Replace(id, files)
 	} else {
-		l.Warnf("Index from %s for nonexistant repo %q; dropping", nodeID, repo)
+		l.Warnf("Index from %s for unexpected repo %q; verify configuration", nodeID, repo)
+
 	}
 	m.rmut.RUnlock()
 }

+ 0 - 9
model/util.go

@@ -81,17 +81,8 @@ func compareClusterConfig(local, remote protocol.ClusterConfigMessage) error {
 					}
 				}
 			}
-		} else {
-			return ClusterConfigMismatch(fmt.Errorf("remote is missing repository %q", repo))
 		}
 	}
 
-	for repo := range rm {
-		if _, ok := lm[repo]; !ok {
-			return ClusterConfigMismatch(fmt.Errorf("remote has extra repository %q", repo))
-		}
-
-	}
-
 	return nil
 }