The attached script provides a function for comparing Kubernetes versions in shell script. It's possible for the script to validate itself by invoking it with TEST_SEMVER_COMP=1
:
$ TEST_SEMVER_COMP=1 semver.sh
a b exp act
v1.0 v1.0 0 0
v10.0 v1.0 1 1
v1.0 v10.0 255 255
v1.14 v1.14.alpha1 1 1