diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d4be05502..aeecaccb5e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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` diff --git a/services/iaas/CHANGELOG.md b/services/iaas/CHANGELOG.md index c73dcc44e3..12e2b0c9a9 100644 --- a/services/iaas/CHANGELOG.md +++ b/services/iaas/CHANGELOG.md @@ -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` diff --git a/services/iaas/VERSION b/services/iaas/VERSION index 440ddd8f1c..5257626a69 100644 --- a/services/iaas/VERSION +++ b/services/iaas/VERSION @@ -1 +1 @@ -v1.15.0 +v1.15.1 diff --git a/services/iaas/v2api/wait/wait.go b/services/iaas/v2api/wait/wait.go index 2c07606618..eb737bb022 100644 --- a/services/iaas/v2api/wait/wait.go +++ b/services/iaas/v2api/wait/wait.go @@ -5,6 +5,7 @@ import ( "errors" "fmt" "net/http" + "slices" "strings" "time" @@ -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 { @@ -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 } diff --git a/services/iaas/v2api/wait/wait_test.go b/services/iaas/v2api/wait/wait_test.go index fc044209d2..99c3887b6b 100644 --- a/services/iaas/v2api/wait/wait_test.go +++ b/services/iaas/v2api/wait/wait_test.go @@ -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,