修复部署验收回归问题

This commit is contained in:
xuans committed 2026-09-22 06:33:03 +08:00
1 parent 6c35fcffc2
commit 5ad2b9d63b
3 files changed
+61 -27

No files matched your search

+16 -18
View File
@@ -149,28 +149,26 @@ func pruneManagedSSLLocked(root string, protected []SSLConfig) error {
}
// 磁盘引用也必须保留,避免其他管理器实例或已提交未发布的候选被删除。
configRoot, err := os.OpenRoot(filepath.Join(root, "config"))
if err != nil {
if os.IsNotExist(err) {
return nil
}
return err
}
data, err := configRoot.ReadFile("ssl.json")
_ = configRoot.Close()
if err == nil {
var section SSLSectionConfig
if err := ParseStrict(data, &section); err != nil {
return err
}
if section.TLS.CertificateRef != "" {
protected = append(protected, section.TLS)
reference, err := resolveManagedSSLPathsAtRoot(root, section.TLS)
if err != nil {
data, readErr := configRoot.ReadFile("ssl.json")
_ = configRoot.Close()
if readErr == nil {
var section SSLSectionConfig
if err := ParseStrict(data, &section); err != nil {
return err
}
if legacyManagedSSLReference(section.TLS.CertificateRef) {
keep[filepath.Dir(reference.CertificatePath)] = true
if section.TLS.CertificateRef != "" {
protected = append(protected, section.TLS)
reference, err := resolveManagedSSLPathsAtRoot(root, section.TLS)
if err != nil {
return err
}
if legacyManagedSSLReference(section.TLS.CertificateRef) {
keep[filepath.Dir(reference.CertificatePath)] = true
}
}
} else if !os.IsNotExist(readErr) {
return readErr
}
} else if !os.IsNotExist(err) {
return err