set always off if the replica was already 0
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 3s
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 3s
This commit is contained in:
@@ -17,8 +17,13 @@ def import_deployment():
|
||||
Schedule_Week_Always_off,Schedule_Week_Always_on = generate_default_week_schedule()
|
||||
|
||||
for deployment in deployment_list:
|
||||
#if the replicas is originally 0 , it means it is disabled so put the schedule as always off
|
||||
if deployment[2] == 0:
|
||||
schedule_object = Schedule_Day_Always_off
|
||||
else:
|
||||
schedule_object = Schedule_Day_Always_on
|
||||
if deployment[0]!="kube-system":
|
||||
Deployment_Data.objects.get_or_create(namespace=deployment[0],name=deployment[1],defaults={"replicas":deployment[2],"actual_replica":deployment[2],"schedule_day":Schedule_Day_Always_on,"schedule_week":Schedule_Week_Always_on})
|
||||
Deployment_Data.objects.get_or_create(namespace=deployment[0],name=deployment[1],defaults={"replicas":deployment[2],"actual_replica":deployment[2],"schedule_day":schedule_object,"schedule_week":Schedule_Week_Always_on})
|
||||
|
||||
|
||||
def generate_default_day_schedule():
|
||||
|
||||
Reference in New Issue
Block a user