engine: resources: file: Remove Validate owner/group Checks

The owner/group of a file should not be validated on the host until runtime. This removes the checks in Validate() that were happening before the execution of the resource graph (and therefore bound to fail if the system was being bootstrapped).
This commit is contained in:
Cian Yong Leow
2024-06-17 13:52:04 +01:00
parent 3c661ab674
commit 09e53bfd3f

View File

@@ -352,13 +352,6 @@ func (obj *FileRes) Validate() error {
return fmt.Errorf("can't set Owner or Group on this platform") return fmt.Errorf("can't set Owner or Group on this platform")
} }
} }
if _, err := engineUtil.GetUID(obj.Owner); obj.Owner != "" && err != nil {
return err
}
if _, err := engineUtil.GetGID(obj.Group); obj.Group != "" && err != nil {
return err
}
// TODO: should we silently ignore this error or include it? // TODO: should we silently ignore this error or include it?
//if obj.State == FileStateAbsent && obj.Mode != "" { //if obj.State == FileStateAbsent && obj.Mode != "" {