mirror of
https://github.com/bpg/terraform-provider-proxmox.git
synced 2025-07-02 03:22:59 +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 (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
|
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
|
||||||
@ -86,7 +87,15 @@ func Pool() *schema.Resource {
|
|||||||
UpdateContext: poolUpdate,
|
UpdateContext: poolUpdate,
|
||||||
DeleteContext: poolDelete,
|
DeleteContext: poolDelete,
|
||||||
Importer: &schema.ResourceImporter{
|
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