Skip to content

Conversation

@aditya3103
Copy link

What this PR does / why we need it:

This PR creates a function under stringutils which takes comma separated targetHostnames string as input and return formatted string which is expected by dns_interceptor binary

This removes manual effort from the user to enter a string with correct formatting

For example

experiment.targetHostnames = "Alice, Bob, Charlie" (string entered by user)
FormatHostnames(experiment.targetHostnames) = "["Alice", "Bob", "Charlie"]" (as expected by dns_interceptor binary)

As of now the experiment fails when a comma separated string value is passed from ChaosCenter.

Which issue this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged): fixes #

Special notes for your reviewer:

Checklist:

  • Fixes #
  • PR messages has document related information
  • Labelled this PR & related issue with breaking-changes tag
  • PR messages has breaking changes related information
  • Labelled this PR & related issue with requires-upgrade tag
  • PR messages has upgrade related information
  • Commit has unit tests
  • Commit has integration tests
  • E2E run Required for the changes

Copy link
Author

@aditya3103 aditya3103 left a comment

Choose a reason for hiding this comment

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

  • Moved validation to one level up - from helper binary to experiment binary
  • Ensured backward compatibility by checking for JSON string initially
  • Fallback method assumes comma separated string with appropriate error mechanism

@aditya3103
Copy link
Author

aditya3103 commented Jul 24, 2025

@neelanjan00 @ispeakc0de
I have updated as per the suggestion !

Edit: Any updates @neelanjan00 ?

aditya3103 and others added 14 commits December 9, 2025 20:25
Changed as per suggestion

Co-authored-by: Neelanjan Manna <[email protected]>
Signed-off-by: Aditya Sridasyam <[email protected]>
…ils (litmuschaos#753)

* test: add unit tests for RandStringBytesMask and GetRunID in stringutils

Signed-off-by: Prakhar-Shankar <[email protected]>

* fixing gofmt

Signed-off-by: Prakhar-Shankar <[email protected]>

---------

Signed-off-by: Prakhar-Shankar <[email protected]>
Signed-off-by: Aditya Sridasyam <[email protected]>
* test: add unit tests for retry.go in pkg/utils folder

Signed-off-by: Prakhar-Shankar <[email protected]>

* fixing gofmt

Signed-off-by: Prakhar-Shankar <[email protected]>

---------

Signed-off-by: Prakhar-Shankar <[email protected]>
Signed-off-by: Aditya Sridasyam <[email protected]>
…s#755)

* test: add unit tests for exec.go file in pkg/utils folder

Signed-off-by: Prakhar-Shankar <[email protected]>

* fixing gofmt

Signed-off-by: Prakhar-Shankar <[email protected]>

* creating table driven test and also updates TestCheckPodStatus

Signed-off-by: Prakhar-Shankar <[email protected]>

---------

Signed-off-by: Prakhar-Shankar <[email protected]>
Co-authored-by: Shubham Chaudhary <[email protected]>
Signed-off-by: Aditya Sridasyam <[email protected]>
* written test for workload.go in pkg/workloads

Signed-off-by: Prakhar-Shankar <[email protected]>

* checking go formatting

Signed-off-by: Prakhar-Shankar <[email protected]>

---------

Signed-off-by: Prakhar-Shankar <[email protected]>
Signed-off-by: Aditya Sridasyam <[email protected]>
…#757)

* chore: Fix typo in log statement

Signed-off-by: neelanjan00 <[email protected]>

* chore: adds multi-container stress chaos system with improved lifecycle management and better error handling

Signed-off-by: neelanjan00 <[email protected]>

---------

Signed-off-by: neelanjan00 <[email protected]>
Co-authored-by: Shubham Chaudhary <[email protected]>
Signed-off-by: Aditya Sridasyam <[email protected]>
…litmuschaos#766)

* chore: adds retries for k8s api operations

Signed-off-by: neelanjan00 <[email protected]>

* chore: adds retries for litmus api operations

Signed-off-by: neelanjan00 <[email protected]>

---------

Signed-off-by: neelanjan00 <[email protected]>
Signed-off-by: Aditya Sridasyam <[email protected]>
…set to true

Signed-off-by: Shubham Chaudhary <[email protected]>
Signed-off-by: Aditya Sridasyam <[email protected]>
@aditya3103
Copy link
Author

@neelanjan00 Sorry for the delay ! I have done the DCO, can you please merge this as per your convenience

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.

5 participants