mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-07-18 04:54:54 +00:00
Merge pull request #131111 from novahe/certificate_store
Certificate store: ensure data is written to disk
This commit is contained in:
@@ -231,6 +231,11 @@ func (s *fileStore) Update(certData, keyData []byte) (*tls.Certificate, error) {
|
||||
}
|
||||
pem.Encode(f, keyBlock)
|
||||
|
||||
// Ensure data is written to disk
|
||||
if err := f.Sync(); err != nil {
|
||||
return nil, fmt.Errorf("failed to sync certificate data to disk: %w (file: %q)", err, certPath)
|
||||
}
|
||||
|
||||
cert, err := loadFile(certPath)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
Reference in New Issue
Block a user