perf: 创建k8s secret 时设置type为tls

v2
xiaojunnuo 2025-09-05 21:32:34 +08:00
parent 0c8e3262fe
commit 79ebabfcfb
1 changed files with 7 additions and 1 deletions

View File

@ -119,7 +119,13 @@ export class K8sClient {
this.logger.warn(`secret ${secretName} 不存在`);
if (opts.createOnNotFound) {
//没有找到,则创建
const res = await this.createSecret({ namespace, body: opts.body });
const body = merge(
{
type: "type: kubernetes.io/tls",
},
opts.body
);
const res = await this.createSecret({ namespace, body });
this.logger.info(`secret ${secretName} 已创建`);
return res;
}