Skip to content

Commit bf71b6d

Browse files
authored
fix(instance): restore location field in json output (#5210)
1 parent 12e34bf commit bf71b6d

File tree

3 files changed

+421
-418
lines changed

3 files changed

+421
-418
lines changed

internal/namespaces/instance/v1/custom_server.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,7 @@ type customServer struct {
408408
Arch instance.Arch `json:"arch"`
409409
PlacementGroup *instance.PlacementGroup `json:"placement_group"`
410410
Zone scw.Zone `json:"zone"`
411+
Location *instance.ServerLocation `json:"location"`
411412
AdminPasswordEncryptionSSHKeyID *string `json:"admin_password_encryption_ssh_key_id"`
412413
AdminPasswordEncryptedValue *string `json:"admin_password_encrypted_value"`
413414
Filesystems []*instance.ServerFilesystem `json:"filesystems"`
@@ -440,6 +441,7 @@ func customServerFromInstanceServer(server *instance.Server) *customServer {
440441
Arch: server.Arch,
441442
PlacementGroup: server.PlacementGroup,
442443
Zone: server.Zone,
444+
Location: server.Location,
443445
AdminPasswordEncryptionSSHKeyID: server.AdminPasswordEncryptionSSHKeyID,
444446
AdminPasswordEncryptedValue: server.AdminPasswordEncryptedValue,
445447
Filesystems: server.Filesystems,

internal/namespaces/instance/v1/testdata/test-get-server-simple.cassette.yaml

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

internal/namespaces/instance/v1/testdata/test-get-server-simple.golden

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
22
🟩🟩🟩 STDOUT️ 🟩🟩🟩️
3-
ID 9b14016b-b1d9-4ab9-a0bb-17a5702cdabc
4-
Name cli-srv-adoring-edison
3+
ID 28d0b697-6469-4839-94cc-8746a8e506b3
4+
Name cli-srv-vibrant-jepsen
55
Organization fa1e3217-dc80-42ac-85c3-3f034b78b552
66
Project fa1e3217-dc80-42ac-85c3-3f034b78b552
77
CommercialType DEV1-S
88
CreationDate few seconds ago
99
DynamicIPRequired false
1010
RoutedIPEnabled true
11-
Hostname cli-srv-adoring-edison
11+
Hostname cli-srv-vibrant-jepsen
1212
Protected false
13-
MacAddress de:00:00:d1:46:1d
13+
MacAddress de:00:00:d8:f5:fb
1414
ModificationDate few seconds ago
1515
State archived
1616
StateDetail -
@@ -41,7 +41,7 @@ Allowed Actions:
4141

4242
Volumes:
4343
ID NAME SIZE VOLUME TYPE IOPS STATE CREATION DATE MODIFICATION DATE BOOT ZONE
44-
bf509bb0-1f87-40cc-80fe-b866b919aeae Ubuntu 22.04 Jammy Jellyfish_sbs_volume_0 10 GB sbs_5k 5K in_use few seconds ago few seconds ago false fr-par-1
44+
e3fbb54f-ea7f-46c2-8434-a105741a8867 Ubuntu 22.04 Jammy Jellyfish_sbs_volume_0 10 GB sbs_5k 5K in_use few seconds ago few seconds ago false fr-par-1
4545

4646
Public IPs:
4747
ID ADDRESS GATEWAY NETMASK FAMILY DYNAMIC PROVISIONING MODE TAGS IPAM ID STATE
@@ -53,8 +53,8 @@ Server Filesystems:
5353
FILESYSTEM ID STATE
5454
🟩🟩🟩 JSON STDOUT 🟩🟩🟩
5555
{
56-
"id": "9b14016b-b1d9-4ab9-a0bb-17a5702cdabc",
57-
"name": "cli-srv-adoring-edison",
56+
"id": "28d0b697-6469-4839-94cc-8746a8e506b3",
57+
"name": "cli-srv-vibrant-jepsen",
5858
"organization": "fa1e3217-dc80-42ac-85c3-3f034b78b552",
5959
"project": "fa1e3217-dc80-42ac-85c3-3f034b78b552",
6060
"allowed_actions": [
@@ -66,7 +66,7 @@ FILESYSTEM ID STATE
6666
"creation_date": "1970-01-01T00:00:00.0Z",
6767
"dynamic_ip_required": false,
6868
"routed_ip_enabled": true,
69-
"hostname": "cli-srv-adoring-edison",
69+
"hostname": "cli-srv-vibrant-jepsen",
7070
"image": {
7171
"id": "6d3c053e-c728-4294-b23a-560b62a4d592",
7272
"name": "Ubuntu 22.04 Jammy Jellyfish",
@@ -92,7 +92,7 @@ FILESYSTEM ID STATE
9292
"protected": false,
9393
"private_ip": null,
9494
"public_ips": [],
95-
"mac_address": "de:00:00:d1:46:1d",
95+
"mac_address": "de:00:00:d8:f5:fb",
9696
"modification_date": "1970-01-01T00:00:00.0Z",
9797
"state": "stopped",
9898
"state_detail": "",
@@ -105,13 +105,14 @@ FILESYSTEM ID STATE
105105
"arch": "x86_64",
106106
"placement_group": null,
107107
"zone": "fr-par-1",
108+
"location": null,
108109
"admin_password_encryption_ssh_key_id": null,
109110
"admin_password_encrypted_value": null,
110111
"filesystems": [],
111112
"end_of_service": false,
112113
"Volumes": [
113114
{
114-
"id": "bf509bb0-1f87-40cc-80fe-b866b919aeae",
115+
"id": "e3fbb54f-ea7f-46c2-8434-a105741a8867",
115116
"name": "Ubuntu 22.04 Jammy Jellyfish_sbs_volume_0",
116117
"size": 10000000000,
117118
"volume_type": "sbs_5k",

0 commit comments

Comments
 (0)