Skip to content

Commit 4ff9576

Browse files
committed
fix(instance): remove bootscript usage
1 parent 48d5347 commit 4ff9576

File tree

3 files changed

+848
-23
lines changed

3 files changed

+848
-23
lines changed

internal/services/instance/server.go

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -423,10 +423,6 @@ func ResourceInstanceServerCreate(ctx context.Context, d *schema.ResourceData, m
423423
req.EnableIPv6 = scw.BoolPtr(enableIPv6.(bool)) //nolint:staticcheck
424424
}
425425

426-
if bootScriptID, ok := d.GetOk("bootscript_id"); ok {
427-
req.Bootscript = types.ExpandStringPtr(bootScriptID) //nolint:staticcheck
428-
}
429-
430426
if bootType, ok := d.GetOk("boot_type"); ok {
431427
bootType := instanceSDK.BootType(bootType.(string))
432428
req.BootType = &bootType
@@ -617,11 +613,6 @@ func ResourceInstanceServerRead(ctx context.Context, d *schema.ResourceData, m i
617613
_ = d.Set("name", server.Name)
618614
_ = d.Set("boot_type", server.BootType)
619615

620-
// Bootscript is deprecated
621-
if server.Bootscript != nil { //nolint:staticcheck
622-
_ = d.Set("bootscript_id", server.Bootscript.ID) //nolint:staticcheck
623-
}
624-
625616
_ = d.Set("type", server.CommercialType)
626617
if len(server.Tags) > 0 {
627618
_ = d.Set("tags", server.Tags)
@@ -923,17 +914,6 @@ func ResourceInstanceServerUpdate(ctx context.Context, d *schema.ResourceData, m
923914
}
924915
}
925916

926-
if d.HasChanges("bootscript_id") {
927-
serverShouldUpdate = true
928-
updateRequest.Bootscript = types.ExpandStringPtr(d.Get("bootscript_id").(string))
929-
if !isStopped {
930-
warnings = append(warnings, diag.Diagnostic{
931-
Severity: diag.Warning,
932-
Summary: "instanceSDK may need to be rebooted to use the new bootscript",
933-
})
934-
}
935-
}
936-
937917
////
938918
// Update server user data
939919
////

internal/services/instance/servers_data_source.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,9 +185,6 @@ func DataSourceInstanceServersRead(ctx context.Context, d *schema.ResourceData,
185185
rawServer["zone"] = string(zone)
186186
rawServer["name"] = server.Name
187187
rawServer["boot_type"] = server.BootType
188-
if server.Bootscript != nil { //nolint:staticcheck
189-
rawServer["bootscript_id"] = server.Bootscript.ID //nolint:staticcheck
190-
}
191188
rawServer["type"] = server.CommercialType
192189
if len(server.Tags) > 0 {
193190
rawServer["tags"] = server.Tags

internal/services/instance/testdata/server-root-volume-default-type-sbs.cassette.yaml

Lines changed: 848 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)