Skip to content

Commit 5e6c94c

Browse files
committed
commit the actual fix to pass the failing tests
1 parent 02a37e3 commit 5e6c94c

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

internal/fwserver/server_planresourcechange.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ func (s *Server) PlanResourceChange(ctx context.Context, req *PlanResourceChange
383383
}
384384

385385
// If we're updating or deleting and we already have an identity stored, validate that the planned identity isn't changing
386-
if !req.ResourceBehavior.MutableIdentity && !req.PriorState.Raw.IsNull() && !req.PriorIdentity.Raw.IsNull() && !req.PriorIdentity.Raw.Equal(resp.PlannedIdentity.Raw) {
386+
if !req.ResourceBehavior.MutableIdentity && !req.PriorState.Raw.IsNull() && !req.PriorIdentity.Raw.IsFullyNull() && !req.PriorIdentity.Raw.Equal(resp.PlannedIdentity.Raw) {
387387
resp.Diagnostics.AddError(
388388
"Unexpected Identity Change",
389389
"During the planning operation, the Terraform Provider unexpectedly returned a different identity than the previously stored one.\n\n"+

internal/fwserver/server_readresource.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ func (s *Server) ReadResource(ctx context.Context, req *ReadResourceRequest, res
185185
}
186186

187187
// If we're refreshing the resource state (excluding a recently imported resource), validate that the new identity isn't changing
188-
if !req.ResourceBehavior.MutableIdentity && !readFollowingImport && !req.CurrentIdentity.Raw.IsNull() && !req.CurrentIdentity.Raw.Equal(resp.NewIdentity.Raw) {
188+
if !req.ResourceBehavior.MutableIdentity && !readFollowingImport && !req.CurrentIdentity.Raw.IsFullyNull() && !req.CurrentIdentity.Raw.Equal(resp.NewIdentity.Raw) {
189189
resp.Diagnostics.AddError(
190190
"Unexpected Identity Change",
191191
"During the read operation, the Terraform Provider unexpectedly returned a different identity than the previously stored one.\n\n"+

internal/fwserver/server_updateresource.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ func (s *Server) UpdateResource(ctx context.Context, req *UpdateResourceRequest,
186186
}
187187

188188
// If we already have an identity stored, validate that the new identity hasn't changing
189-
if !req.ResourceBehavior.MutableIdentity && !req.PlannedIdentity.Raw.IsNull() && !req.PlannedIdentity.Raw.Equal(resp.NewIdentity.Raw) {
189+
if !req.ResourceBehavior.MutableIdentity && !req.PlannedIdentity.Raw.IsFullyNull() && !req.PlannedIdentity.Raw.Equal(resp.NewIdentity.Raw) {
190190
resp.Diagnostics.AddError(
191191
"Unexpected Identity Change",
192192
"During the update operation, the Terraform Provider unexpectedly returned a different identity than the previously stored one.\n\n"+

0 commit comments

Comments
 (0)