mirror of
https://github.com/usual2970/certimate.git
synced 2025-06-08 05:29:51 +00:00
Merge pull request #625 from fondoger/fondoger/fix-volcengine
修复火山云证书上传获取空值的bug
This commit is contained in:
commit
94bd846726
@ -72,12 +72,17 @@ func (u *UploaderProvider) Upload(ctx context.Context, certPem string, privkeyPe
|
||||
}
|
||||
|
||||
var certId string
|
||||
if importCertificateResp.InstanceId != nil {
|
||||
if importCertificateResp.InstanceId != nil && *importCertificateResp.InstanceId != "" {
|
||||
certId = *importCertificateResp.InstanceId
|
||||
}
|
||||
if importCertificateResp.RepeatId != nil {
|
||||
if importCertificateResp.RepeatId != nil && *importCertificateResp.RepeatId != "" {
|
||||
certId = *importCertificateResp.RepeatId
|
||||
}
|
||||
|
||||
if certId == "" {
|
||||
return nil, xerrors.New("failed to get certificate id, both `InstanceId` and `RepeatId` are empty")
|
||||
}
|
||||
|
||||
return &uploader.UploadResult{
|
||||
CertId: certId,
|
||||
}, nil
|
||||
|
Loading…
x
Reference in New Issue
Block a user