Skip to content

Commit

Permalink
Change grcpwrap upgrade identity
Browse files Browse the repository at this point in the history
  • Loading branch information
dbanck committed Mar 6, 2025
1 parent 7a7fbc7 commit 22cba43
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions internal/grpcwrap/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -558,11 +558,11 @@ func (p *provider) GetResourceIdentitySchemas(_ context.Context, req *tfplugin5.

func (p *provider) UpgradeResourceIdentity(_ context.Context, req *tfplugin5.UpgradeResourceIdentity_Request) (*tfplugin5.UpgradeResourceIdentity_Response, error) {
resp := &tfplugin5.UpgradeResourceIdentity_Response{}
resource, ok := p.schema.ResourceTypes[req.TypeName]
resource, ok := p.identitySchemas.IdentityTypes[req.TypeName]
if !ok {
return nil, fmt.Errorf("resource identity schema not found for type %q", req.TypeName)
}
ty := resource.Identity.ImpliedType()
ty := resource.Body.ImpliedType()
upgradeResp := p.provider.UpgradeResourceIdentity(providers.UpgradeResourceIdentityRequest{
TypeName: req.TypeName,
Version: req.Version,
Expand Down
4 changes: 2 additions & 2 deletions internal/grpcwrap/provider6.go
Original file line number Diff line number Diff line change
Expand Up @@ -608,11 +608,11 @@ func (p *provider6) GetResourceIdentitySchemas(_ context.Context, req *tfplugin6

func (p *provider6) UpgradeResourceIdentity(_ context.Context, req *tfplugin6.UpgradeResourceIdentity_Request) (*tfplugin6.UpgradeResourceIdentity_Response, error) {
resp := &tfplugin6.UpgradeResourceIdentity_Response{}
resource, ok := p.schema.ResourceTypes[req.TypeName]
resource, ok := p.identitySchemas.IdentityTypes[req.TypeName]
if !ok {
return nil, fmt.Errorf("resource identity schema not found for type %q", req.TypeName)
}
ty := resource.Identity.ImpliedType()
ty := resource.Body.ImpliedType()

upgradeResp := p.provider.UpgradeResourceIdentity(providers.UpgradeResourceIdentityRequest{
TypeName: req.TypeName,
Expand Down

0 comments on commit 22cba43

Please sign in to comment.