fix: aliyun vod domain certificate handling

This commit is contained in:
Sheng Luo 2026-01-05 14:13:04 +08:00 committed by GitHub
parent de99f3b10f
commit 434fed40f2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -86,6 +86,14 @@ func (d *Deployer) SetLogger(logger *slog.Logger) {
}
func (d *Deployer) Deploy(ctx context.Context, certPEM, privkeyPEM string) (*deployer.DeployResult, error) {
// 上传证书
upres, err := d.sdkCertmgr.Upload(ctx, certPEM, privkeyPEM)
if err != nil {
return nil, fmt.Errorf("failed to upload certificate file: %w", err)
} else {
d.logger.Info("ssl certificate uploaded", slog.Any("result", upres))
}
// 获取待部署的域名列表
var domains []string
switch d.config.DomainMatchPattern {
@ -157,7 +165,7 @@ func (d *Deployer) Deploy(ctx context.Context, certPEM, privkeyPEM string) (*dep
case <-ctx.Done():
return nil, ctx.Err()
default:
if err := d.updateDomainCertificate(ctx, domain, certPEM, privkeyPEM); err != nil {
if err := d.updateDomainCertificate(ctx, domain, upres.CertId, upres.CertName); err != nil {
errs = append(errs, err)
}
}