Skip to content

Commit 79e1a22

Browse files
committed
Only add the node if it is new.
1 parent 93744ca commit 79e1a22

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/OpenCloud/LoadBalancer/Resource/LoadBalancer.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,11 @@ public function addNodes()
246246
$requests = array();
247247

248248
foreach ($this->nodes as $node) {
249-
$requests[] = $this->getClient()->post($node->getUrl(), self::getJsonHeader(), $node->createJson());
249+
// Only add the node if it is new
250+
if (null === $node->getId()) {
251+
$json = json_encode($node->createJson());
252+
$requests[] = $this->getClient()->post($node->getUrl(), self::getJsonHeader(), $json);
253+
}
250254
}
251255

252256
return $this->getClient()->send($requests);

0 commit comments

Comments
 (0)