mirror of
https://github.com/Mic92/sops-nix.git
synced 2025-12-26 22:24:59 +08:00
fix changing between a secret file and a directory with the same name
This commit is contained in:
parent
10957db2de
commit
ad2ae68ffc
1 changed files with 4 additions and 4 deletions
|
|
@ -966,8 +966,8 @@ func handleModifications(isDry bool, logcfg loggingConfig, symlinkPath string, s
|
|||
// Read the old file
|
||||
oldData, err := os.ReadFile(oldPath)
|
||||
if err != nil {
|
||||
if os.IsNotExist(err) {
|
||||
// File did not exist before
|
||||
// File did not exist before or the path changed from a file to a directory or vice versa
|
||||
if os.IsNotExist(err) || errors.Is(err, syscall.ENOTDIR) || errors.Is(err, syscall.EISDIR) {
|
||||
restart = append(restart, secret.RestartUnits...)
|
||||
reload = append(reload, secret.ReloadUnits...)
|
||||
newSecrets[secret.Name] = true
|
||||
|
|
@ -997,8 +997,8 @@ func handleModifications(isDry bool, logcfg loggingConfig, symlinkPath string, s
|
|||
// Read the old file
|
||||
oldData, err := os.ReadFile(oldPath)
|
||||
if err != nil {
|
||||
if os.IsNotExist(err) {
|
||||
// File did not exist before
|
||||
// File did not exist before or the path changed from a file to a directory or vice versa
|
||||
if os.IsNotExist(err) || errors.Is(err, syscall.ENOTDIR) || errors.Is(err, syscall.EISDIR) {
|
||||
restart = append(restart, template.RestartUnits...)
|
||||
reload = append(reload, template.ReloadUnits...)
|
||||
newTemplates[template.Name] = true
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue