-
Notifications
You must be signed in to change notification settings - Fork 55
Description
Summary of the new feature / enhancement
As a resource author implementing DSC resources as PowerShell classes,
I want to be able to provide semantic exit codes for my users,
so that my resources can fit into the semantics of DSC more correctly.
Currently, adapted PSDSC resources always return an exit code of 1 for an operational failure. There is no way for a resource implemented as a PowerShell class to:
- Indicate a set of exit codes and their meaning for DSC from the class implementation.
- Indicate a set of exit codes and their meaning for DSC from the adapted resource manifest.
- Surface that the operation is a failure and should exit with a specific code from any given resource operation.
Note
This problem affects other adapters as well, but we only have the PowerShell adapters published.
Proposed technical implementation details (optional)
We should add an exitCodes field to the adapted resource manifest to ensure that adapted resources can propagate semantically defined exit codes to DSC and higher order tools.
I can address the specifics of how to retrieve the exit codes from a class definition in RFC0001, but I think we need a way to properly indicate a semantic exit code from within a class method. I can't see an immediately obvious way to do this without either providing a [DscOperationException] class or requiring the resource author to implement a custom exception that includes both an exit code and message that their resource class throws.
When an adapted resource doesn't provide semantic exit codes, we should treat the exit codes the same way we do for other resources (0 for success, 1 for failure). This is an opt-in enhancement for all resources, but currently adapted resource authors can't participate in these semantics.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status