Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
efb42c4
feat(instances): add ResizeInstance to ports interfaces
poyrazK Apr 24, 2026
4e12e99
feat(compute): implement ResizeInstance on Docker backend
poyrazK Apr 24, 2026
bebc869
feat(compute): implement ResizeInstance on Libvirt backend
poyrazK Apr 24, 2026
38c002a
feat(instances): implement ResizeInstance in InstanceService
poyrazK Apr 24, 2026
95835d7
feat(instances): add ResizeInstance HTTP handler and route
poyrazK Apr 24, 2026
d9b7099
feat(compute): add ResizeInstance stubs to firecracker and noop backends
poyrazK Apr 24, 2026
ee38bb0
test(instances): add ResizeInstance mocks and handler tests
poyrazK Apr 24, 2026
9ccabf7
test(docker): add ContainerUpdate to fakeDockerClient
poyrazK Apr 24, 2026
28de05c
docs: regenerate swagger docs with ResizeInstance endpoint
poyrazK Apr 24, 2026
8a0539c
fix(k8s): add ResizeInstance to mockInstanceService mock
poyrazK Apr 24, 2026
7026e18
fix(tests): add ResizeInstance to remaining mock types
poyrazK Apr 24, 2026
29c40ad
test(instances): add unit, handler and E2E tests for ResizeInstance
poyrazK Apr 24, 2026
56f5e24
docs: add resize endpoint to API reference and create ADR-025
poyrazK Apr 24, 2026
8021a78
fix(e2e): remove invalid response body parsing in resize tests
poyrazK Apr 24, 2026
84dd34b
fix(e2e): use standard-1 instead of basic-4 for resize tests
poyrazK Apr 25, 2026
edefe29
fix(docker): set MemorySwap when resizing to avoid swap limit error
poyrazK Apr 25, 2026
d670652
feat(instances): add RBAC permission for instance resize
poyrazK Apr 25, 2026
856777f
fix(libvirt): fix vcpu conversion and conditional domain restart on r…
poyrazK Apr 25, 2026
fae9ee8
fix(instances): improve ResizeInstance reliability and correctness
poyrazK Apr 25, 2026
da2ed13
fix(instances): handler accepts name-or-uuid for resize, improve test…
poyrazK Apr 25, 2026
ae6f62f
fix(instances): update swagger docs and improve test coverage
poyrazK Apr 25, 2026
f1ed99c
fix(libvirt): replace regex XML patching with struct-based marshal
poyrazK Apr 25, 2026
30f4c82
refactor(tests): extract waitForInstanceStatus polling helper
poyrazK Apr 25, 2026
d2c9180
fix(migrations): correct 107 migration to use role_permissions schema
poyrazK Apr 25, 2026
007caff
chore(docs): sync swagger docs after minLength removal
poyrazK Apr 25, 2026
72a82ed
fix(lint): reduce cyclomatic complexity in ResizeInstance
poyrazK Apr 25, 2026
79f103f
refactor(instance): extract helper methods to reduce ResizeInstance c…
poyrazK Apr 25, 2026
e3f84ee
fix(lint): hardcode 90s timeout in waitForInstanceStatus
poyrazK Apr 25, 2026
ad496dc
fix(tests): add missing Compute mock for QuotaExceeded test cases
poyrazK Apr 25, 2026
c9e2b29
fix(code-review): address all remaining review findings
poyrazK Apr 25, 2026
f9bd3cf
fix(code-review): fix error format verb in rollback log
poyrazK Apr 25, 2026
c1c9bd8
fix(instance): fail fast on quota increment errors during resize
poyrazK Apr 25, 2026
1827d2b
fix(httputil): map QUOTA_EXCEEDED to 429 instead of 500
poyrazK Apr 25, 2026
325a007
fix(e2e): handle quota exceeded (429) as valid resize outcome
poyrazK Apr 25, 2026
2d6c519
chore(e2e): rewrite if-else to switch in TestResizeInstance
poyrazK Apr 25, 2026
21add30
docs: update ADR-025 and API docs for quota handling and 429 response
poyrazK Apr 25, 2026
2e69f79
fix: propagate quota decrement errors and add context timeouts to lib…
poyrazK Apr 25, 2026
4bc8053
fix: address review findings for instance resize
poyrazK Apr 25, 2026
fb305b3
fix(docs): correct quota exceeded HTTP status to 429 in ADR-025
poyrazK Apr 26, 2026
874ad54
Use package-level pre-compiled regexes in libvirt adapter
poyrazK Apr 26, 2026
be67b50
fix(instance): propagate rollback error and add decrement metrics
poyrazK Apr 26, 2026
a52d2ee
Merge main: resolve conflict in noop adapters
poyrazK Apr 26, 2026
d965ef6
fix: add ResizeInstance to ResilientCompute wrapper
poyrazK Apr 26, 2026
b9c2017
fix: move quota changes before compute resize in ResizeInstance
poyrazK Apr 26, 2026
dac50b3
fix(platform): add ResizeInstance to ResilientCompute and test mock
poyrazK Apr 26, 2026
4ca886d
fix(platform): remove duplicate ResizeInstance method from resilient_…
poyrazK Apr 26, 2026
23777a7
fix: improve ResizeInstance correctness and error reporting
poyrazK Apr 26, 2026
370af5e
Merge remote-tracking branch 'origin/fix/resize-quota-bug' into fix/r…
poyrazK Apr 26, 2026
6b2b149
Merge remote-tracking branch 'origin/main' into fix/resize-quota-bug
poyrazK Apr 26, 2026
9447dd7
fix(instance): correct memory quota unit (GB) and log rollback errors
poyrazK Apr 26, 2026
bfd9c00
fix: add optimistic lock conflict test and restore swagger annotation
poyrazK Apr 28, 2026
1b9b097
docs: update swagger 429 response from Quota Exceeded to Too Many Req…
poyrazK Apr 28, 2026
d42aca7
Merge remote-tracking branch 'origin/fix/resize-quota-bug' into fix/r…
poyrazK Apr 28, 2026
f3f267c
docs(adr-025): fix quota exceeded error code 403->429
poyrazK Apr 28, 2026
06799d0
fix: correct memory quota unit in resize operations
poyrazK Apr 28, 2026
862d83b
Merge remote-tracking branch 'origin/fix/resize-quota-bug' into fix/r…
poyrazK Apr 28, 2026
71ea6a1
fix: remove dead code and surface rollback errors in ResizeInstance
poyrazK Apr 28, 2026
65a4dbb
test: strengthen ResizeInstance conflict test and add rollback-failur…
poyrazK Apr 28, 2026
374b480
fix: align 429 swagger annotation with generated swagger docs
poyrazK Apr 28, 2026
62f857b
fix: remove unused package-level regex vars in libvirt adapter
poyrazK Apr 28, 2026
8ba954e
refactor: extract helpers from completeResize to reduce cyclomatic co…
poyrazK Apr 28, 2026
95a205e
test: propagate WaitForRunning skip to subsequent subtests in E2E tests
poyrazK Apr 29, 2026
49ef360
test: strengthen compute resize failure test assertions
poyrazK Apr 29, 2026
e556c5c
fix: address review findings from code review
poyrazK Apr 29, 2026
e20ca1a
feat(instance): return status in ResizeInstance response
poyrazK Apr 28, 2026
52a35fc
Trigger CI
poyrazK Apr 29, 2026
51d1f4b
fix: add retry logic to Docker ResizeInstance for transient failures
poyrazK Apr 29, 2026
9924cac
Merge remote-tracking branch 'origin/main' into fix/resize-quota-bug
poyrazK Apr 29, 2026
c047d34
docs: add ResizeInstanceResponse schema for proper API documentation
poyrazK Apr 30, 2026
754cbf5
fmt: fix indentation in instance.go
poyrazK Apr 30, 2026
abfc07c
fmt: apply go fmt to entire codebase
poyrazK Apr 30, 2026
66a5495
fix: handle version conflict in ResizeInstance gracefully
poyrazK Apr 30, 2026
dfdc488
ci: retrigger
poyrazK Apr 30, 2026
5f24d7b
ci: trigger new run with latest code
poyrazK Apr 30, 2026
da96ba1
Merge remote-tracking branch 'origin/main' into fix/resize-quota-bug
poyrazK May 2, 2026
39ef1c2
fix: update rollback test assertion to match actual error path
poyrazK May 2, 2026
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: 1 addition & 1 deletion cmd/cloud/function_schedule.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,4 +182,4 @@ func init() {
fnSchedCmd.AddCommand(fnSchedLogsCmd)

rootCmd.AddCommand(fnSchedCmd)
}
}
2 changes: 1 addition & 1 deletion cmd/cloud/igw.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,4 +140,4 @@ func init() {
igwCmd.AddCommand(igwRmCmd)

rootCmd.AddCommand(igwCmd)
}
}
2 changes: 1 addition & 1 deletion cmd/cloud/nat_gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,4 @@ func init() {
natGatewayCmd.AddCommand(natGatewayRmCmd)

rootCmd.AddCommand(natGatewayCmd)
}
}
2 changes: 1 addition & 1 deletion cmd/cloud/route_table.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,4 +178,4 @@ func init() {
routeTableCmd.AddCommand(routeTableDisassociateCmd)

rootCmd.AddCommand(routeTableCmd)
}
}
2 changes: 1 addition & 1 deletion docs/adr/ADR-025-instance-resize.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ After a successful resize, usage counters are updated with the delta (`Increment

- Instance not found → `404 NotFound`
- Current or target instance type invalid → `400 InvalidInput`
- Quota exceeded → `403 Forbidden`
- Quota exceeded → `429 Too Many Requests`
- Compute backend failure → `500 Internal` with metrics instrumentation (`resize_failure`)

---
Expand Down
20 changes: 17 additions & 3 deletions docs/swagger/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -4051,7 +4051,7 @@ const docTemplate = `{
"APIKeyAuth": []
}
],
"description": "Change the instance type (CPU/memory) of an existing instance",
"description": "Change the instance type (CPU/memory) of an existing instance. Note: Libvirt-backed instances require a brief restart (cold resize); Docker-backed instances support live resize without downtime.",
"consumes": [
"application/json"
],
Expand Down Expand Up @@ -4084,7 +4084,7 @@ const docTemplate = `{
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/httputil.Response"
"$ref": "#/definitions/httphandlers.ResizeInstanceResponse"
}
},
"400": {
Expand All @@ -4100,7 +4100,7 @@ const docTemplate = `{
}
},
"429": {
"description": "Quota Exceeded",
"description": "Too Many Requests",
"schema": {
"$ref": "#/definitions/httputil.Response"
}
Expand Down Expand Up @@ -11386,6 +11386,20 @@ const docTemplate = `{
}
}
},
"httphandlers.ResizeInstanceResponse": {
"type": "object",
"properties": {
"instance_type": {
"type": "string"
},
"message": {
"type": "string"
},
"status": {
"type": "string"
}
}
},
"httphandlers.RestoreBackupRequest": {
"type": "object",
"required": [
Expand Down
20 changes: 17 additions & 3 deletions docs/swagger/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -4043,7 +4043,7 @@
"APIKeyAuth": []
}
],
"description": "Change the instance type (CPU/memory) of an existing instance",
"description": "Change the instance type (CPU/memory) of an existing instance. Note: Libvirt-backed instances require a brief restart (cold resize); Docker-backed instances support live resize without downtime.",
"consumes": [
"application/json"
],
Expand Down Expand Up @@ -4076,7 +4076,7 @@
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/httputil.Response"
"$ref": "#/definitions/httphandlers.ResizeInstanceResponse"
}
},
"400": {
Expand All @@ -4092,7 +4092,7 @@
}
},
"429": {
"description": "Quota Exceeded",
"description": "Too Many Requests",
"schema": {
"$ref": "#/definitions/httputil.Response"
}
Expand Down Expand Up @@ -11378,6 +11378,20 @@
}
}
},
"httphandlers.ResizeInstanceResponse": {
"type": "object",
"properties": {
"instance_type": {
"type": "string"
},
"message": {
"type": "string"
},
"status": {
"type": "string"
}
}
},
"httphandlers.RestoreBackupRequest": {
"type": "object",
"required": [
Expand Down
17 changes: 14 additions & 3 deletions docs/swagger/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2340,6 +2340,15 @@ definitions:
required:
- instance_type
type: object
httphandlers.ResizeInstanceResponse:
properties:
instance_type:
type: string
message:
type: string
status:
type: string
type: object
httphandlers.RestoreBackupRequest:
properties:
backup_path:
Expand Down Expand Up @@ -5058,7 +5067,9 @@ paths:
post:
consumes:
- application/json
description: Change the instance type (CPU/memory) of an existing instance
description: 'Change the instance type (CPU/memory) of an existing instance.
Note: Libvirt-backed instances require a brief restart (cold resize); Docker-backed
instances support live resize without downtime.'
parameters:
- description: Instance ID
in: path
Expand All @@ -5077,7 +5088,7 @@ paths:
"200":
description: OK
schema:
$ref: '#/definitions/httputil.Response'
$ref: '#/definitions/httphandlers.ResizeInstanceResponse'
"400":
description: Bad Request
schema:
Expand All @@ -5087,7 +5098,7 @@ paths:
schema:
$ref: '#/definitions/httputil.Response'
"429":
description: Quota Exceeded
description: Too Many Requests
schema:
$ref: '#/definitions/httputil.Response'
"500":
Expand Down
2 changes: 1 addition & 1 deletion internal/adapters/vault/adapter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (
"net/http/httptest"
"testing"

"log/slog"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"log/slog"
)

func TestAdapter(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion internal/adapters/vault/transit_kms_adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,4 @@ func (a *TransitKMSAdapter) GenerateKey(ctx context.Context, keyID string) ([]by
}

// Ensure TransitKMSAdapter implements ports.KMSClient
var _ ports.KMSClient = (*TransitKMSAdapter)(nil)
var _ ports.KMSClient = (*TransitKMSAdapter)(nil)
Loading
Loading