Skip to content

Logic for splitting comma-separated inputs need to be fixed #555

@neelanjan00

Description

@neelanjan00

What happened: The comma-separated inputs are usually validated using a similar paradigm across all experiments:

instanceNamesList := strings.Split(experimentsDetails.VMInstanceName, ",")
if len(instanceNamesList) == 0 {
	return errors.Errorf("no instance name found to stop")
}

However, if the input string is an empty string then still the length of the resultant slice will be 1. Hence this check maybe simply updated with the following in all places:

if experimentsDetails.VMInstanceName == "" {
        return errors.Errorf("no instance name found to stop")
}

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions