Skip to content

Fix azure.IsNotFound for new azcore error type#3842

Merged
thomas11 merged 1 commit into
masterfrom
tkappler/azcore-isnotfound
Jan 10, 2025
Merged

Fix azure.IsNotFound for new azcore error type#3842
thomas11 merged 1 commit into
masterfrom
tkappler/azcore-isnotfound

Conversation

@thomas11

@thomas11 thomas11 commented Jan 9, 2025

Copy link
Copy Markdown
Contributor

Fixes an issue I discovered today when trying to reproduce another issue report. pulumi refresh is broken for this provider:

$ PATH="$HOME/pulumi/pan/bin:$PATH" pulumi refresh --skip-preview -s dev

     pulumi:pulumi:Stack                      recoveryservices-protecteditem-dev  **failed**                1 error; 4 warnings
 ~   ├─ azure-native:resources:ResourceGroup  resourceGroup                       **refreshing failed**     1 error

  azure-native:resources:ResourceGroup (resourceGroup):
    error: Code="ResourceGroupNotFound" Message="Resource group 'resourceGroup3f871416' could not be found."

The reason is that #3783 regressed azure.IsNotFound, causing Read to report an error when a resource doesn't exist in Azure.

This PR fixes the problem and adds test coverage.

@github-actions

github-actions Bot commented Jan 9, 2025

Copy link
Copy Markdown
Contributor

Does the PR have any schema changes?

Looking good! No breaking changes found.
No new resources/functions.

@thomas11 thomas11 force-pushed the tkappler/azcore-isnotfound branch from 3c330f6 to 2dfd03c Compare January 9, 2025 17:52
@pulumi-bot

Copy link
Copy Markdown
Contributor

This PR has been shipped in release v2.82.0.

@thomas11 thomas11 added impact/regression Something that used to work, but is now broken area/providers labels Jan 13, 2025
@mjeffryes mjeffryes removed the impact/regression Something that used to work, but is now broken label Jan 13, 2025
@EronWright

Copy link
Copy Markdown
Contributor

I have to wonder if using errors.As would have helped here. That is, wrap the underlying error to improve the formatting, and have client code use As consistently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants