Skip to content

Commit 3a1cf98

Browse files
committed
fix(dedicated_server{,_reinstall_task}): remove properties and set byolinux image URL to latest
ref: #PUBM-43183 Signed-off-by: Jean-Baptiste Delon <[email protected]>
1 parent 975c93b commit 3a1cf98

12 files changed

+18
-62
lines changed

docs/guides/dedicated_server_migration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ resource "ovh_dedicated_server" "srv" {
9292
#
9393
9494
lifecycle {
95-
ignore_changes = [os, customizations, properties, storage]
95+
ignore_changes = [os, customizations, storage]
9696
}
9797
}
9898
```

docs/resources/dedicated_server.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,6 @@ resource "ovh_dedicated_server" "server" {
140140
* `raid_level` - Software raid type
141141
* `size` - Partition size in MiB
142142
* `scheme_name` - Partitioning scheme (if applicable with selected operating system)
143-
* `properties` - Deprecated, has no effect
144143

145144
### Arguments used to control the lifecycle of a dedicated server
146145

docs/resources/dedicated_server_reinstall_task.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,8 +239,6 @@ The following arguments are supported:
239239

240240
~> **WARNING** Some customizations may be required on some Operating Systems. [Check how to list the available and required customization(s) for your operating system](https://help.ovhcloud.com/csm/en-dedicated-servers-api-os-installation?id=kb_article_view&sysparm_article=KB0061951#os-inputs) (do not forget to adapt camel case customization name to snake case parameter).
241241

242-
* `properties` - Deprecated, has no effect
243-
244242
* `storage`: OS reinstallation storage configurations. [More details about disks, hardware/software RAID and partitioning configuration](https://help.ovhcloud.com/csm/en-dedicated-servers-api-partitioning?id=kb_article_view&sysparm_article=KB0043882) (do not forget to adapt camel case parameters to snake case parameters).
245243
* `disk_group_id`: Disk group id to install the OS to (default is 0, meaning automatic).
246244
* `hardware_raid`: Hardware Raid configurations (if not specified, all disks of the chosen disk group id will be configured in JBOD mode).

examples/resources/dedicated_server_reinstall_task/example_4.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ resource "ovh_dedicated_server_reinstall_task" "server_install" {
1919
http_headers = {
2020
Authorization = "Basic bG9naW46cGFzc3dvcmQ="
2121
}
22-
image_url = "https://github.com/ashmonger/akution_test/releases/download/0.5-compress/deb11k6.qcow2"
22+
image_url = "https://github.com/ashmonger/akution_test/releases/latest/download/deb11k6.qcow2"
2323
}
2424
}

ovh/resource_dedicated_server.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -302,10 +302,9 @@ func (r *dedicatedServerResource) Update(ctx context.Context, req resource.Updat
302302
responseData.MergeWith(&stateData)
303303
responseData.ID = responseData.ServiceName
304304

305-
// Explicitely set Customizations/Properties/Storage to what was defined in the plan
305+
// Explicitely set Customizations/Storage to what was defined in the plan
306306
// as we can't determine the right thing to do in MergeWith function
307307
responseData.Customizations = planData.Customizations
308-
responseData.Properties = planData.Properties
309308
responseData.Storage = planData.Storage
310309

311310
// Same thing for the flags to control reinstallation, set the plan value explicitly
@@ -464,8 +463,7 @@ func (r *dedicatedServerResource) reinstallDedicatedServer(ctx context.Context,
464463
if planData.Os.ValueString() != "" &&
465464
stateData.Os.ValueString() != planData.Os.ValueString() ||
466465
!stateData.Customizations.Equal(planData.Customizations) ||
467-
!stateData.Storage.Equal(planData.Storage) ||
468-
!stateData.Properties.Equal(planData.Properties) {
466+
!stateData.Storage.Equal(planData.Storage) {
469467
shouldReinstall = true
470468
}
471469
}

ovh/resource_dedicated_server_gen.go

Lines changed: 12 additions & 33 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ovh/resource_dedicated_server_reinstall_task.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -135,15 +135,6 @@ func resourceDedicatedServerReinstallTask() *schema.Resource {
135135
},
136136
},
137137
},
138-
"properties": {
139-
Type: schema.TypeMap,
140-
Optional: true,
141-
ForceNew: true,
142-
Description: "Attribute 'properties' is deprecated and has no effect",
143-
Elem: &schema.Schema{
144-
Type: schema.TypeString,
145-
},
146-
},
147138
"storage": {
148139
Type: schema.TypeList,
149140
Optional: true,

ovh/resource_dedicated_server_reinstall_task_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ resource "ovh_dedicated_server_reinstall_task" "server_reinstall" {
292292
os = "byolinux_64"
293293
customizations {
294294
hostname = "mon-tux"
295-
image_url = "https://github.com/ashmonger/akution_test/releases/download/0.6-fixCache/deb11k6.qcow2"
295+
image_url = "https://github.com/ashmonger/akution_test/releases/latest/download/deb11k6.qcow2"
296296
efi_bootloader_path = "\\efi\\debian\\grubx64.efi"
297297
ssh_key = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIrODOo0SvY5f0TlQNvGHIRKzr4bHPa+D5bYF18RiOgP [email protected]"
298298
config_drive_user_data = "c3NoX2F1dGhvcml6ZWRfa2V5czoKICAtIHNzaC1yc2EgQUFBQUI4ZGpZaXc9PSBteXNlbGZAbXlkb21haW4ubmV0Cgp1c2VyczoKICAtIG5hbWU6IHBhdGllbnQwCiAgICBzdWRvOiBBTEw9KEFMTCkgTk9QQVNTV0Q6QUxMCiAgICBncm91cHM6IHVzZXJzLCBzdWRvCiAgICBzaGVsbDogL2Jpbi9iYXNoCiAgICBsb2NrX3Bhc3N3ZDogZmFsc2UKICAgIHNzaF9hdXRob3JpemVkX2tleXM6CiAgICAgIC0gc3NoLXJzYSBBQUFBQjhkallpdz09IG15c2VsZkBteWRvbWFpbi5uZXQKZGlzYWJsZV9yb290OiBmYWxzZQpwYWNrYWdlczoKICAtIHZpbQogIC0gdHJlZQpmaW5hbF9tZXNzYWdlOiBUaGUgc3lzdGVtIGlzIGZpbmFsbHkgdXAsIGFmdGVyICRVUFRJTUUgc2Vjb25kcw=="

ovh/types_dedicated_server.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ type DedicatedServerTask struct {
119119
type DedicatedServerReinstallTaskCreateOpts struct {
120120
Os string `json:"operatingSystem"`
121121
Customizations *DedicatedServerReinstallTaskCustomizations `json:"customizations,omitempty"`
122-
Properties map[string]interface{} `json:"properties,omitempty"`
123122
Storage []DedicatedServerReinstallTaskStorage `json:"storage,omitempty"`
124123
}
125124

@@ -131,11 +130,6 @@ func (opts *DedicatedServerReinstallTaskCreateOpts) FromResource(d *schema.Resou
131130
opts.Customizations = (&DedicatedServerReinstallTaskCustomizations{}).FromResource(d, "customizations.0")
132131
}
133132

134-
Properties := d.Get("properties").(map[string]interface{})
135-
if len(Properties) >= 1 {
136-
opts.Properties = d.Get("properties").(map[string]interface{})
137-
}
138-
139133
Storage := d.Get("storage").([]interface{})
140134
if len(Storage) >= 1 {
141135
opts.Storage = make([]DedicatedServerReinstallTaskStorage, len(Storage))

templates/guides/dedicated_server_migration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ resource "ovh_dedicated_server" "srv" {
9292
#
9393
9494
lifecycle {
95-
ignore_changes = [os, customizations, properties, storage]
95+
ignore_changes = [os, customizations, storage]
9696
}
9797
}
9898
```

0 commit comments

Comments
 (0)