[PSUPCLPL-15213]-Node_not_found_error_when_running_add_node_procedure #641
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
The issue is in the drain_nodes function where the condition if node_name in stdout incorrectly evaluates to true if node_name is a substring of one or more active node names in the cluster.
*
Fixes # (PSUPCLPL-15213)
Solution
To address this issue, modified the condition to ensure that it checks for exact matches rather than substring matches. We can achieve this by splitting the stdout into lines and then checking if node_name exactly matches any line in the output.
*
Test Cases
TestCase 1
Test Configuration:
Steps:
Example - There is already a node in the cluster with name test-worker-3-10 and then try to add a new node with name test-worker-3-1
Results:
Error from server (NotFound): nodes "test-worker-3-1" not found
Checklist
Unit tests
Indicate new or changed unit tests and what they do, if any.