From 3460de9e65875c989bab927ced6940ed278e8fe1 Mon Sep 17 00:00:00 2001 From: durant <826035498@qq.com> Date: Fri, 23 Feb 2024 17:02:54 +0800 Subject: [PATCH] =?UTF-8?q?fix(backend):=20=E4=B8=8A=E4=BC=A0=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E4=B8=BA=E7=A9=BA=E7=9A=84=E9=97=AE=E9=A2=98=20#3346?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dbm-ui/backend/dbm_init/medium/handlers.py | 18 +++++++++--------- helm-charts/bk-dbm/Chart.yaml | 4 ++-- helm-charts/bk-dbm/charts/dbconfig/Chart.yaml | 2 +- helm-charts/bk-dbm/charts/dbm/Chart.yaml | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/dbm-ui/backend/dbm_init/medium/handlers.py b/dbm-ui/backend/dbm_init/medium/handlers.py index b1dfe46c78..0b9480677f 100644 --- a/dbm-ui/backend/dbm_init/medium/handlers.py +++ b/dbm-ui/backend/dbm_init/medium/handlers.py @@ -9,7 +9,6 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -import hashlib import json import logging import os @@ -153,14 +152,15 @@ def upload_medium(self, path, bkrepo_tmp_dir): file_path_bkrepo = file_path.split(file_path.rsplit("/", 4)[0])[1] print("upload file: %s -> %s", file_path, file_path_bkrepo) with open(file_path, "rb") as f: - # 如果当前版本不存在,则更新介质 - if not self.storage.listdir(file_path_bkrepo.rsplit("/", 1)[0])[1]: - self.storage.save(file_path_bkrepo, f) - # 如果文件md5不相等,则更新介质 - bkrepo_file_md5 = self.storage.listdir(file_path_bkrepo.rsplit("/", 1)[0])[1][0]["md5"] - pkg_file_md5 = hashlib.md5(f.read()).hexdigest() - if bkrepo_file_md5 != pkg_file_md5: - self.storage.save(file_path_bkrepo, f) + # # 如果当前版本不存在,则更新介质 + # if not self.storage.listdir(file_path_bkrepo.rsplit("/", 1)[0])[1]: + # self.storage.save(file_path_bkrepo, f) + # # 如果文件md5不相等,则更新介质 + # bkrepo_file_md5 = self.storage.listdir(file_path_bkrepo.rsplit("/", 1)[0])[1][0]["md5"] + # pkg_file_md5 = hashlib.md5(f.read()).hexdigest() + # if bkrepo_file_md5 != pkg_file_md5: + # TODO:这里执行 f.read() 后再进行 storage.save 会导致上传到 bkrepo 的文件为空,待进一步排查 + self.storage.save(file_path_bkrepo, f) def sync_from_bkrepo(self, db_type): """将制品库文件同步到dbm""" diff --git a/helm-charts/bk-dbm/Chart.yaml b/helm-charts/bk-dbm/Chart.yaml index 014d692ae0..8edb4b1794 100644 --- a/helm-charts/bk-dbm/Chart.yaml +++ b/helm-charts/bk-dbm/Chart.yaml @@ -79,5 +79,5 @@ dependencies: description: A Helm chart for bk-dbm name: bk-dbm type: application -version: 1.3.0-alpha.38 -appVersion: 1.3.0-alpha.38 \ No newline at end of file +version: 1.3.0-alpha.39 +appVersion: 1.3.0-alpha.39 \ No newline at end of file diff --git a/helm-charts/bk-dbm/charts/dbconfig/Chart.yaml b/helm-charts/bk-dbm/charts/dbconfig/Chart.yaml index c690494f67..367ec525c0 100644 --- a/helm-charts/bk-dbm/charts/dbconfig/Chart.yaml +++ b/helm-charts/bk-dbm/charts/dbconfig/Chart.yaml @@ -1,5 +1,5 @@ apiVersion: v2 -appVersion: 0.0.1-alpha.77 +appVersion: 0.0.1-alpha.78 description: A Helm chart for dbconfig name: dbconfig type: application diff --git a/helm-charts/bk-dbm/charts/dbm/Chart.yaml b/helm-charts/bk-dbm/charts/dbm/Chart.yaml index 77df18d2a4..ada3861d75 100644 --- a/helm-charts/bk-dbm/charts/dbm/Chart.yaml +++ b/helm-charts/bk-dbm/charts/dbm/Chart.yaml @@ -1,5 +1,5 @@ apiVersion: v2 -appVersion: 1.3.0-alpha.428 +appVersion: 1.3.0-alpha.431 description: A Helm chart for dbm name: dbm type: application