engine: resources: Change the default file state

The default file state should be undefined. This is important because if
a reverse scenario that doesn't specify the state gets given this
default, it will be as if it was specified explicitly, which wouldn't
necessarily be what we want. Instead, an undefined state should
implicitly cause a file to get created if there's a reason to do so,
such as if content or another attribute is specified.

Hopefully this change doesn't introduce any bugs in the CheckApply code,
if it does, then it was due to a lack of implicit file creation.
This commit is contained in:
James Shubin
2019-09-08 04:40:14 -04:00
parent 34d572c523
commit 0c9e8cc50e

View File

@@ -96,7 +96,7 @@ type FileRes struct {
// Default returns some sensible defaults for this resource.
func (obj *FileRes) Default() engine.Res {
return &FileRes{
State: FileStateExists,
//State: FileStateUndefined, // the default must be undefined!
}
}