Skip to content

Commit f6baf82

Browse files
fix: persists network user data (#211)
PR fixes #180 *Description of changes:* Persists the `cni` user data stored in `~/.local/share/cni` and in `~/.config/cni` *Testing done:* Manual testing ``` $ finch network create samtest --subnet 10.8.0.0/24 $ finch run --network=samtest --name hello public.ecr.aws/amazonlinux/amazonlinux:2 sleep 1 $ finch vm stop $ finch vm remove $ finch vm init $ finch start hello ``` #### License Acceptance By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. --------- Signed-off-by: Sam Berning <[email protected]> Signed-off-by: Hsing-Yu (David) Chen <[email protected]> Co-authored-by: Hsing-Yu (David) Chen <[email protected]>
1 parent 1578ce7 commit f6baf82

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

finch.yaml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,11 +149,25 @@ provision:
149149
script: |
150150
#!/bin/bash
151151
sudo chown $USER /mnt/lima-finch
152-
mkdir -p /mnt/lima-finch/containerd
153-
mkdir -p /mnt/lima-finch/nerdctl
154-
mkdir -p ~/.local/share/nerdctl
152+
153+
# https://github.com/containerd/nerdctl/blob/cffdf87ff4d648a5344eea1406bb95ca3ad7eaa4/extras/rootless/containerd-rootless.sh#L144-L146
154+
# XDG_DATA_HOME & ~/.local/share: https://github.com/containerd/nerdctl/blob/cffdf87ff4d648a5344eea1406bb95ca3ad7eaa4/extras/rootless/containerd-rootless.sh#L51
155+
mkdir -p /mnt/lima-finch/containerd ~/.local/share/containerd
155156
sudo mount --bind /mnt/lima-finch/containerd ~/.local/share/containerd
157+
158+
# https://github.com/containerd/nerdctl/blob/main/docs/dir.md#dataroot
159+
mkdir -p /mnt/lima-finch/nerdctl ~/.local/share/nerdctl
156160
sudo mount --bind /mnt/lima-finch/nerdctl ~/.local/share/nerdctl
161+
162+
# https://github.com/containerd/nerdctl/blob/main/docs/dir.md#netconfpath
163+
mkdir -p /mnt/lima-finch/cni-config ~/.config/cni
164+
sudo mount --bind /mnt/lima-finch/cni-config ~/.config/cni
165+
166+
# https://github.com/containerd/nerdctl/blob/cffdf87ff4d648a5344eea1406bb95ca3ad7eaa4/extras/rootless/containerd-rootless.sh#L148-L150
167+
# XDG_DATA_HOME & ~/.local/share: https://github.com/containerd/nerdctl/blob/cffdf87ff4d648a5344eea1406bb95ca3ad7eaa4/extras/rootless/containerd-rootless.sh#L51
168+
mkdir -p /mnt/lima-finch/cni-local ~/.local/share/cni
169+
sudo mount --bind /mnt/lima-finch/cni-local ~/.local/share/cni
170+
157171
systemctl --user restart containerd.service
158172
159173
# Probe scripts to check readiness.

0 commit comments

Comments
 (0)