platform: Hetzner API implementation
Add support for the Hetzner Platform to kola and ore.
Usage looks like:
HETZNER_IMAGE_ID=$(./bin/ore \
hetzner \
--hetzner-token $(pass hetzner/token) \
--hetzner-location fsn1 \
create-image \
--name flatcar-nightly \
--file http://bincache.flatcar-linux.net/images/amd64/4011.0.0+nightly-20240624-2100/flatcar_production_hetzner_image.bin.bz2)
./bin/kola \
--platform hetzner \
--hetzner-token $(pass hetzner/token) \
--hetzner-server-type cpx11 \
--hetzner-location fsn1 \
--hetzner-image "${HETZNER_IMAGE_ID}"
run '*'
- Squashed all commits into 5 along the lines you suggested and had in #533.
- Rebased on current
flatcar-masterand changed the PR target branch to it. - Updated
hcloud-goto latest version
All tests besides one work for me with this version. The failing test looks weird to me, in that it tries to parse cloud-init config.
--- FAIL: cl.cloudinit.basic (292.05s)
cluster.go:125: cat: /foo: No such file or directory
cluster.go:145: "cat /foo" failed: output , status Process exited with status 1
Squashed all commits into 5 along the lines you suggested and had in [wip] platform: add Hetzner #533.
Rebased on current
flatcar-masterand changed the PR target branch to it.Updated
hcloud-goto latest versionAll tests besides one work for me with this version. The failing test looks weird to me, in that it tries to parse
cloud-initconfig.--- FAIL: cl.cloudinit.basic (292.05s) cluster.go:125: cat: /foo: No such file or directory cluster.go:145: "cat /foo" failed: output , status Process exited with status 1
Great, thanks a lot for the cleanup. For the failing test, I suspect it's because the coreos-cloudinit support is not implemented for Hetzner: https://github.com/flatcar/coreos-cloudinit/tree/flatcar-master/datasource/metadata
Flatcar does not ship the "official" cloudinit but a rewriting in Go that implements a subset of the official cloud-init. I think for now we can skip this test and we can still implement the Hetzner cloudinit support later.
diff --git a/kola/tests/misc/cloudinit.go b/kola/tests/misc/cloudinit.go
index 9ef74d541..0abce80a4 100644
--- a/kola/tests/misc/cloudinit.go
+++ b/kola/tests/misc/cloudinit.go
@@ -156,7 +156,8 @@ write_files:
- path: "/foo"
content: bar`),
Distros: []string{"cl"},
- ExcludePlatforms: []string{"qemu-unpriv"},
+ // Hetzner: we need to implement coreos-cloudinit support for Hetzner.
+ ExcludePlatforms: []string{"qemu-unpriv", "hetzner"},
// This should run on all clouds
})
register.Register(®ister.Test{
The CI failure is "normal" (here: https://github.com/flatcar/mantle/actions/runs/10253573202/job/28366511620?pr=536) - it's because you pushed from a fork.
Disabled the cloudinit test in 1ce68f96df08893734d5f0b40c576ad3928dcc1c.