fix(rocklet): skip kata dind setup when docker data-root cannot be created - #1309
Merged
Merged
Conversation
hzy123662
force-pushed
the
fix/kata-nonroot-dind
branch
from
August 4, 2026 08:26
bf06748 to
20269c8
Compare
…eated Non-root sandbox image users cannot create /var/lib/docker. With set -o errexit, the startup script exits before rocklet starts. Check the nearest existing parent of docker data-root and skip kata DinD setup with a warning when directory creation is not permitted. This preserves multi-level custom data-root paths rooted in writable directories.
hzy123662
force-pushed
the
fix/kata-nonroot-dind
branch
from
August 5, 2026 02:22
20269c8 to
c90678f
Compare
zhongwen666
approved these changes
Aug 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
setup_kata_dind;data-rootpaths.Problem
When a sandbox image uses a non-root default user,
docker_run.shcannot create/var/lib/docker.Because the script enables
set -o errexit, the permission error terminates the startup script before Rocklet starts.Implementation
When the Docker data-root does not exist, walk upward to find the nearest existing path and verify that it is:
If the directory cannot be created, the script only prints a warning. The DinD
mkdir,mknod, andmountsteps run only when the Docker data-root exists, sosetup_kata_dindreaches its normal end and the subsequent Rocklet startup continues.Test Plan
bash -n rock/rocklet/local_files/docker_run.shgit diff --checktests/unit/deployments/test_docker_env_injection.py: 8 passed/var/lib/docker: warning emitted, directory not created, Rocklet startup marker observed, exit code0data-root: directory created and exit code0mountandmknodmocked during local permission testsNo automated Shell test file was added because existing changes to
setup_kata_dindanddocker_run.shuse script-level and integration validation rather than a dedicated Shell unit-test framework. The existing Docker environment-injection unit suite was run as regression coverage.Real Kata runtime validation still needs to be performed on a Kata-enabled Linux worker.
refs #1308