Skip to content

Commit 7be7579

Browse files
authored
fix(instance): server delete with scratch storage (#3366)
1 parent b92f964 commit 7be7579

File tree

4 files changed

+8960
-1727
lines changed

4 files changed

+8960
-1727
lines changed

internal/namespaces/instance/v1/custom_server.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -811,6 +811,8 @@ func serverDeleteCommand() *core.Command {
811811
continue
812812
case deleteServerArgs.WithVolumes == withVolumesBlock && volume.VolumeType != instance.VolumeServerVolumeTypeBSSD:
813813
continue
814+
case volume.VolumeType == instance.VolumeServerVolumeTypeScratch:
815+
continue
814816
}
815817
err = api.DeleteVolume(&instance.DeleteVolumeRequest{
816818
Zone: deleteServerArgs.Zone,

internal/namespaces/instance/v1/custom_server_create_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ func Test_CreateServerErrors(t *testing.T) {
490490
func Test_CreateServerScratchStorage(t *testing.T) {
491491
t.Run("Default scratch storage", core.Test(&core.TestConfig{
492492
Commands: GetCommands(),
493-
Cmd: "scw instance server create type=H100-1-80G image=ubuntu_jammy_gpu_os_12",
493+
Cmd: "scw instance server create type=H100-1-80G image=ubuntu_jammy_gpu_os_12 zone=fr-par-2",
494494
Check: core.TestCheckCombine(
495495
core.TestCheckGolden(),
496496
func(t *testing.T, ctx *core.CheckFuncCtx) {
@@ -509,6 +509,7 @@ func Test_CreateServerScratchStorage(t *testing.T) {
509509
assert.Equal(t, additionalVolume.VolumeType, instance.VolumeServerVolumeTypeScratch)
510510
},
511511
),
512+
AfterFunc: core.ExecAfterCmd("scw instance server delete {{ .CmdResult.ID }} zone=fr-par-2 with-volumes=all with-ip=true force-shutdown=true"),
512513
DisableParallel: true,
513514
}))
514515
}

0 commit comments

Comments
 (0)