Skip to content

Commit 28d8209

Browse files
committed
Fix
1 parent 09c830b commit 28d8209

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

internal/services/instance/action_server_action.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@ import (
1313
"github.com/scaleway/scaleway-sdk-go/scw"
1414
)
1515

16-
var (
17-
_ action.Action = (*ServerAction)(nil)
18-
)
16+
var _ action.Action = (*ServerAction)(nil)
1917

2018
type ServerAction struct {
2119
instanceAPI *instance.API
@@ -46,8 +44,8 @@ func (a *ServerAction) Metadata(ctx context.Context, req action.MetadataRequest,
4644
type ServerActionModel struct {
4745
ServerID types.String `tfsdk:"server_id"`
4846
Zone types.String `tfsdk:"zone"`
49-
Wait types.Bool `tfsdk:"wait"`
5047
Action types.String `tfsdk:"action"`
48+
Wait types.Bool `tfsdk:"wait"`
5149
}
5250

5351
func NewServerAction() action.Action {
@@ -91,6 +89,7 @@ func (a *ServerAction) Invoke(ctx context.Context, req action.InvokeRequest, res
9189
var data ServerActionModel
9290
// Read action config data into the model
9391
resp.Diagnostics.Append(req.Config.Get(ctx, &data)...)
92+
9493
if resp.Diagnostics.HasError() {
9594
return
9695
}
@@ -105,6 +104,7 @@ func (a *ServerAction) Invoke(ctx context.Context, req action.InvokeRequest, res
105104
"error in server action",
106105
fmt.Sprintf("%s", err))
107106
}
107+
108108
if data.Wait.ValueBool() {
109109
_, errWait := a.instanceAPI.WaitForServer(&instance.WaitForServerRequest{
110110
ServerID: data.ServerID.String(),

provider/framework.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@ import (
1313
"github.com/scaleway/terraform-provider-scaleway/v2/internal/services/instance"
1414
)
1515

16-
var _ provider.Provider = &ScalewayProvider{}
17-
var _ provider.ProviderWithActions = (*ScalewayProvider)(nil)
16+
var (
17+
_ provider.Provider = &ScalewayProvider{}
18+
_ provider.ProviderWithActions = (*ScalewayProvider)(nil)
19+
)
1820

1921
type ScalewayProvider struct{}
2022

@@ -84,7 +86,9 @@ func (p *ScalewayProvider) DataSources(_ context.Context) []func() datasource.Da
8486

8587
func (p *ScalewayProvider) Actions(_ context.Context) []func() action.Action {
8688
var res []func() action.Action
89+
8790
res = append(res, instance.NewServerAction)
91+
8892
return res
8993
}
9094

0 commit comments

Comments
 (0)