untested addition of the condition and scale up and down function
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 4s
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 4s
This commit is contained in:
@@ -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])
|
||||
|
||||
Reference in New Issue
Block a user