Skip to content

Commit

Permalink
Merge pull request k0sproject#5598 from twz123/ostests-win
Browse files Browse the repository at this point in the history
Support provisoning of Windows Server 2022 in OS tests
  • Loading branch information
twz123 authored Feb 24, 2025
2 parents 8f3900c + f94d642 commit 1ba7ba4
Show file tree
Hide file tree
Showing 16 changed files with 333 additions and 197 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:
runs-on: ubuntu-24.04

env:
TERRAFORM_VERSION: 1.4.6
TOFU_VERSION: 1.9.0

defaults:
run:
Expand All @@ -81,11 +81,11 @@ jobs:
sparse-checkout: hack/ostests
persist-credentials: false

- uses: hashicorp/setup-terraform@v3
- uses: opentofu/setup-opentofu@v1
with:
terraform_version: ${{ env.TERRAFORM_VERSION }}
terraform_wrapper: false
tofu_version: ${{ env.TOFU_VERSION }}
tofu_wrapper: false

- run: terraform fmt -check
- run: terraform init
- run: terraform validate -no-color
- run: tofu fmt -check
- run: tofu init
- run: tofu validate -no-color
32 changes: 16 additions & 16 deletions .github/workflows/ostests-e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ on:
type: string
description: The k0s kube-proxy mode to test.
default: iptables
terraform-version:
tofu-version:
type: string
description: The Terraform version to use when provisioning test resources.
default: 1.4.6
description: The OpenTofu version to use when provisioning test resources.
default: 1.9.0
k0sctl-version:
type: string
description: The k0sctl version to use when bootstrapping the test cluster.
Expand Down Expand Up @@ -96,14 +96,14 @@ jobs:
echo KUBERNETES_VERSION="$kubernetesVersion" >>"$GITHUB_ENV"
echo K0SCTL_VERSION="$k0sctlVersion" >>"$GITHUB_ENV"
- name: "Terraform :: Requisites :: Download k0s"
- name: "Tofu :: Requisites :: Download k0s"
if: inputs.k0s-version == ''
uses: actions/download-artifact@v4
with:
name: k0s-linux-${{ inputs.arch }}
path: ${{ github.workspace }}/.cache

- name: "Terraform :: Requisites :: Prepare"
- name: "Tofu :: Requisites :: Prepare"
env:
OSTESTS_ARCH: ${{ inputs.arch }}
K0S_VERSION: ${{ inputs.k0s-version }}
Expand Down Expand Up @@ -131,27 +131,27 @@ jobs:
fi
echo TF_VAR_k0s_version="$K0S_VERSION" >>"$GITHUB_ENV"
- name: "Terraform :: Setup"
uses: hashicorp/setup-terraform@v3
- name: "Tofu :: Setup"
uses: opentofu/setup-opentofu@v1
with:
terraform_version: ${{ inputs.terraform-version }}
terraform_wrapper: false
tofu_version: ${{ inputs.tofu-version }}
tofu_wrapper: false

- name: "Terraform :: Init"
- name: "Tofu :: Init"
id: tf-init
run: terraform init
run: tofu init

- name: "Terraform :: Apply"
- name: "Tofu :: Apply"
id: tf-apply
env:
AWS_ACCESS_KEY_ID: ${{ secrets.aws-access-key-id }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.aws-secret-access-key }}
AWS_SESSION_TOKEN: ${{ secrets.aws-session-token }}
run: |
terraform apply -auto-approve
tofu apply -auto-approve
kubeconfigPath="$GITHUB_WORKSPACE/.cache/kubeconfig"
terraform output -raw k0s_kubeconfig >"$kubeconfigPath"
tofu output -raw k0s_kubeconfig >"$kubeconfigPath"
echo "KUBECONFIG=$kubeconfigPath" >>"$GITHUB_ENV"
# If concurrency is enabled, tests are executed in two phases. First, all
Expand Down Expand Up @@ -209,13 +209,13 @@ jobs:
sonobuoyTarGz="$(make --silent get-conformance-results)"
mv -- "$sonobuoyTarGz" sonobuoy-e2e-serial.tar.gz
- name: "Terraform :: Destroy"
- name: "Tofu :: Destroy"
if: always() && steps.tf-init.conclusion == 'success'
env:
AWS_ACCESS_KEY_ID: ${{ secrets.aws-access-key-id }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.aws-secret-access-key }}
AWS_SESSION_TOKEN: ${{ secrets.aws-session-token }}
run: terraform destroy -auto-approve
run: tofu destroy -auto-approve

- name: "e2e tests :: Upload results"
if: always() && (steps.e2e-retrieve-parallel.conclusion == 'success' || steps.e2e-retrieve-serial.conclusion == 'success')
Expand Down
180 changes: 83 additions & 97 deletions hack/ostests/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 1ba7ba4

Please sign in to comment.