Skip to content

Commit d23a2fd

Browse files
committed
fix for agency leader discovery
1 parent 289fdcc commit d23a2fd

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pkg/deployment/agency/cache.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,10 @@ func getLeader(ctx context.Context, clients []agency.Agency) (agency.Agency, *ag
237237
}
238238
wg.Wait()
239239

240+
if anyError != nil {
241+
return nil, nil, nil, wrapError(anyError, "not all agencies are responsive")
242+
}
243+
240244
if len(leaders) == 0 {
241245
return nil, nil, nil, wrapError(anyError, "failed to get config from agencies")
242246
}
@@ -259,7 +263,7 @@ func getLeader(ctx context.Context, clients []agency.Agency) (agency.Agency, *ag
259263

260264
// From here on, a leader with quorum is known.
261265
for i, config := range configs {
262-
if config != nil && config.LeaderId == leaderID {
266+
if config != nil && config.Configuration.ID == leaderID {
263267
return clients[i], config, h, nil
264268
}
265269
}

0 commit comments

Comments
 (0)