fix(instance-metadata): Credentials recovering (#1207)

* fix(instance-metadata): Credentials recovering

* fix(expr): Dockerfile to root and expr in SESSION_TIME_REMAINING.

Co-authored-by: Pepe Fagoaga <pepe@verica.io>
Co-authored-by: sergargar <sergio@verica.io>
This commit is contained in:
Sergio Garcia
2022-06-17 14:23:56 +02:00
committed by GitHub
parent 3944ea2055
commit 633d7bd8a8
8 changed files with 46 additions and 23 deletions
+1 -1
View File
@@ -21,7 +21,7 @@ execute_check() {
# Following logic looks for time remaining in the session and review it
# if it is less than 600 seconds, 10 minutes.
CURRENT_TIMESTAMP=$(date -u "+%s")
SESSION_TIME_REMAINING=$(("${AWS_SESSION_EXPIRATION}" - "${CURRENT_TIMESTAMP}"))
SESSION_TIME_REMAINING=$(expr "${AWS_SESSION_EXPIRATION}" - "${CURRENT_TIMESTAMP}")
MINIMUM_REMAINING_TIME_ALLOWED=600
if (( "${MINIMUM_REMAINING_TIME_ALLOWED}" > "${SESSION_TIME_REMAINING}" )); then
# echo LESS THAN 10 MIN LEFT: RE-ASSUMING...