perf: 部署插件支持宝塔、易盾云等

This commit is contained in:
xiaojunnuo
2024-08-30 18:50:53 +08:00
parent bee20c7f51
commit ee617095ef
22 changed files with 120 additions and 112 deletions
@@ -92,14 +92,14 @@ export class DeployToClbPlugin extends AbstractTaskPlugin {
accessId!: string;
client: any;
ClbClient: any;
async onInstance() {
this.client = await this.getClient();
}
async getClient() {
const sdk = await import('tencentcloud-sdk-nodejs/tencentcloud/services/clb/index.js');
const ClbClient = sdk.clb.v20180317.Client;
const sdk = await import('tencentcloud-sdk-nodejs/tencentcloud/services/clb/v20180317/index.js');
this.ClbClient = sdk.v20180317.Client;
const accessProvider = (await this.accessService.getById(this.accessId)) as TencentAccess;
@@ -117,7 +117,7 @@ export class DeployToClbPlugin extends AbstractTaskPlugin {
},
};
return new ClbClient(clientConfig);
return new this.ClbClient(clientConfig);
}
async execute(): Promise<void> {
@@ -88,12 +88,13 @@ export class DeployCertToTencentTKEIngressPlugin extends AbstractTaskPlugin {
})
cert!: any;
sdk: any;
TkeClient: any;
K8sClient: any;
async onInstance() {
// const TkeClient = this.tencentcloud.tke.v20180525.Client;
this.sdk = await import('tencentcloud-sdk-nodejs/tencentcloud/services/tke/v20220501/index.js');
const sdk = await import('tencentcloud-sdk-nodejs/tencentcloud/services/tke/v20220501/index.js');
this.TkeClient = sdk.v20220501.Client;
const k8sSdk = await import('@certd/lib-k8s');
this.K8sClient = k8sSdk.K8sClient;
}
@@ -139,7 +140,7 @@ export class DeployCertToTencentTKEIngressPlugin extends AbstractTaskPlugin {
},
};
return new this.sdk.Client(clientConfig);
return new this.TkeClient(clientConfig);
}
async getTkeKubeConfig(client: any, clusterId: string) {