Skip to content

Commit a7e36b7

Browse files
authored
Merge pull request #1789 from jlebon/pr/relabel-missing
2 parents 48524ec + 162d1a6 commit a7e36b7

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

docs/release-notes.md

+7-2
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,22 @@ nav_order: 9
88

99
### Breaking changes
1010

11-
- The dracut module is not automatically included in initramfs images anymore,
12-
see distributor notes for details.
11+
- Only include dracut module in initramfs if requested (see distributor notes
12+
for details)
1313

1414
### Features
1515

16+
17+
1618
### Changes
1719

1820
- Require Go 1.20+
1921

2022
### Bug fixes
2123

24+
- Fix failure when config only disables units already disabled
25+
26+
2227
## Ignition 2.17.0 (2023-11-20)
2328

2429
Starting with this release, ignition-validate binaries are signed with the

internal/exec/stages/files/files.go

+13-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ package files
1717
import (
1818
"errors"
1919
"fmt"
20+
"os"
2021
"path/filepath"
2122

2223
"github.com/coreos/ignition/v2/config/v3_5_experimental/types"
@@ -170,7 +171,18 @@ func (s *stage) relabelFiles() error {
170171

171172
keys := make([]string, 0, len(s.toRelabel))
172173
for key := range s.toRelabel {
173-
keys = append(keys, key)
174+
// Filter out non-existent entries; some of the code that mark files for
175+
// relabeling may not actually end up creating those files in the end.
176+
if _, err := os.Stat(key); err == nil {
177+
keys = append(keys, key)
178+
} else if !errors.Is(err, os.ErrNotExist) {
179+
return err
180+
}
174181
}
182+
183+
if len(keys) == 0 {
184+
return nil
185+
}
186+
175187
return s.RelabelFiles(keys)
176188
}

0 commit comments

Comments
 (0)