diff --git a/docs/release-notes.md b/docs/release-notes.md index d3603b90b..ac88f6254 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -8,17 +8,22 @@ nav_order: 9 ### Breaking changes -- The dracut module is not automatically included in initramfs images anymore, - see distributor notes for details. +- Only include dracut module in initramfs if requested (see distributor notes + for details) ### Features + + ### Changes - Require Go 1.20+ ### Bug fixes +- Fix failure when config only disables units already disabled + + ## Ignition 2.17.0 (2023-11-20) Starting with this release, ignition-validate binaries are signed with the diff --git a/internal/exec/stages/files/files.go b/internal/exec/stages/files/files.go index d5c04f290..5ab5242a9 100644 --- a/internal/exec/stages/files/files.go +++ b/internal/exec/stages/files/files.go @@ -17,6 +17,7 @@ package files import ( "errors" "fmt" + "os" "path/filepath" "github.com/coreos/ignition/v2/config/v3_5_experimental/types" @@ -170,7 +171,18 @@ func (s *stage) relabelFiles() error { keys := make([]string, 0, len(s.toRelabel)) for key := range s.toRelabel { - keys = append(keys, key) + // Filter out non-existent entries; some of the code that mark files for + // relabeling may not actually end up creating those files in the end. + if _, err := os.Stat(key); err == nil { + keys = append(keys, key) + } else if !errors.Is(err, os.ErrNotExist) { + return err + } } + + if len(keys) == 0 { + return nil + } + return s.RelabelFiles(keys) }