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

Pulumi refresh does not detect resource name changes due to letter casing differences #2479

Open
cermakp opened this issue Sep 27, 2024 · 0 comments
Labels
kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team

Comments

@cermakp
Copy link

cermakp commented Sep 27, 2024

What happened?

When there is a difference in letter casing in a resource's name, the pulumi refresh command does not detect it. The pulumi refresh command should recognize such changes and synchronize the stack with the resource name in Azure.

Example

  1. Define a Log Analytics workspace in Azure named "lawTestService".
  2. Define the stack containing the same resource, but with different letter casing in the workspace name, such as:
    "workspaceName": "lawtestservice".
  3. Run pulumi refresh in the command line – no changes are detected.

Expected behavior
The workspace name in the stack should be overwritten to "lawTestService" and synchronized with the name defined in the Azure provider.

Output of pulumi about

running 'dotnet build -nologo .'
Determining projects to restore...

All projects are up-to-date for restore.

C:\Users\cerma.nuget\packages\microsoft.codeanalysis.netanalyzers\7.0.4\build\Microsoft.CodeAnalysis.NetAnalyzers.targets(593,5): warning : The .NET SDK has newer analyzers with version '8.0.0' than what version '7.0.4' of 'Microsoft.CodeAnalysis.NetAnaly
zers' package provides. Update or remove this package reference. [C:\Sources\NetCoreBoilerplate\infrastructure\Ori.NetCoreBoilerplate.Infrastructure\Ori.NetCoreBoilerplate.Infrastructure.csproj]

Ori.NetCoreBoilerplate.Infrastructure -> C:\Sources\NetCoreBoilerplate\infrastructure\Ori.NetCoreBoilerplate.Infrastructure\bin\Debug\net8.0\Ori.NetCoreBoilerplate.Infrastructure.dll

Build succeeded.

C:\Users\cerma.nuget\packages\microsoft.codeanalysis.netanalyzers\7.0.4\build\Microsoft.CodeAnalysis.NetAnalyzers.targets(593,5): warning : The .NET SDK has newer analyzers with version '8.0.0' than what version '7.0.4' of 'Microsoft.CodeAnalysis.NetAnalyzers' package provides. Update or remove this package reference. [C:\Sources\NetCoreBoilerplate\infrastructure\Ori.NetCoreBoilerplate.Infrastructure\Ori.NetCoreBoilerplate.Infrastructure.csproj]
1 Warning(s)
0 Error(s)

Time Elapsed 00:00:00.86

Workload updates are available. Run dotnet workload list for more information.

'dotnet build -nologo .' completed successfully
CLI
Version 3.133.0
Go Version go1.23.1
Go Compiler gc

Plugins
KIND NAME VERSION
resource azure 5.78.0
resource azure-native 2.42.1
resource azuread 5.50.0
resource azuredevops 3.1.1
language dotnet unknown

Host
OS Microsoft Windows 11 Pro
Version 10.0.22631 Build 22631
Arch x86_64

This project is written in dotnet: executable='C:\Program Files\dotnet\dotnet.exe' version='8.0.402'

Current Stack: organization/NcBoilerplateInfrastructureStack/we.uat

TYPE URN
pulumi:pulumi:Stack urn:pulumi:we.uat::NcBoilerplateInfrastructureStack::pulumi:pulumi:Stack::NcBoilerplateInfrastructureStack-we.uat
pulumi:providers:azure-native urn:pulumi:we.uat::NcBoilerplateInfrastructureStack::pulumi:providers:azure-native::azure-native-tenant-e46bc88e-1a4b-44ff-a158-1b9f7eb4561e-subscription-bf92e86b-7b0b-4d78-8785-c104ce8ffaf4
pulumi:providers:azure urn:pulumi:we.uat::NcBoilerplateInfrastructureStack::pulumi:providers:azure::azure-tenant-e46bc88e-1a4b-44ff-a158-1b9f7eb4561e-subscription-bf92e86b-7b0b-4d78-8785-c104ce8ffaf4
azure-native:resources:ResourceGroup urn:pulumi:we.uat::NcBoilerplateInfrastructureStack::azure-native:resources:ResourceGroup::rgncboilerplateuatwe-online
azure-native:operationalinsights:Workspace urn:pulumi:we.uat::NcBoilerplateInfrastructureStack::azure-native:operationalinsights:Workspace::lawncboilerplateuatwe-online

Found no pending operations associated with we.uat

Backend
Name Pavel-PC
URL azblob://frameworks
User PAVEL-PC\cerma
Organizations
Token type personal

Dependencies:
NAME VERSION
Ori.Common.Analyzers.CSharp 7.0.2
Ori.Common.Analyzers.Security 5.0.1
Ori.Common.Pulumi 0.1.35

Additional context

Although pulumi refresh does not detect changes in letter casing, pulumi up does and attempts to replace the resource.

Contributing

Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

@cermakp cermakp added kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team labels Sep 27, 2024
@Frassle Frassle transferred this issue from pulumi/pulumi Sep 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team
Projects
None yet
Development

No branches or pull requests

1 participant