Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@
- **Breaking change:** Removal of deprecated compatibility layer previously found in the root of the SDK module
- **Dependencies:** Bump STACKIT SDK core module from `v0.27.0` to `v0.27.1`
- `iaas`:
- [v1.15.1](services/iaas/CHANGELOG.md#v1151)
- **Bugfix:** Waiter `ResizeServerWaitHandler` continued waiting when server is inactive
- [v1.15.0](services/iaas/CHANGELOG.md#v1150)
- **Breaking change:** Removal of deprecated compatibility layer previously found in the root of the SDK module
- **Dependencies:** Bump STACKIT SDK resourcemanager module from `v0.26.0` to `v0.26.1`
Expand Down
3 changes: 3 additions & 0 deletions services/iaas/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## v1.15.1
- **Bugfix:** Waiter `ResizeServerWaitHandler` continued waiting when server is inactive

## v1.15.0
- **Breaking change:** Removal of deprecated compatibility layer previously found in the root of the SDK module
- **Dependencies:** Bump STACKIT SDK resourcemanager module from `v0.26.0` to `v0.26.1`
Expand Down
2 changes: 1 addition & 1 deletion services/iaas/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1.15.0
v1.15.1
6 changes: 4 additions & 2 deletions services/iaas/v2api/wait/wait.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"errors"
"fmt"
"net/http"
"slices"
"strings"
"time"

Expand Down Expand Up @@ -258,8 +259,9 @@ func CreateServerWaitHandler(ctx context.Context, a iaas.DefaultAPI, projectId,
}

// ResizeServerWaitHandler will wait for server resize
// It checks for an intermediate resizing status and only then waits for the server to become active
// It checks for an intermediate resizing status and only then waits for the server to become either active or inactive
func ResizeServerWaitHandler(ctx context.Context, a iaas.DefaultAPI, projectId, region, serverId string) (h *wait.AsyncActionHandler[iaas.Server]) {
var finalResizeStates = []string{ServerActiveStatus, ServerInactiveStatus}
handler := wait.New(func() (waitFinished bool, response *iaas.Server, err error) {
server, err := a.GetServer(ctx, projectId, region, serverId).Execute()
if err != nil {
Expand All @@ -285,7 +287,7 @@ func ResizeServerWaitHandler(ctx context.Context, a iaas.DefaultAPI, projectId,
return false, server, nil
}

if *server.Id == serverId && *server.Status == ServerActiveStatus {
if *server.Id == serverId && slices.Contains(finalResizeStates, *server.Status) {
return true, server, nil
}

Expand Down
8 changes: 8 additions & 0 deletions services/iaas/v2api/wait/wait_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -717,6 +717,14 @@ func TestResizeServerWaitHandler(t *testing.T) {
wantErr: false,
wantResp: true,
},
{
desc: "resize_succeeded_inactive_server",
getFails: false,
returnResizing: true,
finalResourceState: ServerInactiveStatus,
wantErr: false,
wantResp: true,
},
{
desc: "resizing_status_is_never_returned",
getFails: false,
Expand Down
Loading