Skip to content

Commit

Permalink
Update to retry.<func> due to deprecation.
Browse files Browse the repository at this point in the history
As per
hashicorp/terraform-plugin-sdk@adb9dd8
the `StateChangeConf` and `StateRefreshFunc` has been deprecated.
  • Loading branch information
norrland committed Mar 28, 2023
1 parent ae74c02 commit e3c8908
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions glesys/resource_glesys_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

"github.com/glesys/glesys-go/v6"
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
)

Expand Down Expand Up @@ -340,7 +340,7 @@ func resourceGlesysServerDelete(ctx context.Context, d *schema.ResourceData, m i
// waitForServerAttribute
func waitForServerAttribute(
ctx context.Context, d *schema.ResourceData, target string, pending []string, attribute string, m interface{}) (interface{}, error) {
stateConf := &resource.StateChangeConf{
stateConf := &retry.StateChangeConf{
Pending: pending,
Target: []string{target},
Refresh: serverStateRefresh(ctx, d, m, attribute),
Expand All @@ -351,7 +351,7 @@ func waitForServerAttribute(
return stateConf.WaitForStateContext(ctx)
}

func serverStateRefresh(ctx context.Context, d *schema.ResourceData, m interface{}, attr string) resource.StateRefreshFunc {
func serverStateRefresh(ctx context.Context, d *schema.ResourceData, m interface{}, attr string) retry.StateRefreshFunc {
client := m.(*glesys.Client)
return func() (interface{}, string, error) {
// check state of server
Expand Down

0 comments on commit e3c8908

Please sign in to comment.