Skip to content

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

@Vineeth-varma

Description

@Vineeth-varma

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions