Skip to content

Commit

Permalink
Merge pull request #641 from Netcracker/PSUPCLPL-15213_Node_not_found…
Browse files Browse the repository at this point in the history
…_error_when_running_add_node_procedure

[PSUPCLPL-15213]-Node_not_found_error_when_running_add_node_procedure
  • Loading branch information
koryaga authored Apr 17, 2024
2 parents 680bff7 + 78a7662 commit 2b94bfd
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions kubemarine/kubernetes/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,11 @@ def drain_nodes(group: NodeGroup, disable_eviction: bool = False,

for node in group.get_ordered_members_list():
node_name = node.get_node_name()
if node_name in stdout:

# Split stdout into lines
stdout_lines = stdout.split('\n')[1:]
# Check if node_name exactly matches any line
if node_name in stdout_lines:
log.debug("Draining node %s..." % node_name)
drain_cmd = prepare_drain_command(
cluster, node_name,
Expand All @@ -299,7 +303,11 @@ def delete_nodes(group: NodeGroup) -> RunnersGroupResult:

for node in group.get_ordered_members_list():
node_name = node.get_node_name()
if node_name in stdout:

# Split stdout into lines
stdout_lines = stdout.split('\n')[1:]
# Check if node_name exactly matches any line
if node_name in stdout_lines:
log.debug("Deleting node %s from the cluster..." % node_name)
control_plane.sudo("kubectl delete node %s" % node_name, hide=False)
else:
Expand Down

0 comments on commit 2b94bfd

Please sign in to comment.