Skip to content

Commit

Permalink
Enable mock filesystems in KIND
Browse files Browse the repository at this point in the history
On the docker host, the /tmp/nnf dir is expected to be mounted into each docker
container as /mnt/nnf.

The k8s pods will add volume mounts for /mnt/nnf and will place their mock
devices and filesystems there.

Signed-off-by: Dean Roehrich <[email protected]>
  • Loading branch information
roehrich-hpe committed Nov 20, 2024
1 parent 77fda8f commit a1298a4
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion tools/kind.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ set -o pipefail
CMD="$1"
shift

function clear_mock_fs {
if [[ -d /tmp/nnf ]]; then
rm -rf /tmp/nnf
mkdir /tmp/nnf
fi
}

function create_cluster {
CONFIG=kind-config.yaml

Expand All @@ -33,7 +40,7 @@ function create_cluster {
extraMounts:
- hostPath: /tmp/nnf
containerPath: /nnf
containerPath: /mnt/nnf
propagation: None
EOF
)
Expand Down Expand Up @@ -76,6 +83,8 @@ nodes:
- role: worker $RABBITCONFIG
EOF

# Clear any earlier mock filesystem environment.
clear_mock_fs
# create a file for data movement
if [ ! -f /tmp/nnf/file.in ]; then
mkdir -p /tmp/nnf && dd if=/dev/zero of=/tmp/nnf/file.in bs=128 count=0 seek=$((1024 * 1024))
Expand Down Expand Up @@ -156,6 +165,7 @@ function argocd_add_git_repo {

function destroy_cluster {
kind delete cluster
clear_mock_fs
}

function reset_cluster {
Expand Down

0 comments on commit a1298a4

Please sign in to comment.