Skip to content

Commit a6dc5e3

Browse files
committed
Resolve remarks
1 parent 9f962b9 commit a6dc5e3

3 files changed

Lines changed: 13 additions & 4 deletions

File tree

docs/reference/schemas/extension/stdout/discover.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@ extension manifest on the system. DSC expects every JSON Line emitted to stdout
2929
The output must be a JSON object. The object must define the full path to the discovered manifest.
3030
If an extension returns JSON that is invalid against this schema, DSC raises an error.
3131
32-
If the extension doesn't discover any manifests, it must return nothing to stdout. An empty output
33-
indicates no resources were found.
32+
If the extension doesn't discover any manifests, it must return nothing to stdout and exit with
33+
code `0`. An empty output with a zero exit code indicates no resources were found. A non-zero exit
34+
code indicates an error, even if stdout is empty.
3435

3536
## Required Properties
3637

@@ -53,3 +54,11 @@ discovered, the extension must not emit any output to stdout.
5354
Type: string
5455
Required: true
5556
```
57+
58+
## Exit codes
59+
60+
The extension must return one of the following exit codes:
61+
62+
- `0` - Success. The extension completed discovery. If no manifests were found, stdout is empty.
63+
- Non-zero - Error. DSC treats any non-zero exit code as a failure and surfaces the extension's
64+
stderr output as an error message.

dsc/tests/dsc_extension_discover.tests.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,4 +156,4 @@ Describe 'Discover extension tests' {
156156
$env:DSC_RESOURCE_PATH = $null
157157
}
158158
}
159-
}
159+
}

extensions/powershell/powershell.discover.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,4 +119,4 @@ function Invoke-DscResourceDiscovery {
119119
}
120120
}
121121

122-
Invoke-DscResourceDiscovery
122+
Invoke-DscResourceDiscovery

0 commit comments

Comments
 (0)