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

SqlAGReplica: Get-TargetResource does not return key properties when absent #1822

Closed
johlju opened this issue Dec 16, 2022 · 0 comments · Fixed by #1820
Closed

SqlAGReplica: Get-TargetResource does not return key properties when absent #1822

johlju opened this issue Dec 16, 2022 · 0 comments · Fixed by #1820
Labels
enhancement The issue is an enhancement request.

Comments

@johlju
Copy link
Member

johlju commented Dec 16, 2022

Problem description

The resource does not return the key properties of Name and AvailabilityGorupName when the current state is Absent. This result in unneccassry logic in Test-TargetResource.

'Name',
'AvailabilityGroupName',

Verbose logs

Found when converting unit tests to Pester 5.

DSC configuration

Not available

Suggested solution

The key properties Name and AvailabilityGorupName should always be returned from the Get-TargetResource. Test-TargetResource should not evaluate those two properties.

SQL Server edition and version

n/a

SQL Server PowerShell modules

n/a

Operating system

n/a

PowerShell version

n/a

SqlServerDsc version

main branch
@johlju johlju added enhancement The issue is an enhancement request. help wanted The issue is up for grabs for anyone in the community. in progress The issue is being actively worked on by someone. and removed help wanted The issue is up for grabs for anyone in the community. labels Dec 16, 2022
johlju added a commit that referenced this issue Dec 16, 2022
- SqlAgReplica
  - Converted unit test to Pester 5.
  - No longer tries to enforce EndpointHostName when it is not part of the
    configuration (issue #1821).
  - Now `Get-TargetResource` always returns values for the properties `Name`
    and `AvailabilityGroupName` (issue #1822).
  - Now `Test-TargetResource` no longer test properties that cannot
    be enforced (issue #1822).
@johlju johlju removed the in progress The issue is being actively worked on by someone. label Dec 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement The issue is an enhancement request.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant