kubernetes / test-infra

Test infrastructure for the Kubernetes project.
Apache License 2.0
3.81k stars 2.61k forks source link

Add unit file changing imageStore selinux label to splitfs test #32820

Closed bitoku closed 1 week ago

bitoku commented 1 week ago

This PR adds a unit file to change the selinux label of imageStore in order to fix the test failures in https://github.com/kubernetes/kubernetes/pull/125417 https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/125417/pull-crio-cgroupv2-splitfs-splitdisk/1800694672788557824 Also it modifies the graphroot and runroot to the default.


In the test, all containers failed with exitCode 127, which normally succeed without any errors. Having tested on the remote e2e, I found that the containers failed with the error like

error while loading shared libraries: /lib64/libc.so.6: cannot apply additional memory protection after relocation: Permission denied

It turned out to be caused by selinux label mismatch. Since we split imageStore and graphRoot path, imageStore also must have the same selinux label as graphRoot.

cf. https://github.com/containers/podman/blob/main/troubleshooting.md#11-changing-the-location-of-the-graphroot-leads-to-permission-denied.

I tested this ignition file by running remote e2e with https://github.com/kubernetes/kubernetes/pull/125417 this change, and it passed the tests.

k8s-ci-robot commented 1 week ago

Hi @bitoku. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository.
kannon92 commented 1 week ago

/ok-to-test

kannon92 commented 1 week ago

/lgtm

/assign @SergeyKanzhelev @haircommander

@haircommander I didn’t know we need the same label for the image store as we need for graph root. I wonder if this is intentional..

haircommander commented 1 week ago

/approve

this makes sense to me as we'll need to do similar things to both paths. I'd imagine image store could get away with a slightly different profile but functionally having the same is secure enough i think

k8s-ci-robot commented 1 week ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bitoku, haircommander

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[jobs/e2e_node/crio/OWNERS](https://github.com/kubernetes/test-infra/blob/master/jobs/e2e_node/crio/OWNERS)~~ [haircommander] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment