fix: misc improvements (#1415)

- Stop overwriting the image's `ImageOS`. `ubuntu-latest` got `ubuntu20` on the 24.04 default image.
- Derive `ImageOS` from `os-release` when the image sets none. Fall back to `ubuntu24` for `ubuntu-latest`.
- Keep an `ImageOS` set in the job, step or container env.
- Honor the image's `ImageOS` on Kubernetes.
- Treat steps after a job timeout as cancelled. `cancelled()` and `always()` cleanup now runs. The job still fails.
- Record nested reusable workflow results. Jobs that `needs:` a nested call now run.
- Forward outputs through nested reusable workflows. A bad output fails the call.
- Pass the job's `GITHUB_TOKEN` and `GITEA_TOKEN` to called workflows by default. An explicit mapping overrides them.
- Probe a started container's uid and gid concurrently.
- Cache the Docker container env from its first inspect.
- Check `ImageOS` in the Kubernetes e2e test.

---------

Co-authored-by: bircni <[email protected]>
Reviewed-on: https://gitea.com/gitea/runner/pulls/1415
Reviewed-by: bircni <[email protected]>
Co-authored-by: silverwind <[email protected]>
This commit is contained in:
silverwindandbircni authored and bircni committed 2026-11-16 20:51:26 +00:00
1 parent 1f2ea1b83a
commit 0e4c8b6b78
18 files changed
+225 -56

No files matched your search

+4 -4
View File
@@ -193,7 +193,7 @@ func TestKubernetesPodRunsJobThroughAPI(t *testing.T) {
path := workdir + ":" + os.Getenv("PATH")
kubeconfig, cluster := fakeKubernetes(t, `{"spec":{"containers":[{},{}]},"status":{"phase":"Running","containerStatuses":[
{"name":"job","ready":true,"state":{"running":{}}},
{"name":"my-db","ready":true,"state":{"running":{}}}]}}`, "PATH="+path)
{"name":"my-db","ready":true,"state":{"running":{}}}]}}`, "PATH="+path, "ImageOS=ubuntu24-arm64")
options := KubernetesOptions{Kubeconfig: kubeconfig, RunnerUUID: "runner-uuid", PodTemplates: []map[string]any{
{"spec": map[string]any{
"automountServiceAccountToken": true,
@@ -309,9 +309,9 @@ func TestKubernetesPodRunsJobThroughAPI(t *testing.T) {
assert.Contains(t, lastExec(), "command="+url.QueryEscape(workdir+"/act/actions/sha/"))
assert.Contains(t, lastExec(), url.QueryEscape("gzip -dc |"))
pathEnv := map[string]string{}
require.NoError(t, job.UpdateFromImageEnv(&pathEnv)(ctx))
assert.Equal(t, path, pathEnv["PATH"])
imageEnv := map[string]string{}
require.NoError(t, job.UpdateFromImageEnv(&imageEnv)(ctx))
assert.Equal(t, map[string]string{"PATH": path, "ImageOS": "ubuntu24-arm64"}, imageEnv)
info, err := service.Inspect(ctx)
require.NoError(t, err)