Skip to content

Commit ec597cd

Browse files
authored
Merge branch 'main' into criu-nits
2 parents b123969 + 8eb2f43 commit ec597cd

File tree

5 files changed

+79
-4
lines changed

5 files changed

+79
-4
lines changed

.github/workflows/scheduled.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# This enables periodical execution of CI jobs in branches we maintain.
2+
#
3+
# CI jobs are triggered through here (instead of adding "schedule:" to the
4+
# appropriate files) because scheduled jobs are only run on the main branch.
5+
# In other words, it's a way to run periodical CI for other branches.
6+
7+
name: scheduled
8+
on:
9+
schedule:
10+
# Runs at 00:00 UTC every Sunday, Tuesday, Thursday.
11+
- cron: '0 0 * * 0,2,4'
12+
workflow_dispatch:
13+
permissions:
14+
contents: read
15+
actions: write
16+
17+
jobs:
18+
trigger-workflow:
19+
strategy:
20+
matrix:
21+
branch: ["main", "release-1.3"]
22+
wf_id: ["validate.yml", "test.yml"]
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Trigger ${{ matrix.wf_id }} workflow on ${{ matrix.branch}} branch
26+
uses: actions/github-script@v7
27+
with:
28+
github-token: ${{ secrets.GITHUB_TOKEN }}
29+
script: |
30+
await github.rest.actions.createWorkflowDispatch({
31+
owner: context.repo.owner,
32+
repo: context.repo.repo,
33+
workflow_id: '${{ matrix.wf_id }}',
34+
ref: '${{ matrix.branch }}'
35+
});

.github/workflows/test.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ on:
1010
- main
1111
- release-*
1212
pull_request:
13+
workflow_dispatch:
1314
permissions:
1415
contents: read
1516

@@ -32,12 +33,12 @@ jobs:
3233
# Disable most of criu-dev jobs, as they are expensive
3334
# (need to compile criu) and don't add much value/coverage.
3435
- criu: criu-dev
35-
go-version: 1.22.x
36+
go-version: 1.23.x
3637
- criu: criu-dev
3738
rootless: rootless
3839
- criu: criu-dev
3940
race: -race
40-
- go-version: 1.22.x
41+
- go-version: 1.23.x
4142
os: actuated-arm64-6cpu-8gb
4243
- race: "-race"
4344
os: actuated-arm64-6cpu-8gb

.github/workflows/validate.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77
- main
88
- release-*
99
pull_request:
10+
workflow_dispatch:
1011
env:
1112
GO_VERSION: 1.24
1213
permissions:
@@ -157,22 +158,26 @@ jobs:
157158
contents: read
158159
pull-requests: read
159160
runs-on: ubuntu-24.04
160-
# Only check commits on pull requests.
161-
if: github.event_name == 'pull_request'
162161
steps:
163162
- name: get pr commits
163+
if: github.event_name == 'pull_request' # Only check commits on pull requests.
164164
id: 'get-pr-commits'
165165
uses: tim-actions/[email protected]
166166
with:
167167
token: ${{ secrets.GITHUB_TOKEN }}
168168

169169
- name: check subject line length
170+
if: github.event_name == 'pull_request' # Only check commits on pull requests.
170171
uses: tim-actions/[email protected]
171172
with:
172173
commits: ${{ steps.get-pr-commits.outputs.commits }}
173174
pattern: '^.{0,72}(\n.*)*$'
174175
error: 'Subject too long (max 72)'
175176

177+
- name: succeed (not a PR) # Allow all-done to succeed for non-PRs.
178+
if: github.event_name != 'pull_request'
179+
run: echo "Nothing to check here."
180+
176181
cfmt:
177182
runs-on: ubuntu-24.04
178183
steps:

libcontainer/rootfs_linux.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,18 @@ func prepareRootfs(pipe *syncSocket, iConfig *initConfig) (err error) {
215215
return fmt.Errorf("error jailing process inside rootfs: %w", err)
216216
}
217217

218+
// Apply root mount propagation flags.
219+
// This must be done after pivot_root/chroot because the mount propagation flag is applied
220+
// to the current root ("/"), and not to the old rootfs before it becomes "/". Applying the
221+
// flag in prepareRoot would affect the host mount namespace if the container's
222+
// root mount is shared.
223+
// MS_PRIVATE is skipped as rootfsParentMountPrivate() is already called.
224+
if config.RootPropagation != 0 && config.RootPropagation&unix.MS_PRIVATE == 0 {
225+
if err := mount("", "/", "", uintptr(config.RootPropagation), ""); err != nil {
226+
return fmt.Errorf("unable to apply root propagation flags: %w", err)
227+
}
228+
}
229+
218230
if setupDev {
219231
if err := reOpenDevNull(); err != nil {
220232
return fmt.Errorf("error reopening /dev/null inside container: %w", err)
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/usr/bin/env bats
2+
3+
load helpers
4+
5+
function setup() {
6+
requires root
7+
setup_debian
8+
}
9+
10+
function teardown() {
11+
teardown_bundle
12+
}
13+
14+
@test "runc run [rootfsPropagation shared]" {
15+
update_config ' .linux.rootfsPropagation = "shared" '
16+
17+
update_config ' .process.args = ["findmnt", "--noheadings", "-o", "PROPAGATION", "/"] '
18+
19+
runc run test_shared_rootfs
20+
[ "$status" -eq 0 ]
21+
[ "$output" = "shared" ]
22+
}

0 commit comments

Comments
 (0)