-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Direct resource set
no longer requires test
#197
Conversation
On the behavior of implementsPreTest, if we detect that Test is not implemented, then we know PreTest is not implemented. |
@mgreenegit the |
@SteveL-MSFT - I think I mostly agree with this, with the exception that it should be possible to indicate that I want the test operation to be carried out before set. This is important for resources that rely on DSC's synthetic testing imo, and mostly for interactive/script usage. Without this option, I have to do something like: $Settings = @{ foo = 'bar' } | ConvertTo-Json
$Result = $Settings | dsc resource test --resource My/Resource
if (-not $Result.inDesiredState) {
$Result = $Settings | dsc resource set --resource My/Resource
if ($LastExitCode -ne 0) {
# Handle error
}
}
# Continue processing With a $Settings = @{ foo = 'bar' } | ConvertTo-Json
$Result = $Settings | dsc resource set --resource My/Resource --preTest
if ($LastExitCode -ne 0) {
# Handle error
}
# Continue processing Regarding the schema update/rename, can we mark |
I agree with @michaeltlombardi that it should be possible for test to run before the set, but wouldn't it also be preferred to indicate what properties that are not in desired state too from test so that can be passed into |
This makes sense. My suggestion is, if the manifest does not contain a |
@mgreenegit
I don't think we can assume that because I think adding a |
@michaeltlombardi schema changes during alpha are inevitable. Maybe we just need to call them out in the changelog? |
This change updates the schemas to reflect the renaming of the `set.preTest` setting in the resource manifest to the more readable and semantically correct `set.implementsPretest` to reflect the change in PowerShell#197.
This change updates the schemas to reflect the renaming of the `set.preTest` setting in the resource manifest to the more readable and semantically correct `set.implementsPretest` to reflect the change in PowerShell#197.
This change updates the reference documentation and the changelog to reflect the changes that were included in the `alpha.3` release: - PowerShell#197 - PowerShell#198 - PowerShell#199
This change updates the reference documentation and the changelog to reflect the changes that were included in the `alpha.3` release: - PowerShell#197 - PowerShell#198 - PowerShell#199
This change updates the schemas to reflect the renaming of the `set.preTest` setting in the resource manifest to the more readable and semantically correct `set.implementsPretest` to reflect the change in PowerShell#197.
This change updates the reference documentation and the changelog to reflect the changes that were included in the `alpha.3` release: - PowerShell#197 - PowerShell#198 - PowerShell#199
This change updates the reference documentation and the changelog to reflect the changes that were included in the `alpha.3` release: - PowerShell#197 - PowerShell#198 - PowerShell#199
This change updates the reference documentation and the changelog to reflect the changes that were included in the `alpha.3` release: - PowerShell#197 - PowerShell#198 - PowerShell#199
PR Summary
set
and no input is provideddsc resource set
no longer tries atest
beforepreTest
toimplementsPretest
to make it more clear it's the resource implementing it or notPR Context
Some usability issues identified when @mgreenegit was writing a bash resource example