feat: remove unecessary board var

The install script can detect the board itself.
This commit is contained in:
Julian Tölle 2024-05-30 18:01:38 +02:00
parent b4a78b31bd
commit a47095bd2d
2 changed files with 3 additions and 13 deletions

View file

@ -70,7 +70,6 @@ for [`cluster-api-provider-hetzner`](https://github.com/syself/cluster-api-provi
The following variables are supported: The following variables are supported:
- `$architecture`: The Hetzner Cloud API architecture (`x86` or `arm`). - `$architecture`: The Hetzner Cloud API architecture (`x86` or `arm`).
- `$board`: The Flatcar Board identifier for the architecture (`amd64-usr` or `arm64-usr`).
- `$version`: The Flatcar version, if you are using `current`, this is resolved to the actual version in the snapshot. - `$version`: The Flatcar version, if you are using `current`, this is resolved to the actual version in the snapshot.
- `$channel`: The Flatcar release channel. - `$channel`: The Flatcar release channel.
@ -78,7 +77,6 @@ The default labels are:
- `os=flatcar` - `os=flatcar`
- `flatcar-channel=$channel` - `flatcar-channel=$channel`
- `flatcar-board=$board`
- `version=$version` - `version=$version`
- `architecture=$architecture` - `architecture=$architecture`

View file

@ -34,25 +34,18 @@ variable "version" {
variable "labels" { variable "labels" {
// Available replacements: // Available replacements:
// $architecture // $architecture
// $board
// $channel // $channel
// $version - if "current" was specified, this is resolved to the actual version // $version - if "current" was specified, this is resolved to the actual version
type = map(string) type = map(string)
default = { default = {
os = "flatcar" os = "flatcar"
flatcar-channel = "$channel" flatcar-channel = "$channel"
flatcar-board = "$board"
version = "$version" version = "$version"
architecture = "$architecture" architecture = "$architecture"
} }
} }
locals { locals {
boards = {
x86 = "amd64-usr"
arm = "arm64-usr"
}
architectures = ["x86", "arm"] architectures = ["x86", "arm"]
// If the user wants the "current" version, we still want to make the // If the user wants the "current" version, we still want to make the
@ -89,11 +82,10 @@ build {
snapshot_name = "flatcar-${var.channel}-${local.version}-${source.value}" snapshot_name = "flatcar-${var.channel}-${local.version}-${source.value}"
snapshot_labels = { snapshot_labels = {
for k, v in var.labels : k => replace(replace(replace(replace(v, for k, v in var.labels : k => replace(replace(replace(v,
"$channel", var.channel), "$channel", var.channel),
"$version", local.version), "$version", local.version),
"$architecture", source.value), "$architecture", source.value)
"$board", local.boards[source.value])
} }
} }
} }
@ -106,7 +98,7 @@ build {
"chmod +x flatcar-install", "chmod +x flatcar-install",
# Install flatcar # Install flatcar
"./flatcar-install -s -o hetzner -C ${var.channel} -B ${local.boards[source.name]} -V ${var.version} ", "./flatcar-install -s -o hetzner -C ${var.channel} -V ${var.version} ",
] ]
} }
} }