def _inject_bcs_info(self, yaml_content, inject_configs): resources = bcs_info_injector.parse_manifest(yaml_content) context = {"creator": self.username, "updator": self.username, "version": self.show_version.name} manager = bcs_info_injector.InjectManager(configs=inject_configs, resources=resources, context=context) resources = manager.do_inject() self._set_namespace(resources) return bcs_info_injector.join_manifest(resources)
def _inject_bcs_info(self, yaml_content, inject_configs): resources = self._parse_yaml(yaml_content) context = { 'creator': self.username, 'updator': self.username, 'version': self.show_version.name } manager = bcs_info_injector.InjectManager(configs=inject_configs, resources=resources, context=context) resources = manager.do_inject() self._set_namespace(resources) return self._join_manifest(resources)
def _inject_bcs_info(self, manifest: str, inject_configs: List[Dict]) -> List[Dict]: """注入系统配置""" # parse_manifest按照yaml分隔符---分割成列表 manifest_list = bcs_info_injector.parse_manifest(manifest) context = { 'creator': self.res_ctx.username, 'updator': self.res_ctx.username, 'version': self.res_ctx.show_version.name, } manager = bcs_info_injector.InjectManager(configs=inject_configs, resources=manifest_list, context=context) return manager.do_inject()