From 0c9e8cc50e6fd857e67341306e0f42de2e5cf579 Mon Sep 17 00:00:00 2001 From: James Shubin Date: Sun, 8 Sep 2019 04:40:14 -0400 Subject: [PATCH] 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. --- engine/resources/file.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engine/resources/file.go b/engine/resources/file.go index ab3ccce5..47d3304c 100644 --- a/engine/resources/file.go +++ b/engine/resources/file.go @@ -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! } }