Skip to content

Commit 1ba7ba4

Browse files
authored
Merge pull request #5598 from twz123/ostests-win
Support provisoning of Windows Server 2022 in OS tests
2 parents 8f3900c + f94d642 commit 1ba7ba4

16 files changed

+333
-197
lines changed

.github/workflows/lint.yaml

+7-7
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ jobs:
6969
runs-on: ubuntu-24.04
7070

7171
env:
72-
TERRAFORM_VERSION: 1.4.6
72+
TOFU_VERSION: 1.9.0
7373

7474
defaults:
7575
run:
@@ -81,11 +81,11 @@ jobs:
8181
sparse-checkout: hack/ostests
8282
persist-credentials: false
8383

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

89-
- run: terraform fmt -check
90-
- run: terraform init
91-
- run: terraform validate -no-color
89+
- run: tofu fmt -check
90+
- run: tofu init
91+
- run: tofu validate -no-color

.github/workflows/ostests-e2e.yaml

+16-16
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ on:
3232
type: string
3333
description: The k0s kube-proxy mode to test.
3434
default: iptables
35-
terraform-version:
35+
tofu-version:
3636
type: string
37-
description: The Terraform version to use when provisioning test resources.
38-
default: 1.4.6
37+
description: The OpenTofu version to use when provisioning test resources.
38+
default: 1.9.0
3939
k0sctl-version:
4040
type: string
4141
description: The k0sctl version to use when bootstrapping the test cluster.
@@ -96,14 +96,14 @@ jobs:
9696
echo KUBERNETES_VERSION="$kubernetesVersion" >>"$GITHUB_ENV"
9797
echo K0SCTL_VERSION="$k0sctlVersion" >>"$GITHUB_ENV"
9898
99-
- name: "Terraform :: Requisites :: Download k0s"
99+
- name: "Tofu :: Requisites :: Download k0s"
100100
if: inputs.k0s-version == ''
101101
uses: actions/download-artifact@v4
102102
with:
103103
name: k0s-linux-${{ inputs.arch }}
104104
path: ${{ github.workspace }}/.cache
105105

106-
- name: "Terraform :: Requisites :: Prepare"
106+
- name: "Tofu :: Requisites :: Prepare"
107107
env:
108108
OSTESTS_ARCH: ${{ inputs.arch }}
109109
K0S_VERSION: ${{ inputs.k0s-version }}
@@ -131,27 +131,27 @@ jobs:
131131
fi
132132
echo TF_VAR_k0s_version="$K0S_VERSION" >>"$GITHUB_ENV"
133133
134-
- name: "Terraform :: Setup"
135-
uses: hashicorp/setup-terraform@v3
134+
- name: "Tofu :: Setup"
135+
uses: opentofu/setup-opentofu@v1
136136
with:
137-
terraform_version: ${{ inputs.terraform-version }}
138-
terraform_wrapper: false
137+
tofu_version: ${{ inputs.tofu-version }}
138+
tofu_wrapper: false
139139

140-
- name: "Terraform :: Init"
140+
- name: "Tofu :: Init"
141141
id: tf-init
142-
run: terraform init
142+
run: tofu init
143143

144-
- name: "Terraform :: Apply"
144+
- name: "Tofu :: Apply"
145145
id: tf-apply
146146
env:
147147
AWS_ACCESS_KEY_ID: ${{ secrets.aws-access-key-id }}
148148
AWS_SECRET_ACCESS_KEY: ${{ secrets.aws-secret-access-key }}
149149
AWS_SESSION_TOKEN: ${{ secrets.aws-session-token }}
150150
run: |
151-
terraform apply -auto-approve
151+
tofu apply -auto-approve
152152
153153
kubeconfigPath="$GITHUB_WORKSPACE/.cache/kubeconfig"
154-
terraform output -raw k0s_kubeconfig >"$kubeconfigPath"
154+
tofu output -raw k0s_kubeconfig >"$kubeconfigPath"
155155
echo "KUBECONFIG=$kubeconfigPath" >>"$GITHUB_ENV"
156156
157157
# If concurrency is enabled, tests are executed in two phases. First, all
@@ -209,13 +209,13 @@ jobs:
209209
sonobuoyTarGz="$(make --silent get-conformance-results)"
210210
mv -- "$sonobuoyTarGz" sonobuoy-e2e-serial.tar.gz
211211
212-
- name: "Terraform :: Destroy"
212+
- name: "Tofu :: Destroy"
213213
if: always() && steps.tf-init.conclusion == 'success'
214214
env:
215215
AWS_ACCESS_KEY_ID: ${{ secrets.aws-access-key-id }}
216216
AWS_SECRET_ACCESS_KEY: ${{ secrets.aws-secret-access-key }}
217217
AWS_SESSION_TOKEN: ${{ secrets.aws-session-token }}
218-
run: terraform destroy -auto-approve
218+
run: tofu destroy -auto-approve
219219

220220
- name: "e2e tests :: Upload results"
221221
if: always() && (steps.e2e-retrieve-parallel.conclusion == 'success' || steps.e2e-retrieve-serial.conclusion == 'success')

hack/ostests/.terraform.lock.hcl

+83-97
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)