Skip to content

Commit 2f2aee7

Browse files
authored
fix: update VMs to use Ubuntu 24.04 (#280)
* fix: update VMs to use Ubuntu 24.04 Signed-off-by: chjmil <[email protected]> * chore: update comment Signed-off-by: chjmil <[email protected]> --------- Signed-off-by: chjmil <[email protected]>
1 parent 6ea54ec commit 2f2aee7

File tree

6 files changed

+18
-7
lines changed

6 files changed

+18
-7
lines changed

.github/release-drafter.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ categories:
2828
- 'refactor'
2929
- 'revert'
3030
- 'style'
31+
- 'revert'
3132
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
3233
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
3334
version-resolver:

.github/workflows/conventional-commits.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ jobs:
1414
- name: PR Conventional Commit Validation
1515
uses: ytanikin/[email protected]
1616
with:
17-
task_types: '["fix", "feat", "build", "chore", "ci", "docs", "style", "refactor", "perf", "test"]'
17+
task_types: '["fix", "feat", "build", "chore", "ci", "docs", "style", "refactor", "perf", "test", "revert"]'
1818
custom_labels: '{"feat": "enhancement", "fix": "bug", "docs": "documentation", "ci": "CI/CD", "perf": "performance"}'

modules/google_vm/main.tf

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,15 @@ resource "google_compute_instance" "google_vm" {
4848
}
4949
}
5050

51+
# Lifecycle settings for the resource
52+
lifecycle {
53+
ignore_changes = [
54+
# Ignore changes to boot disk, as it could cause
55+
# the VM to be recreated if the image is updated.
56+
boot_disk,
57+
]
58+
}
59+
5160
allow_stopping_for_update = true
5261
}
5362

modules/google_vm/variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ variable "ssh_public_key" {
6565
variable "os_image" {
6666
description = "OS Image to configure the VM with"
6767
type = string
68-
default = "ubuntu-os-cloud/ubuntu-2004-lts" # FAMILY/PROJECT glcoud compute images list
68+
default = "ubuntu-os-cloud/ubuntu-2404-lts-amd64" # FAMILY/PROJECT glcoud compute images list
6969
}
7070

7171

test/helpers/helper_test.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@
44
package helpers
55

66
import (
7+
"testing"
8+
79
"github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute"
810
"github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2020-10-01/resources"
911
"github.com/Azure/go-autorest/autorest/to"
1012
"github.com/stretchr/testify/assert"
11-
"testing"
1213
)
1314

1415
// TestRetrieveFromStruct tests the RetrieveFromStruct function, ensuring that values are correctly retrieved and
@@ -66,7 +67,7 @@ func TestRetrieveFromStruct(t *testing.T) {
6667
ImageReference: &compute.ImageReference{
6768
Offer: to.StringPtr("0001-com-ubuntu-server-focal"),
6869
Publisher: to.StringPtr("Canonical"),
69-
Sku: to.StringPtr("20_04-lts"),
70+
Sku: to.StringPtr("24_04-lts-amd64"),
7071
Version: to.StringPtr("latest"),
7172
},
7273
},
@@ -110,7 +111,7 @@ func TestRetrieveFromStruct(t *testing.T) {
110111
publisher := RetrieveFromStruct(nfsVM, "VirtualMachineProperties", "StorageProfile", "ImageReference", "Publisher")()
111112
assert.Equal(t, "Canonical", publisher)
112113
sku := RetrieveFromStruct(nfsVM, "VirtualMachineProperties", "StorageProfile", "ImageReference", "Sku")()
113-
assert.Equal(t, "20_04-lts", sku)
114+
assert.Equal(t, "24_04-lts-amd64", sku)
114115
version := RetrieveFromStruct(nfsVM, "VirtualMachineProperties", "StorageProfile", "ImageReference", "Version")()
115116
assert.Equal(t, "latest", version)
116117
}

vms.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ module "nfs_server" {
2929
tags = var.tags
3030

3131
subnet = local.subnet_names["misc"] // Name or self_link to subnet
32-
os_image = "ubuntu-os-cloud/ubuntu-2004-lts"
32+
os_image = "ubuntu-os-cloud/ubuntu-2404-lts-amd64"
3333

3434
vm_admin = var.nfs_vm_admin
3535
ssh_public_key = local.ssh_public_key
@@ -60,7 +60,7 @@ module "jump_server" {
6060
tags = var.tags
6161

6262
subnet = local.subnet_names["misc"] // Name or self_link to subnet
63-
os_image = "ubuntu-os-cloud/ubuntu-2004-lts"
63+
os_image = "ubuntu-os-cloud/ubuntu-2404-lts-amd64"
6464

6565
vm_admin = var.jump_vm_admin
6666
ssh_public_key = local.ssh_public_key

0 commit comments

Comments
 (0)