Skip to content

Commit

Permalink
Merge pull request #26 from AzisabaNetwork/fix/init-server
Browse files Browse the repository at this point in the history
🐛 Fixed initial servers not registering
  • Loading branch information
siloneco authored Dec 17, 2022
2 parents 602f87e + 4db96b2 commit 7487a37
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/main/java/net/azisaba/kuvel/KuvelServiceHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,12 @@ public void setAndRunServerDiscovery(@Nullable ServerDiscovery newServerDiscover
InetSocketAddress address = new InetSocketAddress(pod.getStatus().getPodIP(), 25565);
plugin.getProxy().registerServer(new ServerInfo(entry.getKey(), address));

String initialServerStr = pod.getMetadata().getLabels()
.getOrDefault(LabelKeys.INITIAL_SERVER.getKey(), "false");
if (Boolean.parseBoolean(initialServerStr)) {
initialServerNames.add(entry.getKey());
}

for (LoadBalancer loadBalancer : loadBalancerServerMap.values()) {
if (pod.hasOwnerReferenceFor(loadBalancer.getReplicaSetUid())) {
loadBalancer.addEndpoint(entry.getKey());
Expand Down

0 comments on commit 7487a37

Please sign in to comment.