k8s-iperf
k8s-iperf copied to clipboard
feat: Make the script work on non-GNU OS
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
gsedinstalled from the Homebrew coreutils package.
@kentwelcome @ctiml can this be merged?