Skip to content

Conversation

@kartikaysaxena
Copy link

fixes #555
Added check logic before split function

return errors.Errorf("no instance id found for chaos injection")
}
instanceIDList := strings.Split(experimentsDetails.EC2InstanceID, ",")
if experimentsDetails.EC2InstanceID == "" || len(instanceIDList) == 0 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check is redundant now, please check in other places too. Also, we should handle an edge case where the input contains only one or more commas. For example, strings.Split of "," will give us a string slice containing two whitespaces.

Signed-off-by: Kartikay <[email protected]>
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

Successfully merging this pull request may close these issues.

Logic for splitting comma-separated inputs need to be fixed

2 participants