untested addition of the condition and scale up and down function
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 4s

This commit is contained in:
pierre.geeraert
2026-09-14 10:44:41 +01:00
parent c8ceaab950
commit e2f49a5b1f
4 changed files with 18 additions and 4 deletions
+4 -1
View File
@@ -116,7 +116,8 @@ def retrieve_and_apply(verbose=False):
#check if the expected replica (server[2]) match the current replica of the deployment (server[3].actual_replica)
if server[3].actual_replica == server[2]:
if verbose : print("name: "+str(server[1])+" namespace: "+str(server[0])+" already UP")
#if server[3].do_not_touch_until is after now , do something
if server[3].do_not_touch_until > timezone.now():
if verbose : print("name: "+str(server[1])+" namespace: "+str(server[0])+" is in freeze period")
else:
echo = "Starting -> name: "+str(server[1])+" namespace: "+str(server[0])+" replicas: "+str(server[2])
output += str(echo)
@@ -133,6 +134,8 @@ def retrieve_and_apply(verbose=False):
#check if the current replica of the deployment (server[3].actual_replica) is already 0 meaning the server is already down
if server[3].actual_replica == 0:
if verbose : print("name: "+str(server[1])+" namespace: "+str(server[0])+" already DOWN")
if server[3].do_not_touch_until > timezone.now():
if verbose : print("name: "+str(server[1])+" namespace: "+str(server[0])+" is in freeze period")
else:
echo = "Shutting down -> name: "+str(server[1])+" namespace: "+str(server[0])+" replicas: "+str(server[2])