k8s-iperf icon indicating copy to clipboard operation
k8s-iperf copied to clipboard

feat: Make the script work on non-GNU OS

Open geekifier opened this issue 8 months ago • 1 comments

Summary of changes

This PR makes the script work on MacOS (and other non-GNU systems) by avoiding the usage of the GNU sed specific -s parameter.

The -s is actually not even necessary in this case. I also removed the cat command, which was not needed, as sed will read the file itself, and pipe it forward like before.

The other two (optional) commits clean up some trailing whitespace and add the node name to the status message.

before:

$ ./k8s-iperf tinykube01
[Start] iperf server
sed: illegal option -- s

After:

$ ./k8s-iperf tinykube01
[Start] iperf server on tinykube01
deployment.apps/iperf-server-deployment created

Testing

  • Tested by invoking the script on MacOS using the BSD
  • Also ran the script with gsed installed from the Homebrew coreutils package.

geekifier avatar Mar 27 '25 20:03 geekifier

@kentwelcome @ctiml can this be merged?

geekifier avatar Apr 26 '25 02:04 geekifier