1515 required : false
1616 default : false
1717 type : boolean
18+ no-hyperv :
19+ required : false
20+ default : false
21+ type : boolean
1822 binary :
1923 required : false
2024 default : nerdctl
2529 docker-version :
2630 required : true
2731 type : string
28- containerd-version :
32+ windows-containerd-version :
33+ required : true
34+ type : string
35+ windows-containerd-sha :
36+ required : true
37+ type : string
38+ linux-containerd-version :
2939 required : true
3040 type : string
31- containerd-sha :
41+ linux- containerd-sha :
3242 required : true
3343 type : string
34- containerd-service-sha :
44+ linux- containerd-service-sha :
3545 required : true
3646 type : string
3747 windows-cni-version :
@@ -66,15 +76,22 @@ jobs:
6676 GO_VERSION : ${{ inputs.go-version }}
6777 # Both Docker and nerdctl on linux need rootful right now
6878 WITH_SUDO : ${{ contains(inputs.runner, 'ubuntu') }}
69- CONTAINERD_VERSION : ${{ inputs.containerd-version }}
70- CONTAINERD_SHA : ${{ inputs.containerd-sha }}
79+ WINDOWS_CONTAINERD_VERSION : ${{ inputs.windows-containerd-version }}
80+ WINDOWS_CONTAINERD_SHA : ${{ inputs.windows-containerd-sha }}
81+ LINUX_CONTAINERD_VERSION : ${{ inputs.linux-containerd-version }}
82+ LINUX_CONTAINERD_SHA : ${{ inputs.linux-containerd-sha }}
7183
7284 steps :
7385 - name : " Init: checkout"
7486 uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
7587 with :
7688 fetch-depth : 1
7789
90+ - if : ${{ inputs.no-hyperv }}
91+ name : " Init (no-hyperv): Disable Hyper-V"
92+ run : |
93+ printf "NO_HYPERV=1\n" >> "$GITHUB_ENV"
94+
7895 - if : ${{ inputs.canary }}
7996 name : " Init (canary): retrieve latest go and containerd"
8097 env :
@@ -85,11 +102,22 @@ jobs:
85102
86103 [ "$latest_go" == "" ] || \
87104 printf "GO_VERSION=%s\n" "$latest_go" >> "$GITHUB_ENV"
88- [ "${latest_containerd:1}" == "$CONTAINERD_VERSION" ] || {
89- printf "CONTAINERD_VERSION=%s\n" "${latest_containerd:1}" >> "$GITHUB_ENV"
90- printf "CONTAINERD_SHA=canary is volatile and I accept the risk\n" >> "$GITHUB_ENV"
105+
106+ if [[ "${{ inputs.runner }}" == *windows* ]]; then
107+ containerd_version="$WINDOWS_CONTAINERD_VERSION"
108+ else
109+ containerd_version="$LINUX_CONTAINERD_VERSION"
110+ fi
111+ [ "${latest_containerd:1}" == "$containerd_version" ] || {
112+ if [[ "${{ inputs.runner }}" == *windows* ]]; then
113+ printf "WINDOWS_CONTAINERD_VERSION=%s\n" "${latest_containerd:1}" >> "$GITHUB_ENV"
114+ printf "WINDOWS_CONTAINERD_SHA=canary is volatile and I accept the risk\n" >> "$GITHUB_ENV"
115+ else
116+ printf "LINUX_CONTAINERD_VERSION=%s\n" "${latest_containerd:1}" >> "$GITHUB_ENV"
117+ printf "LINUX_CONTAINERD_SHA=canary is volatile and I accept the risk\n" >> "$GITHUB_ENV"
118+ fi
91119 }
92- if [ "$latest_go" == "" ] && [ "${latest_containerd:1}" == "$CONTAINERD_VERSION " ]; then
120+ if [ "$latest_go" == "" ] && [ "${latest_containerd:1}" == "$containerd_version " ]; then
93121 echo "::warning title=No canary::There is currently no canary versions to test. Steps will not run.";
94122 printf "SHOULD_RUN=no\n" >> "$GITHUB_ENV"
95123 fi
@@ -128,7 +156,7 @@ jobs:
128156 # FIXME: this is missing runc (see top level workflow note about the state of this)
129157 echo "::group:: install dependencies"
130158 sudo ./hack/provisioning/linux/containerd.sh uninstall
131- ./hack/provisioning/linux/containerd.sh rootful "$CONTAINERD_VERSION " "amd64" "$CONTAINERD_SHA " "${{ inputs.containerd-service-sha }}"
159+ ./hack/provisioning/linux/containerd.sh rootful "$LINUX_CONTAINERD_VERSION " "amd64" "$LINUX_CONTAINERD_SHA " "${{ inputs.linux- containerd-service-sha }}"
132160 sudo ./hack/provisioning/linux/cni.sh uninstall
133161 ./hack/provisioning/linux/cni.sh install "${{ inputs.linux-cni-version }}" "amd64" "${{ inputs.linux-cni-sha }}"
134162 echo "::endgroup::"
@@ -164,7 +192,8 @@ jobs:
164192 - if : ${{ contains(inputs.runner, 'windows') && env.SHOULD_RUN == 'yes' }}
165193 name : " Init (windows): prepare host"
166194 env :
167- ctrdVersion : ${{ env.CONTAINERD_VERSION }}
195+ ctrdVersion : ${{ env.WINDOWS_CONTAINERD_VERSION }}
196+ ctrdSha : ${{ env.WINDOWS_CONTAINERD_SHA }}
168197 run : |
169198 # Install WinCNI
170199 echo "::group:: install wincni"
0 commit comments