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: Enforce EnpointHostName even though it is not part of the configuration #1821

Closed
johlju opened this issue Dec 16, 2022 · 0 comments · Fixed by #1820
Closed
Labels
bug The issue is a bug.

Comments

@johlju
Copy link
Member

johlju commented Dec 16, 2022

Problem description

The resource wrongly try to enforce EndpointHostName even though it is not part of the configuration. When not passed in the configuration EndpointHostname will be matched against empty string which will always be wrong.

Verbose logs

Not available

DSC configuration

Found when converting unit test to Pester 5.

Suggested solution

Evaluate that the the parameter EndpointHostname was passed in the configuration.

if ( $EndpointHostName -ne $currentEndpointHostName )

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 bug The issue is a bug. in progress The issue is being actively worked on by someone. 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
bug The issue is a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant