Skip to content

Commit

Permalink
Remove extra try statement
Browse files Browse the repository at this point in the history
  • Loading branch information
ebronson68 committed Sep 3, 2024
1 parent 0cedce0 commit 2ce7846
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions .github/workflows/update-addns.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,17 +93,12 @@ jobs:
}
Write-Host "Retrieving DNS Record..."
try {
$dnsRecord = Get-DnsServerResourceRecord -ZoneName "${{ env.domainName }}" -ComputerName ${{ secrets.domainController }} | Where-Object { $_.HostName -eq "${{ env.aksIngress }}" }
if ($dnsRecord) {
Write-Host "DNS Record retrieved successfully:"
$dnsRecord | Format-List
} else {
Write-Error "DNS Record not found."
}
}
catch {
Write-Error "Failed to retrieve DNS Record."
$dnsRecord = Get-DnsServerResourceRecord -ZoneName "${{ env.domainName }}" -ComputerName ${{ secrets.domainController }} | Where-Object { $_.HostName -eq "${{ env.aksIngress }}" }
if ($dnsRecord) {
Write-Host "DNS Record retrieved successfully:"
$dnsRecord | Format-List
} else {
Write-Error "DNS Record not found."
}
if ($recordUpdated) {
Expand Down

0 comments on commit 2ce7846

Please sign in to comment.