mirror of
https://github.com/kairos-io/immucore.git
synced 2025-08-31 22:27:29 +00:00
Several fixes
- Set global debug log - Set caller in the log if debug - Fatal if cannot get target image - clean up slices from cos-layoout.env - Add generic log with more context info - dump runtime to log on start - Set proper default paths if overlay is empty (fixes recovery) - Fix ErrAlreadyMounted to not trigger failures Signed-off-by: Itxaka <itxaka@spectrocloud.com>
This commit is contained in:
@@ -104,3 +104,17 @@ func CreateIfNotExists(path string) error {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// CleanupSlice will clean a slice of strings of empty items
|
||||
// Typos can be made on writing the cos-layout.env file and that could introduce empty items
|
||||
// In the lists that we need to go over, which causes bad stuff
|
||||
func CleanupSlice(slice []string) []string {
|
||||
var cleanSlice []string
|
||||
for _, item := range slice {
|
||||
if strings.Trim(item, " ") == "" {
|
||||
continue
|
||||
}
|
||||
cleanSlice = append(cleanSlice, item)
|
||||
}
|
||||
return cleanSlice
|
||||
}
|
||||
|
Reference in New Issue
Block a user