Change import
type resource to a group type resource
#500
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR Summary
The main problem with
test
and anyimport
type resource is that the engine uses the user input/doc as the expected state. In this case, it's a pointer to a config file and an optional parameters file. So expected and desired would never match.The change here is that an
import
kind of resource is no longer just a resource that the engine resolves, but is a type ofgroup
resource which is expected to resolve the configuration file to an actual configuration and execute the requested operation.dsc
here is used to implement theinclude
resource which has a hiddenas_include
switch to tell itself it needs to resolve the configuration then act the same as a group resource. Thevalidate
operation now checks that the properties match an import configuration schema. Removed all the previous code where the engine perform the resolvingimport
kind of resources and havetest
check ifimport
kind, then just use the returned output (which is in the correct format already as a group resource) instead of trying to figure out expected/actual.PR Context
Fixes incomplete functionality of
include
resource fortest
operation as the expected state was a redirection pointer than the resolved expected state.Example output from test: