fix: atomicWriteFile falls back to direct write on bind mounts
Rename fails with EBUSY on Docker bind-mounted files (e.g. controller.yaml). Fall back to os.WriteFile when os.Rename fails. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1032,7 +1032,8 @@ func atomicWriteFile(path string, data []byte, perm os.FileMode) error {
|
||||
}
|
||||
if err := os.Rename(tmp, path); err != nil {
|
||||
os.Remove(tmp)
|
||||
return err
|
||||
// Rename fails on bind-mounted files (EBUSY). Fall back to direct write.
|
||||
return os.WriteFile(path, data, perm)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user