-
Notifications
You must be signed in to change notification settings - Fork 140
Open
Description
Description
Following the merge of PR #785, which introduced the stringutils.SplitList utility, this issue tracks the refactoring of existing experiment logic to utilize this new function.
Context
Currently, many experiments use strings.Split(val, ",") directly to parse comma-separated lists (e.g., TARGET_PODS, TARGET_NODES). This approach is fragile and prone to errors when dealing with:
- Empty strings (returning a slice of length 1 containing an empty string).
- Trailing commas.
- Inconsistent spacing.
This was originally highlighted in Issue #555.
Goal
Refactor the codebase to replace fragile inline splitting with the robust stringutils.SplitList utility.
Scope of Changes
The refactor will target comma-separated list parsing in the following areas:
- Chaos Libraries:
chaoslib/litmus/...(e.g., Network Chaos, Node Drain, AWS/Azure/GCP experiments). - Cloud Packages:
pkg/cloud/...(Cloud provider status checks and helpers). - Probes & Utilities:
pkg/probe/...andpkg/utils/....
Acceptance Criteria
- All identified instances of
strings.Splitfor comma-separated lists are replaced withstringutils.SplitList. - Import paths are updated to include
github.com/litmuschaos/litmus-go/pkg/utils/stringutils. go mod tidyis run to clean up dependencies.- Existing tests pass.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels