Skip to content

[BUG] init_official_plugins 命令支持第三方存储 #708

@ZhuoZhuoCrayon

Description

@ZhuoZhuoCrayon

问题描述
init_official_plugins 命令支持第三方存储

实现参考

  • 问题:主要是在 apps/backend/management/commands/init_official_plugins.py Line 59 models.UploadPackage.create_record 时,file_path 仍为本地文件路径
  • 参考 apps/backend/plugin/handler.py upload 方法,将文件上传到 storage,将得到的 file_path 进行记录
file_path = storage.save(name=os.path.join(settings.UPLOAD_PATH, origin_file_name), content=fs)
  • 这样,tools.create_package_records 就可以从 storage 中读取文件

请提供以下信息

  • bk-nodeman 版本 (发布版本号 或 git tag): V2.2.11
  • 蓝鲸PaaS 版本:
  • bk-nodeman 异常日志:

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions