mirror of
https://github.com/certd/certd.git
synced 2026-04-23 19:57:27 +08:00
perf: 部署插件支持宝塔、易盾云等
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
export * from '@certd/plugin-cert';
|
||||
export * from '@certd/plugin-plus';
|
||||
export * from './plugin-aliyun/index.js';
|
||||
export * from './plugin-tencent/index.js';
|
||||
export * from './plugin-host/index.js';
|
||||
|
||||
+2
-2
@@ -31,8 +31,8 @@ export class TencentDnsProvider extends AbstractDnsProvider {
|
||||
},
|
||||
},
|
||||
};
|
||||
const dnspodSdk: any = await import('tencentcloud-sdk-nodejs/tencentcloud/services/dnspod/v20210323/index.js');
|
||||
const DnspodClient = dnspodSdk.Client;
|
||||
const dnspodSdk = await import('tencentcloud-sdk-nodejs/tencentcloud/services/dnspod/v20210323/index.js');
|
||||
const DnspodClient = dnspodSdk.v20210323.Client;
|
||||
// 实例化要请求产品的client对象,clientProfile是可选的
|
||||
this.client = new DnspodClient(clientConfig);
|
||||
}
|
||||
|
||||
@@ -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> {
|
||||
|
||||
+4
-3
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user