mirror of
https://git.vectorsigma.ru/public/k3s.git
synced 2026-07-29 06:19:31 +00:00
Add cert rotation command (#4495)
* Add cert rotation command Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com> * add function to check for dynamic listener file Signed-off-by: Brian Downs <brian.downs@gmail.com> * Add dynamiclistener cert rotation support Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com> * fixes to the cert rotation Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com> * fix ci tests Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com> * fixes to certificate rotation command Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com> * more fixes Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com> Co-authored-by: Brian Downs <brian.downs@gmail.com>
This commit is contained in:
@@ -54,6 +54,15 @@ func (c *Cluster) newListener(ctx context.Context) (net.Listener, http.Handler,
|
||||
MinVersion: c.config.TLSMinVersion,
|
||||
CipherSuites: c.config.TLSCipherSuites,
|
||||
},
|
||||
RegenerateCerts: func() bool {
|
||||
const regenerateDynamicListenerFile = "dynamic-cert-regenerate"
|
||||
dynamicListenerRegenFilePath := filepath.Join(c.config.DataDir, "tls", regenerateDynamicListenerFile)
|
||||
if _, err := os.Stat(dynamicListenerRegenFilePath); err == nil {
|
||||
os.Remove(dynamicListenerRegenFilePath)
|
||||
return true
|
||||
}
|
||||
return false
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user