Skip to content

Node drain Experiment is failing when passing multiple nodes with comma separated values. #739

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

Open
Vineeth-varma opened this issue Mar 5, 2025 · 1 comment

Comments

@Vineeth-varma
Copy link

Vineeth-varma commented Mar 5, 2025

Litmus Experiment - Node Drain is failing when passing multiple node name "NODE1,NODE2".
I observe there might be some code change required for node drain experiment to split comma separated nodes for the experiment to run successfully.

import "strings"

// Assuming `experimentsDetails.TargetNode` holds the comma-separated node names
nodes := strings.Split(experimentsDetails.TargetNode, ",")

for _, node := range nodes {
    trimmedNode := strings.TrimSpace(node)
    // Now perform the drain operation for each node
    log.Infof("Draining node: %s", trimmedNode)
    // You would likely call a function here that orchestrates the drain operation
    err := performNodeDrain(trimmedNode, clients)
    if err != nil {
        log.Errorf("Failed to drain node %s: %v", trimmedNode, err)
        // handle error, possibly abort or continue based on your requirements
    }
}

Maybe we need to add something like the above code in order to fix the issue, Please check and provide the fix as soon as possible.

@Vineeth-varma
Copy link
Author

#469

I have noticed this PR, but I'm wondering why it hasn't been merged into the master branch yet, especially since it pertains to an important Chaos Experiment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant