Closed x22x22 closed 4 years ago
@x22x22 The current execution method of the killing process is to copy the chaosblade toolkit to the container for execution, so it is strongly dependent on commands such as ps. We can use the sidecar mode to run a container containing the chaosblade tool, reuse the pid namespace of the target container, and kill processes in the target container by the sidecar container, Similar to network scenarios.
@xcaspar I have looked at the source code before asking the question, and I know why this problem occurs. I mainly want to discuss the solution, I want to use "go-ps" or "gopsutil" to solve this problem, because they are directly calling the system's api to obtain the process Information. I wonder if you think it is feasible?
@x22x22 That is also a good solution, I think there is no problem. I assign the issue to you, thank you.
Issue Description
Type: bug report
Describe what happened
In a container environment, the image may not have a "ps" command (such as the amazoncorretto image), so I cannot use commands such as "blade create docker process kill" for chaos testing
Solution
I recommend introducing https://github.com/directly/mitchellh/go-ps or https://github.com/shirou/gopsutil to solve this problem, if you agree, I can contribute code, thank you