Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PSUPCLPL-15213]-Node_not_found_error_when_running_add_node_procedure #641

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading