Skip to content

Commit

Permalink
feat(paas): add BK_API_URL_TMPL env var (#1089)
Browse files Browse the repository at this point in the history
  • Loading branch information
wklken authored Jun 8, 2023
1 parent 7af0369 commit c6e6bef
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 9 deletions.
2 changes: 1 addition & 1 deletion paas2/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.14.48
2.14.49
11 changes: 7 additions & 4 deletions paas2/paas/app/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@


from builtins import str

from django.conf import settings
from django.db import models
from django.db.models import Q
from django.conf import settings

from app.constants import AppStateEnum

Expand Down Expand Up @@ -59,6 +60,7 @@ def get_app_env(self, app_code, is_with_db_info=False):
"BK_PAAS_INNER_HOST": bk_paas_inner_host,
"BK_CC_HOST": bk_cc_host,
"BK_JOB_HOST": bk_job_host,
"BK_API_URL_TMPL": settings.BK_API_URL_TMPL,
}
# update envs in settings_*.py
envs.update(settings.APP_DEPLOY_ENVS)
Expand Down Expand Up @@ -92,8 +94,9 @@ def get_queryset(self):
重写 查询
"""
# PaaS3.0 上创建的应用和已经迁移到 PaaS3.0 的应用不在 PaaS2.0 上展示
return super(AppManager, self).get_queryset().filter(
is_sysapp=False, from_paasv3=False, migrated_to_paasv3=False)
return (
super(AppManager, self).get_queryset().filter(is_sysapp=False, from_paasv3=False, migrated_to_paasv3=False)
)

def query_app_list(self, user_app_list, keyword, hide_outline, is_saas, is_lapp, is_third, page, page_size):
start = (page - 1) * page_size
Expand Down Expand Up @@ -154,7 +157,7 @@ def get_target_tag_or_default(self, tag_name):
return self.get(name=tag_name)

try:
return self.get(name=u"其它")
return self.get(name="其它")
except Exception:
return None

Expand Down
10 changes: 6 additions & 4 deletions paas2/paas/conf/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import os
import sys
from django.utils.functional import SimpleLazyObject

from django.utils.functional import SimpleLazyObject

try:
import pymysql
Expand Down Expand Up @@ -157,7 +157,7 @@
STATIC_VERSION = "0.2.1"

# NOTE: SHOULD NOT CHANGE THIS LINE, WILL BE REPLACED WITH THE VERSION in pipeline
PLATFORM_VERSION = '2.0.0'
PLATFORM_VERSION = "2.0.0"

MEDIA_ROOT = os.path.join(PROJECT_ROOT, "media")
MEDIA_URL = "/media/"
Expand Down Expand Up @@ -222,8 +222,8 @@
# 避免循环引用
_ = lambda s: s # noqa
LANGUAGES = (
("en", _(u"English")),
("zh-hans", _(u"简体中文")),
("en", _("English")),
("zh-hans", _("简体中文")),
)
LANGUAGE_CODE = "zh-hans"
LANGUAGE_COOKIE_DOMAIN = SimpleLazyObject(
Expand Down Expand Up @@ -319,6 +319,8 @@
BK_APIGW_URL = ""
# API 网关文档中心地址
BK_APIGW_DOC_URL = ""
# 新版网关访问地址模板, e.g. http://bkapi.example.com/api/{api_name}
BK_API_URL_TMPL = ""

# HTTP CONNECTIONS
REQUESTS_POOL_CONNECTIONS = 20
Expand Down
3 changes: 3 additions & 0 deletions paas2/release.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
Release Log
===============================
# 2.14.49
- add: env var `BK_API_URL_TMPL` for all app

# 2.14.48
- update: esb update data, monitor_v3 confapis

Expand Down

0 comments on commit c6e6bef

Please sign in to comment.