diff --git a/src/pepr/operator/controllers/network/generators/kubeNodes.ts b/src/pepr/operator/controllers/network/generators/kubeNodes.ts index 6719dc6e9..25a1e936f 100644 --- a/src/pepr/operator/controllers/network/generators/kubeNodes.ts +++ b/src/pepr/operator/controllers/network/generators/kubeNodes.ts @@ -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();