From 4a5fb9a0ca25132f54ff546422a32a831fbfc207 Mon Sep 17 00:00:00 2001 From: Dioni Zhong Date: Wed, 14 Jul 2021 09:46:07 +0100 Subject: [PATCH] fix: fix local run (intro in #1556) (#1558) * fix: fix local run (intro in #1556) * turn off loading kube conf on migration * Merge branch 'development' into fixlocal * fix the env var check * fix: disable load kube config on cypress run * Merge branch 'development' into fixlocal --- aimmo_runner/runner.py | 3 ++- example_project/manage.py | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/aimmo_runner/runner.py b/aimmo_runner/runner.py index 3f7ee19a2..165264e4f 100644 --- a/aimmo_runner/runner.py +++ b/aimmo_runner/runner.py @@ -84,7 +84,8 @@ def run( if using_cypress: settings.DEBUG = False - os.environ["RUNNING_TESTS"] = "True" + os.environ["LOAD_KUBE_CONFIG"] = "0" + os.environ["NODE_ENV"] = "development" if settings.DEBUG else "production" build_frontend(using_cypress, capture_output) diff --git a/example_project/manage.py b/example_project/manage.py index 79b34c600..562fa229c 100755 --- a/example_project/manage.py +++ b/example_project/manage.py @@ -2,6 +2,8 @@ import os import sys +from kubernetes.config import load_kube_config + if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "example_project.settings") @@ -11,4 +13,7 @@ logging.basicConfig() + if os.environ.get("LOAD_KUBE_CONFIG", "1") == "1": + load_kube_config(context="agones") + execute_from_command_line(sys.argv)