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
ci/openshift-ci: Enable selinux in CI runs #5798
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick: My suggestion would be to convert this FIXME note into an Github issue, regardless if it will be solved soon or not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest to create an issue in the tests repo and to keep a FIXME mentioning this issue in the code for greater visibility. If this code is moved to the main repo before kata-containers/kata-containers#8417 is merged, the issue will need to be converted to a kata-containers issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ack