Skip to content

Commit

Permalink
Merge pull request k0sproject#4768 from ncopa/ostests-alpine
Browse files Browse the repository at this point in the history
Add Alpine 3.20 to OS tests matrix
  • Loading branch information
ncopa authored Jul 18, 2024
2 parents d1fc38a + 8f9c54a commit f4fca97
Show file tree
Hide file tree
Showing 8 changed files with 61 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ostests-matrix.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ on:
default: >-
[
"al2023",
"alpine_3_17",
"alpine_3_17", "alpine_3_20",
"centos_7", "centos_8", "centos_9",
"debian_10", "debian_11", "debian_12",
"fcos_38",
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ostests-nightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ env:
DISTRIBUTIONS: >-
[
["al2023"],
["alpine_3_17"],
["alpine_3_17", "alpine_3_20"],
["centos_7", "centos_8", "centos_9"],
["debian_10", "debian_11", "debian_12"],
["fcos_38"],
Expand Down
9 changes: 5 additions & 4 deletions hack/ostests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Select the desired cluster configuration for Terraform. Again, just an example,
other ways described [here][tf-config].

```shell
export TF_VAR_os=alpine_3_17
export TF_VAR_os=alpine_3_20
export TF_VAR_arch=x86_64
export TF_VAR_k0s_version=stable
export TF_VAR_k0s_network_provider=calico
Expand All @@ -69,7 +69,8 @@ terraform apply
### `os`: Operating system stack

* `al2023`: Amazon Linux 2023
* `alpine_3_17`: Alpine Linux 3.17
* `alpine_3_20`: Alpine Linux 3.17
* `alpine_3_20`: Alpine Linux 3.20
* `centos_7`: CentOS Linux 7 (Core)
* `centos_8`: CentOS Stream 8
* `centos_9`: CentOS Stream 9
Expand Down Expand Up @@ -108,7 +109,7 @@ Assuming the AWS credentials are available, it can be used like this:

```sh
terraform init
export TF_VAR_os=alpine_3_17
export TF_VAR_os=alpine_3_20
export TF_VAR_k0sctl_skip=true
terraform apply
terraform output -json | jq -r '
Expand Down Expand Up @@ -165,7 +166,7 @@ workflow] that exposes more knobs and can be triggered manually, e.g. via [gh]:

```console
$ gh workflow run ostests-matrix.yaml --ref some/experimental/branch \
-f oses='["alpine_3_17"]' \
-f oses='["alpine_3_20"]' \
-f network-providers='["calico"]'
✓ Created workflow_dispatch event for ostests-matrix.yaml at some/experimental/branch

Expand Down
1 change: 1 addition & 0 deletions hack/ostests/modules/os/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ locals {
os = {
al2023 = local.os_al2023
alpine_3_17 = local.os_alpine_3_17
alpine_3_20 = local.os_alpine_3_20
centos_7 = local.os_centos_7
centos_8 = local.os_centos_8
centos_9 = local.os_centos_9
Expand Down
6 changes: 3 additions & 3 deletions hack/ostests/modules/os/os_alpine_3_17.tf
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,16 @@ locals {
default = {
ami_id = one(data.aws_ami.alpine_3_17.*.id)

user_data = templatefile("${path.module}/os_alpine_3_17_userdata.tftpl", { worker = true })
ready_script = file("${path.module}/os_alpine_3_17_ready.sh")
user_data = templatefile("${path.module}/os_alpine_userdata.tftpl", { worker = true })
ready_script = file("${path.module}/os_alpine_ready.sh")

connection = {
type = "ssh"
username = "alpine"
}
}
controller = {
user_data = templatefile("${path.module}/os_alpine_3_17_userdata.tftpl", { worker = false })
user_data = templatefile("${path.module}/os_alpine_userdata.tftpl", { worker = false })
}
}
}
Expand Down
50 changes: 50 additions & 0 deletions hack/ostests/modules/os/os_alpine_3_20.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# https://www.alpinelinux.org/cloud/

data "aws_ami" "alpine_3_20" {
count = var.os == "alpine_3_20" ? 1 : 0

owners = ["538276064493"]
name_regex = "^alpine-3\\.20\\.\\d+-(aarch64|x86_64)-uefi-tiny($|-.*)"
most_recent = true

filter {
name = "name"
values = ["alpine-3.20.*-*-uefi-tiny*"]
}

filter {
name = "architecture"
values = [var.arch]
}

filter {
name = "root-device-type"
values = ["ebs"]
}

filter {
name = "virtualization-type"
values = ["hvm"]
}
}

locals {
os_alpine_3_20 = var.os != "alpine_3_20" ? {} : {
node_configs = {
default = {
ami_id = one(data.aws_ami.alpine_3_20.*.id)

user_data = templatefile("${path.module}/os_alpine_userdata.tftpl", { worker = true })
ready_script = file("${path.module}/os_alpine_ready.sh")

connection = {
type = "ssh"
username = "alpine"
}
}
controller = {
user_data = templatefile("${path.module}/os_alpine_userdata.tftpl", { worker = false })
}
}
}
}
File renamed without changes.

0 comments on commit f4fca97

Please sign in to comment.