From 9a685821f26cf7e9113fd8ee7aa70cd6e0d03d663507d1c5724c46bc9098dca7 Mon Sep 17 00:00:00 2001 From: Vasily Ulyanov Date: Tue, 27 Aug 2024 15:11:10 +0000 Subject: [PATCH] - Fix permission error in storage migration tests 0002-tests-Set-FSGroup-to-ensure-proper-permissions.patch OBS-URL: https://build.opensuse.org/package/show/Virtualization/kubevirt?expand=0&rev=163 --- ...FSGroup-to-ensure-proper-permissions.patch | 44 +++++++++++++++++++ kubevirt.changes | 4 +- kubevirt.spec | 1 + 3 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 0002-tests-Set-FSGroup-to-ensure-proper-permissions.patch diff --git a/0002-tests-Set-FSGroup-to-ensure-proper-permissions.patch b/0002-tests-Set-FSGroup-to-ensure-proper-permissions.patch new file mode 100644 index 0000000..52acf87 --- /dev/null +++ b/0002-tests-Set-FSGroup-to-ensure-proper-permissions.patch @@ -0,0 +1,44 @@ +From 96bd87f47a1f0ba7c0079e8665f94d7cd38f3038 Mon Sep 17 00:00:00 2001 +From: Vasiliy Ulyanov +Date: Mon, 26 Aug 2024 08:18:52 +0200 +Subject: [PATCH] tests: Set FSGroup to ensure proper permissions + +This fixes 'Permission Denied' error with some storage providers. + +Signed-off-by: Vasiliy Ulyanov +--- + tests/storage/migration.go | 12 ++++++++---- + 1 file changed, 8 insertions(+), 4 deletions(-) + +diff --git a/tests/storage/migration.go b/tests/storage/migration.go +index c6911848b..bb17cfdde 100644 +--- a/tests/storage/migration.go ++++ b/tests/storage/migration.go +@@ -459,16 +459,20 @@ func createSmallImageForDestinationMigration(vm *virtv1.VirtualMachine, name, si + }, + }, + } ++ podSecurityContext := k8sv1.PodSecurityContext{ ++ FSGroup: pointer.P(int64(util.NonRootUID)), ++ } + pod := k8sv1.Pod{ + ObjectMeta: metav1.ObjectMeta{ + GenerateName: "create-img-", + Namespace: vmi.Namespace, + }, + Spec: k8sv1.PodSpec{ +- RestartPolicy: k8sv1.RestartPolicyNever, +- Volumes: []k8sv1.Volume{volume}, +- Containers: []k8sv1.Container{cont}, +- Affinity: &affinity, ++ RestartPolicy: k8sv1.RestartPolicyNever, ++ Volumes: []k8sv1.Volume{volume}, ++ Containers: []k8sv1.Container{cont}, ++ Affinity: &affinity, ++ SecurityContext: &podSecurityContext, + }, + } + p, err := virtCli.CoreV1().Pods(vmi.Namespace).Create(context.Background(), &pod, metav1.CreateOptions{}) +-- +2.46.0 + diff --git a/kubevirt.changes b/kubevirt.changes index 4e6c72a..87903e9 100644 --- a/kubevirt.changes +++ b/kubevirt.changes @@ -1,10 +1,12 @@ ------------------------------------------------------------------- -Thu Aug 22 11:39:44 UTC 2024 - Vasily Ulyanov +Mon Aug 26 08:27:16 UTC 2024 - Vasily Ulyanov - Update to version 1.3.1 Release notes https://github.com/kubevirt/kubevirt/releases/tag/v1.3.1 - Fix DV error report via VM printable status 0001-Consider-the-new-DV-reason-ImagePullFailed.patch +- Fix permission error in storage migration tests + 0002-tests-Set-FSGroup-to-ensure-proper-permissions.patch ------------------------------------------------------------------- Fri Jul 19 07:32:30 UTC 2024 - Vasily Ulyanov diff --git a/kubevirt.spec b/kubevirt.spec index 5ad069c..954745a 100644 --- a/kubevirt.spec +++ b/kubevirt.spec @@ -42,6 +42,7 @@ Source2: kubevirt_containers_meta.service Source3: %{url}/releases/download/v%{version}/disks-images-provider.yaml Source100: %{name}-rpmlintrc Patch1: 0001-Consider-the-new-DV-reason-ImagePullFailed.patch +Patch2: 0002-tests-Set-FSGroup-to-ensure-proper-permissions.patch BuildRequires: glibc-devel-static BuildRequires: golang-packaging BuildRequires: pkgconfig