Skip to content

Commit

Permalink
feature: PaaS 部署适配(#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhuoZhuoCrayon committed Sep 17, 2021
1 parent 642612d commit 65a8ed8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions apps/gsekit/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def connect_signals():

@staticmethod
def fetch_esb_api_key():
from apps.api import EsbApi
from blueapps.utils import get_client_by_user
from apps.gsekit.meta.models import GlobalSettings

if settings.IS_LOCAL:
Expand All @@ -59,7 +59,8 @@ def fetch_esb_api_key():
print(message, flush=True)
logger.info(message)
else:
esb_result = EsbApi.get_api_public_key({"no_request": True})
client = get_client_by_user(user_or_username=settings.BK_ADMIN_USERNAME)
esb_result = client.esb.get_api_public_key()
if esb_result["result"]:
api_public_key = esb_result["data"]["public_key"]
settings.APIGW_PUBLIC_KEY = api_public_key
Expand Down
2 changes: 1 addition & 1 deletion blueking/component/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

APP_CODE = settings.APP_ID
SECRET_KEY = settings.APP_TOKEN
COMPONENT_SYSTEM_HOST = getattr(settings, "BK_PAAS_INNER_HOST", settings.BK_PAAS_HOST)
COMPONENT_SYSTEM_HOST = settings.BK_COMPONENT_API_URL
DEFAULT_BK_API_VER = getattr(settings, "DEFAULT_BK_API_VER", "v2")
except Exception:
APP_CODE = ""
Expand Down

0 comments on commit 65a8ed8

Please sign in to comment.