Closed ashutosrath closed 2 months ago
Getting below error while running ./agent-install.sh in macosx bash shell
./agent-install.sh: line 1562: -1: substring expression < 0
kubectl version -o json { "clientVersion": { "major": "1", "minor": "27", "gitVersion": "v1.27.2", "gitCommit": "7f6f68fdabc4df88cfea2dcf9a19b2b830f1e647", "gitTreeState": "clean", "buildDate": "2023-05-17T14:20:07Z", "goVersion": "go1.20.4", "compiler": "gc", "platform": "darwin/amd64" }, "kustomizeVersion": "v5.0.1", "serverVersion": { "major": "1", "minor": "29+", "gitVersion": "v1.29.4-eks-036c24b", "gitCommit": "9c0e57823b31865d0ee095997d9e7e721ffdc77f", "gitTreeState": "clean", "buildDate": "2024-04-30T23:53:58Z", "goVersion": "go1.21.9", "compiler": "gc", "platform": "linux/amd64" } } WARNING: version difference between client (1.27) and server (1.29) exceeds the supported minor version skew of +/-1
here the minor_version is calculated as
minor_version
echo $minor_version 29+
MacOSX bash returns substring expression < 0 error if we calculate as
minor_version=${minor_version::-1}
Fix needs to be like below
minor_version=${minor_version::$((${#minor_version} - 1))}
the min_version should have properly calculated
No response
mac osx x86
Describe the bug.
Getting below error while running ./agent-install.sh in macosx bash shell
Describe the steps to reproduce the behavior.
here the
minor_version
is calculated asMacOSX bash returns substring expression < 0 error if we calculate as
Fix needs to be like below
Expected behavior.
the min_version should have properly calculated
Screenshots.
No response
Operating Environment
mac osx x86
Additional Information
No response