This repository has been archived by the owner on Jun 28, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 196
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5798 from ldoktor/selinux
ci/openshift-ci: Enable selinux in CI runs
- Loading branch information
Showing
3 changed files
with
48 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
apiVersion: apps/v1 | ||
kind: DaemonSet | ||
metadata: | ||
name: relabel-selinux-daemonset | ||
namespace: kube-system | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: restorecon | ||
template: | ||
metadata: | ||
labels: | ||
app: restorecon | ||
spec: | ||
serviceAccountName: kata-deploy-sa | ||
hostPID: true | ||
containers: | ||
- name: relabel-selinux-container | ||
image: alpine | ||
securityContext: | ||
privileged: true | ||
command: ["/bin/sh", "-c", " | ||
set -e; | ||
echo Starting the relabel; | ||
nsenter --target 1 --mount bash -xc ' | ||
for ENTRY in \ | ||
\"/(.*/)?opt/kata/bin(/.*)?\" \ | ||
\"/(.*/)?opt/kata/runtime-rs/bin(/.*)?\" \ | ||
\"/(.*/)?opt/kata/share/kata-.*(/.*)?(/.*)?\" \ | ||
\"/(.*/)?opt/kata/share/ovmf(/.*)?\" \ | ||
\"/(.*/)?opt/kata/share/tdvf(/.*)?\" \ | ||
\"/(.*/)?opt/kata/libexec(/.*)?\"; | ||
do | ||
semanage fcontext -a -t qemu_exec_t \"$ENTRY\" || { echo \"Error in semanage command\"; exit 1; } | ||
done; | ||
restorecon -v -R /opt/kata || { echo \"Error in restorecon command\"; exit 1; } | ||
'; | ||
echo NSENTER_FINISHED_WITH: $?; | ||
sleep infinity"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters