_inDesiredState
not being respected in test
state
output
#674
Labels
Milestone
_inDesiredState
not being respected in test
state
output
#674
Prerequisites
Summary
A resource that implements a
test
command and returnsstate
with the_inDesiredState
property as documented still has theinDesiredState
top level property calculated by the property diff.Related to #108, although my test case is actually the inversion of the described reason to add
_inDesiredState
(no property diff, but not in desired state).Workarounds:
test
rather than using defaults.stateAndDiff
so that the resource can control the property diff.Steps to reproduce
First, implement a resource with a
test
command that returnsstate
with an_inDesiredState
property. Unfortunately, it looks like only the archived registry resource uses it so there isn't an easy repro.The fragment from my resource manifest:
By allowing a default value for one of the resource properties, the desired state to actual state diff will be empty. Since the code only uses whether
diff_properties
is empty, and only values in the desired state that are different in the actual state are included, the diff is calculated as empty.Sample output from calling my resource:
And output from calling
dsc resource test
:If I provide an empty string for the
content
property, the diff is no longer empty and the result is correct:Expected behavior
The top-level inDesiredState property always has the same value as the _inDesiredState property returned by the test command.
Actual behavior
The inDesiredState property is always based on whether the property diff is empty.
Error details
Environment data
Version
3.0.0
Visuals
No response
The text was updated successfully, but these errors were encountered: