mirror of
https://github.com/kubernetes/client-go.git
synced 2025-07-04 10:46:16 +00:00
Merge pull request #131111 from novahe/certificate_store
Certificate store: ensure data is written to disk Kubernetes-commit: cd7195976f2621bd7a193de6d22ee49deead6a65
This commit is contained in:
commit
d01bdb17a5
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user