Skip to content
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

ConfigInstructions should throw an exception when DependsOn points to itself #12

Open
alx9r opened this issue Nov 26, 2016 · 0 comments
Labels

Comments

@alx9r
Copy link
Owner

alx9r commented Nov 26, 2016

Consider the following:

$document = {
    Get-DscResource TestStub | Import-DscResource

    TestStub a @{
        Key = 'a'
        DependsOn = '[TestStub]a'
    }
}

$instructions = ConfigInstructions Name $document

[TestStub]a depends on itself. I can't see any meaning to a normal resource depending on itself. A normal resource depending on itself almost certainly indicates a user error. Processing of [TestStub]a should throw an exception because it points to itself.

It's worth noting that an aggregate resource could depend on itself because it could count itself in whatever aggregation logic it is applying.

A test for this behavior is already mentioned in configDocumentType.Tests.ps1.

@alx9r alx9r added the Feature label Nov 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant