-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CLI - Fix for CHE-3993 - Proper integer comparison #4028
Conversation
Signed-off-by: Tyler Jewell <tjewell@codenvy.com>
@@ -87,28 +87,30 @@ cmd_start_check_host_resources() { | |||
HOST_RAM=$(echo ${HOST_RAM#*:} | xargs) | |||
HOST_RAM=${HOST_RAM% *} | |||
|
|||
COMPARE=$(echo "$HOST_RAM<$CHE_MIN_RAM" | bc -l) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we could use awk so we don't need to add another tool inside the image
/ # awk 'BEGIN { print (1.543 >= 5.234) ? 0 : 1}'
1
/ # awk 'BEGIN { print (15.43 >= 5.234) ? 0 : 1}'
0
Signed-off-by: Tyler Jewell <tjewell@codenvy.com>
Per @benoitf request, I removed |
Build # 1895 - FAILED Please check console output at https://ci.codenvycorp.com/job/che-pullrequests-build/1895/ to view the results. |
* fix integer comparison Signed-off-by: Tyler Jewell <tjewell@codenvy.com>
Signed-off-by: Tyler Jewell tjewell@codenvy.com
What does this PR do?
This PR adds a function to the base CLI to use awk to do numerical comparisons. Our default function was having problems if the decimal place was in a different location, and this improvement makes it simpler to do these checks.
This check was being used when comparing RAM and disk sizes to minimums.
What issues does this PR fix or reference?
#3993
Changelog
Add awk function to do numerical comparisons in CLI but reverted by PR #4035.
Release Notes
N/A
Docs PR
N/A