Skip to content

Commit 45cfa9a

Browse files
committed
update clb certificate sdk version
1 parent 3f7a143 commit 45cfa9a

File tree

4 files changed

+29
-6
lines changed

4 files changed

+29
-6
lines changed

CHANGELOG.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ FEATURES:
77
* **New Data Source**: `tencentcloud_ssm_secrets`
88
* **New Data Source**: `tencentcloud_ssm_secret_versions`
99

10+
ENHANCEMENTS:
11+
12+
* Resource: `tencentcloud_ssl_certificate` refactor logic with api3.0 .
13+
* Data Source: `tencentcloud_ssl_certificates` refactor logic with api3.0 .
14+
1015
## 1.54.1 (March 24, 2021)
1116

1217
ENHANCEMENTS:
@@ -29,10 +34,6 @@ ENHANCEMENTS:
2934
* Resource `tencentcloud_kubernetes_node_pool` add `unschedulable` to sets whether the joining node participates in the schedule.
3035
* Resource `tencentcloud_kubernetes_scale_worker` add `unschedulable` to sets whether the joining node participates in the schedule.
3136

32-
BUG FIXES:
33-
34-
* Resource `tencentcloud_ssl_certificate` fix bug when trying to destroy a certificate associated with multiple resources.
35-
3637
## 1.53.9 (March 19, 2021)
3738

3839
ENHANCEMENTS:

tencentcloud/service_tencent_ssl_certificate.go

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,3 +244,25 @@ func (me *SSLService) DescribeCertificates(ctx context.Context, request *ssl.Des
244244

245245
return
246246
}
247+
248+
func (me *SSLService) checkCertificateType(ctx context.Context, certId string, checkType string) (bool, error) {
249+
250+
//get certificate by id
251+
252+
request := ssl.NewDescribeCertificateDetailRequest()
253+
request.CertificateId = helper.String(certId)
254+
certificate, err := me.DescribeCertificateDetail(ctx, request)
255+
if err != nil {
256+
return false, err
257+
}
258+
259+
if certificate != nil && certificate.Response != nil && *certificate.Response.CertificateType == checkType {
260+
return true, nil
261+
} else {
262+
if certificate == nil || certificate.Response == nil || certificate.Response.CertificateId == nil {
263+
return false, fmt.Errorf("certificate id %s is not found", certId)
264+
}
265+
return false, nil
266+
}
267+
268+
}

tencentcloud/service_tencentcloud_clb.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -946,7 +946,7 @@ func checkCertificateInputPara(ctx context.Context, d *schema.ResourceData, meta
946946
certPara = &certificateInput
947947

948948
//check type valid
949-
sslService := SslService{client: meta.(*TencentCloudClient).apiV3Conn}
949+
sslService := SSLService{client: meta.(*TencentCloudClient).apiV3Conn}
950950

951951
if certificateInput.CertCaId != nil {
952952
check, err := sslService.checkCertificateType(ctx, *certificateInput.CertCaId, SSL_CERT_TYPE_CA)

tencentcloud/service_tencentcloud_ssl.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ func (me *SslService) DeleteCertificate(ctx context.Context, id string) error {
212212
return nil
213213
}
214214

215-
func (me *SslService) checkCertificateType(ctx context.Context, certId string, checkType string) (bool, error) {
215+
func (me *SslService) CheckCertificateType(ctx context.Context, certId string, checkType string) (bool, error) {
216216

217217
//get certificate by id
218218

0 commit comments

Comments
 (0)