Skip to content

Commit

Permalink
conditionally remove nodes if they are updated, but not ready
Browse files Browse the repository at this point in the history
Signed-off-by: catsby <[email protected]>
  • Loading branch information
catsby committed Dec 13, 2024
1 parent 7bea9ca commit b0d27d9
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,13 @@ export async function updateKubeNodesFromCreateUpdate(node: kind.Node) {
(condition: V1NodeCondition) => condition.type === "Ready" && condition.status === "True",
);

const ip = getNodeInternalIP(node);
if (isReady) {
const ip = getNodeInternalIP(node);
if (ip) nodeSet.add(ip);
} else {
// it's possible that the node is not ready, but it has an IP, so we remove
// it for now
if (ip) nodeSet.delete(ip);
}

await updateKubeNodesNetworkPolicies();
Expand Down

0 comments on commit b0d27d9

Please sign in to comment.