Commit 3331b27 1 parent 9f1c988 commit 3331b27 Copy full SHA for 3331b27
File tree 1 file changed +18
-0
lines changed
1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -867,6 +867,16 @@ func genTiProxySessionCerts(dir string) error {
867
867
}), "" )
868
868
}
869
869
870
+ func delTiProxySessionCerts (dir string ) error {
871
+ if err := os .Remove (filepath .Join (dir , "tiproxy-session.crt" )); err == nil {
872
+ return err
873
+ }
874
+ if err := os .Remove (filepath .Join (dir , "tiproxy-session.key" )); err == nil {
875
+ return err
876
+ }
877
+ return nil
878
+ }
879
+
870
880
// buildCertificateTasks generates certificate for instance and transfers it to the server
871
881
func buildCertificateTasks (
872
882
m * Manager ,
@@ -936,5 +946,13 @@ func buildCertificateTasks(
936
946
certificateTasks = append (certificateTasks , t )
937
947
}
938
948
})
949
+
950
+ if hasTiProxy {
951
+ // delete it, so tiup will generate a new cert next time to renew
952
+ if err := delTiProxySessionCerts (m .specManager .Path (name , spec .TempConfigPath )); err != nil {
953
+ return certificateTasks , err
954
+ }
955
+ }
956
+
939
957
return certificateTasks , iterErr
940
958
}
You can’t perform that action at this time.
0 commit comments