mirror of
https://github.com/bpg/terraform-provider-proxmox.git
synced 2025-06-30 02:31:10 +00:00
fix(pool): missing pool_id
after import (#974)
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
This commit is contained in:
parent
ac433e9cb3
commit
ed33a18c9b
@ -8,6 +8,7 @@ package resource
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
|
||||
@ -86,7 +87,15 @@ func Pool() *schema.Resource {
|
||||
UpdateContext: poolUpdate,
|
||||
DeleteContext: poolDelete,
|
||||
Importer: &schema.ResourceImporter{
|
||||
StateContext: schema.ImportStatePassthroughContext,
|
||||
StateContext: func(ctx context.Context, d *schema.ResourceData, i interface{}) ([]*schema.ResourceData, error) {
|
||||
d.SetId(d.Id())
|
||||
err := d.Set(mkResourceVirtualEnvironmentPoolPoolID, d.Id())
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed setting state during import: %w", err)
|
||||
}
|
||||
|
||||
return []*schema.ResourceData{d}, nil
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user