Skip to content

Commit 7a44600

Browse files
authored
🌱 Use ubuntu 24.04 (#1617)
1 parent 893d9f6 commit 7a44600

File tree

10 files changed

+42
-41
lines changed

10 files changed

+42
-41
lines changed

api/v1beta1/hcloudmachine_validation_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ func TestValidateHCloudMachineSpec(t *testing.T) {
5050
name: "Immutable ImageName",
5151
args: args{
5252
oldSpec: HCloudMachineSpec{
53-
ImageName: "ubuntu-20.04",
53+
ImageName: "ubuntu-24.04",
5454
},
5555
newSpec: HCloudMachineSpec{
5656
ImageName: "centos-7",
@@ -110,13 +110,13 @@ func TestValidateHCloudMachineSpec(t *testing.T) {
110110
args: args{
111111
oldSpec: HCloudMachineSpec{
112112
Type: "cpx11",
113-
ImageName: "ubuntu-20.04",
113+
ImageName: "ubuntu-24.04",
114114
SSHKeys: []SSHKey{{Name: "ssh-key-1"}},
115115
PlacementGroupName: createPlacementGroupName("placement-group-1"),
116116
},
117117
newSpec: HCloudMachineSpec{
118118
Type: "cpx11",
119-
ImageName: "ubuntu-20.04",
119+
ImageName: "ubuntu-24.04",
120120
SSHKeys: []SSHKey{{Name: "ssh-key-1"}},
121121
PlacementGroupName: createPlacementGroupName("placement-group-1"),
122122
},

api/v1beta1/hetznerbaremetalmachine_types_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -253,11 +253,11 @@ func Test_Image_String(t *testing.T) {
253253
},
254254
{
255255
Image{
256-
URL: "https://user:[email protected]/images/Ubuntu-2204-jammy-amd64-custom.tar.gz",
257-
Name: "Ubuntu-2204",
256+
URL: "https://user:[email protected]/images/Ubuntu-2404-noble-amd64-custom.tar.gz",
257+
Name: "Ubuntu-2404-noble",
258258
Path: "",
259259
},
260-
"Ubuntu-2204 (https://user:[email protected]/images/Ubuntu-2204-jammy-amd64-custom.tar.gz)",
260+
"Ubuntu-2404-noble (https://user:[email protected]/images/Ubuntu-2404-noble-amd64-custom.tar.gz)",
261261
},
262262
{
263263
Image{
@@ -277,9 +277,9 @@ func Test_Image_String(t *testing.T) {
277277
{
278278
Image{
279279
Name: "nfs",
280-
Path: "/root/.oldroot/nfs/images/Ubuntu-2204-jammy-amd64-base.tar.gz",
280+
Path: "/root/.oldroot/nfs/images/Ubuntu-2404-noble-amd64-base.tar.gz",
281281
},
282-
"nfs (/root/.oldroot/nfs/images/Ubuntu-2204-jammy-amd64-base.tar.gz)",
282+
"nfs (/root/.oldroot/nfs/images/Ubuntu-2404-noble-amd64-base.tar.gz)",
283283
},
284284
} {
285285
require.Equal(t, row.expected, row.image.String())

api/v1beta1/hetznerbaremetalmachine_validation_test.go

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ func TestValidateHetznerBareMetalMachineSpecCreate(t *testing.T) {
3939
spec: HetznerBareMetalMachineSpec{
4040
InstallImage: InstallImage{
4141
Image: Image{
42-
Name: "ubuntu-20.04",
43-
URL: "https://example.com/ubuntu-20.04.tar.gz",
42+
Name: "ubuntu-24.04",
43+
URL: "https://example.com/ubuntu-24.04.tar.gz",
4444
},
4545
},
4646
},
@@ -77,22 +77,22 @@ func TestValidateHetznerBareMetalMachineSpecCreate(t *testing.T) {
7777
spec: HetznerBareMetalMachineSpec{
7878
InstallImage: InstallImage{
7979
Image: Image{
80-
Name: "ubuntu-20.04",
81-
URL: "https://example.com/ubuntu-20.04.invalid",
80+
Name: "ubuntu-24.04",
81+
URL: "https://example.com/ubuntu-24.04.invalid",
8282
},
8383
},
8484
},
8585
},
86-
want: field.Invalid(field.NewPath("spec", "installImage", "image", "url"), "https://example.com/ubuntu-20.04.invalid", "unknown image type in URL"),
86+
want: field.Invalid(field.NewPath("spec", "installImage", "image", "url"), "https://example.com/ubuntu-24.04.invalid", "unknown image type in URL"),
8787
},
8888
{
8989
name: "Valid HostSelector MatchLabels",
9090
args: args{
9191
spec: HetznerBareMetalMachineSpec{
9292
InstallImage: InstallImage{
9393
Image: Image{
94-
Name: "ubuntu-20.04",
95-
URL: "https://example.com/ubuntu-20.04.tar.gz",
94+
Name: "ubuntu-24.04",
95+
URL: "https://example.com/ubuntu-24.04.tar.gz",
9696
},
9797
},
9898
HostSelector: HostSelector{
@@ -110,8 +110,8 @@ func TestValidateHetznerBareMetalMachineSpecCreate(t *testing.T) {
110110
spec: HetznerBareMetalMachineSpec{
111111
InstallImage: InstallImage{
112112
Image: Image{
113-
Name: "ubuntu-20.04",
114-
URL: "https://example.com/ubuntu-20.04.tar.gz",
113+
Name: "ubuntu-24.04",
114+
URL: "https://example.com/ubuntu-24.04.tar.gz",
115115
},
116116
},
117117
HostSelector: HostSelector{
@@ -133,8 +133,8 @@ func TestValidateHetznerBareMetalMachineSpecCreate(t *testing.T) {
133133
spec: HetznerBareMetalMachineSpec{
134134
InstallImage: InstallImage{
135135
Image: Image{
136-
Name: "ubuntu-20.04",
137-
URL: "https://example.com/ubuntu-20.04.tar.gz",
136+
Name: "ubuntu-24.04",
137+
URL: "https://example.com/ubuntu-24.04.tar.gz",
138138
},
139139
},
140140
HostSelector: HostSelector{
@@ -166,8 +166,8 @@ func TestValidateHetznerBareMetalMachineSpecCreate(t *testing.T) {
166166
spec: HetznerBareMetalMachineSpec{
167167
InstallImage: InstallImage{
168168
Image: Image{
169-
Name: "ubuntu-20.04",
170-
URL: "https://example.com/ubuntu-20.04.tar.gz",
169+
Name: "ubuntu-24.04",
170+
URL: "https://example.com/ubuntu-24.04.tar.gz",
171171
},
172172
},
173173
HostSelector: HostSelector{
@@ -232,8 +232,8 @@ func TestValidateHetznerBareMetalMachineSpecUpdate(t *testing.T) {
232232
oldSpec: HetznerBareMetalMachineSpec{
233233
InstallImage: InstallImage{
234234
Image: Image{
235-
Name: "ubuntu-20.04",
236-
URL: "https://example.com/ubuntu-20.04.tar.gz",
235+
Name: "ubuntu-24.04",
236+
URL: "https://example.com/ubuntu-24.04.tar.gz",
237237
},
238238
},
239239
},
@@ -349,8 +349,8 @@ func TestValidateHetznerBareMetalMachineSpecUpdate(t *testing.T) {
349349
oldSpec: HetznerBareMetalMachineSpec{
350350
InstallImage: InstallImage{
351351
Image: Image{
352-
Name: "ubuntu-20.04",
353-
URL: "https://example.com/ubuntu-20.04.tar.gz",
352+
Name: "ubuntu-24.04",
353+
URL: "https://example.com/ubuntu-24.04.tar.gz",
354354
},
355355
},
356356
SSHSpec: SSHSpec{
@@ -381,8 +381,8 @@ func TestValidateHetznerBareMetalMachineSpecUpdate(t *testing.T) {
381381
newSpec: HetznerBareMetalMachineSpec{
382382
InstallImage: InstallImage{
383383
Image: Image{
384-
Name: "ubuntu-20.04",
385-
URL: "https://example.com/ubuntu-20.04.tar.gz",
384+
Name: "ubuntu-24.04",
385+
URL: "https://example.com/ubuntu-24.04.tar.gz",
386386
},
387387
},
388388
SSHSpec: SSHSpec{

controllers/hetznerbaremetalmachine_controller_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -698,7 +698,7 @@ var _ = Describe("HetznerBareMetalMachineReconciler", func() {
698698
})
699699

700700
It("should fail updating installImage", func() {
701-
bmMachine.Spec.InstallImage.Image.Name = "ubuntu-2204"
701+
bmMachine.Spec.InstallImage.Image.Name = "ubuntu-2404-noble"
702702
Expect(testEnv.Update(ctx, bmMachine)).NotTo(Succeed())
703703
})
704704

@@ -758,8 +758,8 @@ var _ = Describe("HetznerBareMetalMachineReconciler", func() {
758758
Spec: infrav1.HetznerBareMetalMachineSpec{
759759
InstallImage: infrav1.InstallImage{
760760
Image: infrav1.Image{
761-
Name: "ubuntu-20.04",
762-
URL: "https://example.com/ubuntu-20.04.tar.gz",
761+
Name: "ubuntu-24.04",
762+
URL: "https://example.com/ubuntu-24.04.tar.gz",
763763
},
764764
Partitions: []infrav1.Partition{
765765
{

docs/caph/03-reference/06-hetzner-bare-metal-machine-template.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -89,24 +89,24 @@ Example of an image provided by Hetzner via NFS:
8989

9090
```yaml
9191
image:
92-
path: /root/.oldroot/nfs//images/Ubuntu-2204-jammy-amd64-base.tar.gz
92+
path: /root/.oldroot/nfs//images/Ubuntu-2404-noble-amd64-base.tar.gz
9393
```
9494
9595
Example of an image provided by you via https. The script installimage of Hetzner parses the name to detect the version. It is
9696
recommended to follow their naming pattern.
9797
9898
```yaml
9999
image:
100-
name: Ubuntu-2204-jammy-amd64-custom
101-
url: https://user:[email protected]/images/Ubuntu-2204-jammy-amd64-custom.tar.gz
100+
name: Ubuntu-2404-noble-amd64-custom
101+
url: https://user:[email protected]/images/Ubuntu-2404-noble-amd64-custom.tar.gz
102102
```
103103
104104
Example of pulling an image from an oci-registry:
105105
106106
```yaml
107107
image:
108-
name: Ubuntu-2204-jammy-amd64-custom
109-
url: oci://ghcr.io/myorg/images/Ubuntu-2204-jammy-amd64-custom:1.0.1
108+
name: Ubuntu-2404-noble-amd64-custom
109+
url: oci://ghcr.io/myorg/images/Ubuntu-2404-noble-amd64-custom:1.0.1
110110
```
111111
112112
If you need credentials to pull the image, then provide the environment variable `OCI_REGISTRY_AUTH_TOKEN` to the controller.
@@ -138,6 +138,6 @@ spec:
138138
You can push an image to an oci-registry with a tool like [oras](https://oras.land):
139139

140140
```shell
141-
oras push ghcr.io/myorg/images/Ubuntu-2204-jammy-amd64-custom:1.0.1 \
142-
--artifact-type application/vnd.myorg.machine-image.v1 Ubuntu-2204-jammy-amd64-custom.tar.gz
141+
oras push ghcr.io/myorg/images/Ubuntu-2404-noble-amd64-custom:1.0.1 \
142+
--artifact-type application/vnd.myorg.machine-image.v1 Ubuntu-2404-noble-amd64-custom.tar.gz
143143
```

pkg/services/baremetal/host/host.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1947,7 +1947,7 @@ func markProvisionPending(host *infrav1.HetznerBareMetalHost, state infrav1.Prov
19471947
infrav1.ProvisionSucceededCondition,
19481948
infrav1.StillProvisioningReason,
19491949
clusterv1.ConditionSeverityInfo,
1950-
"host is still provisioning - state %q", state,
1950+
"host (%s) is still provisioning - state %q", host.Name, state,
19511951
)
19521952
}
19531953

templates/cluster-templates/bases/hetznerbaremetal-mt-control-plane-ubuntu.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ spec:
77
spec:
88
installImage:
99
image:
10-
path: /root/.oldroot/nfs/images/Ubuntu-2204-jammy-amd64-base.tar.gz
10+
path: /root/.oldroot/nfs/images/Ubuntu-2404-noble-amd64-base.tar.gz
1111
partitions:
1212
- fileSystem: esp
1313
mount: /boot/efi

templates/cluster-templates/bases/hetznerbaremetal-mt-md-1-ubuntu.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ spec:
77
spec:
88
installImage:
99
image:
10-
path: /root/.oldroot/nfs/images/Ubuntu-2204-jammy-amd64-base.tar.gz
10+
path: /root/.oldroot/nfs/images/Ubuntu-2404-noble-amd64-base.tar.gz
1111
partitions:
1212
- fileSystem: esp
1313
mount: /boot/efi

templates/cluster-templates/cluster-class.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,7 @@ spec:
656656
swraid: 0
657657
swraidLevel: 1
658658
image:
659-
path: /root/.oldroot/nfs/images/Ubuntu-2204-jammy-amd64-base.tar.gz
659+
path: /root/.oldroot/nfs/images/Ubuntu-2404-noble-amd64-base.tar.gz
660660
partitions:
661661
- fileSystem: esp
662662
mount: /boot/efi

test/e2e/data/infrastructure-hetzner/v1beta1/bases/hetznerbaremetalhosts.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ spec:
2121
# maintenanceMode: false
2222
# description: Test Machine 1716772
2323
# ---
24+
2425
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
2526
kind: HetznerBareMetalHost
2627
metadata:

0 commit comments

Comments
 (0)