Skip to content

Commit

Permalink
don't remove dkron server node if id matches
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan-kripakov-m10 committed Dec 20, 2023
1 parent 3ee19e9 commit cea31d6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ release:
-e DOCKER_USERNAME \
-e DOCKER_PASSWORD \
-e DOCKER_REGISTRY \
-e GORELEASER_CURRENT_TAG=v3.2.7-M4 \
-e GORELEASER_CURRENT_TAG=v3.2.7-M5 \
-v /var/run/docker.sock:/var/run/docker.sock \
goreleaser/goreleaser-cross:${GOLANG_CROSS_VERSION} \
release --rm-dist --skip-validate --timeout=1h
Expand Down
7 changes: 1 addition & 6 deletions dkron/leader.go
Original file line number Diff line number Diff line change
Expand Up @@ -285,17 +285,12 @@ func (a *Agent) addRaftPeer(m serf.Member, parts *ServerParts) error {
if server.Address == raft.ServerAddress(addr) && server.ID == raft.ServerID(parts.ID) {
return nil
}
future := a.raft.RemoveServer(server.ID, 0, 0)
if server.Address == raft.ServerAddress(addr) {
future := a.raft.RemoveServer(server.ID, 0, 0)
if err := future.Error(); err != nil {
return fmt.Errorf("error removing server with duplicate address %q: %s", server.Address, err)
}
a.logger.WithField("server", server.Address).Info("dkron: removed server with duplicate address")
} else {
if err := future.Error(); err != nil {
return fmt.Errorf("error removing server with duplicate ID %q: %s", server.ID, err)
}
a.logger.WithField("server", server.ID).Info("dkron: removed server with duplicate ID")
}
}
}
Expand Down

0 comments on commit cea31d6

Please sign in to comment.