Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
River2000i committed Dec 20, 2024
1 parent 1e887f8 commit 038f1fc
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions dm/loader/lightning.go
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,11 @@ func GetLightningConfig(globalCfg *lcfg.GlobalConfig, subtaskCfg *config.SubTask
}
cfg.TiDB.Security = &globalCfg.Security
if subtaskCfg.LoaderConfig.Security != nil {
// TODO: Just a workround for using SslContent cannot verify ceritificates when lightning use pdctl lib access PD server
// To avoid loss certificate files due to worker restart, rewrite the certificate files when getting the lightning configuration
if err := subtaskCfg.LoaderConfig.Security.WriteFiles(subtaskCfg.Name); err != nil {
return nil, err
}
cfg.Security.CABytes = cfg.Security.CABytes[:0]
cfg.Security.CertBytes = cfg.Security.CertBytes[:0]
cfg.Security.KeyBytes = cfg.Security.KeyBytes[:0]
Expand Down

0 comments on commit 038f1fc

Please sign in to comment.