mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-09-16 06:18:58 +00:00
genpolicy: allow specifying layer cache file
Add --layers-cache-file-path flag to allow the user to specify where the cache file for the container layers is saved. This allows e.g. to have one cache file independent of the user's working directory. Signed-off-by: Leonard Cohnen <lc@edgeless.systems>
This commit is contained in:
@@ -63,6 +63,20 @@ setup() {
|
||||
kubectl wait --for=condition=Ready "--timeout=${timeout}" pod "${pod_name}"
|
||||
}
|
||||
|
||||
@test "Successful pod with auto-generated policy and custom layers cache path" {
|
||||
tmp_path=$(mktemp -d)
|
||||
|
||||
auto_generate_policy "${pod_config_dir}" "${testcase_pre_generate_pod_yaml}" "${testcase_pre_generate_configmap_yaml}" \
|
||||
"--layers-cache-file-path=${tmp_path}/cache.json"
|
||||
|
||||
[ -f "${tmp_path}/cache.json" ]
|
||||
rm -r "${tmp_path}"
|
||||
|
||||
kubectl create -f "${testcase_pre_generate_configmap_yaml}"
|
||||
kubectl create -f "${testcase_pre_generate_pod_yaml}"
|
||||
kubectl wait --for=condition=Ready "--timeout=${timeout}" pod "${pod_name}"
|
||||
}
|
||||
|
||||
# Common function for several test cases from this bats script.
|
||||
test_pod_policy_error() {
|
||||
kubectl create -f "${correct_configmap_yaml}"
|
||||
|
Reference in New Issue
Block a user