-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for selecting kvm and systemd labels #5690
Conversation
code LGTM |
Gating is now yet happy:
|
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.
Just minor nits. Once they're fixed, LGTM.
libpod/container_internal.go
Outdated
return swapTypes(initLabel, processLabel) | ||
} | ||
|
||
func swapTypes(source, dest string) (string, error) { |
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.
Can we rename it to swapSELinuxTypes
? libpod
is a really big package and swapTypes
sounds very generic.
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.
Done
libpod/runtime.go
Outdated
for _, r := range runtime.config.Engine.RuntimeSupportsJSON { | ||
supportsJSON[r] = true | ||
} | ||
for _, r := range runtime.config.Engine.RuntimeSupportsNoCgroups { | ||
supportsNoCgroups[r] = true | ||
} | ||
|
||
/* for _, r := range runtime.config.Engine.RuntimeSupportsKVM { |
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.
What's going on here?
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.
Oops had not implemented, it is now in containers/common.
libpod/oci.go
Outdated
@@ -102,6 +102,8 @@ type OCIRuntime interface { | |||
// SupportsNoCgroups is whether the runtime supports running containers | |||
// without cgroups. | |||
SupportsNoCgroups() bool | |||
// SupportsKVM indicates container will use KVM separation |
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.
nit: extra space between use and KVM
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.
Fixed
libpod/runtime.go
Outdated
@@ -379,7 +383,7 @@ func makeRuntime(ctx context.Context, runtime *Runtime) (err error) { | |||
json := supportsJSON[name] | |||
nocgroups := supportsNoCgroups[name] | |||
|
|||
ociRuntime, err := newConmonOCIRuntime(name, paths, runtime.conmonPath, runtime.config, json, nocgroups) | |||
ociRuntime, err := newConmonOCIRuntime(name, paths, runtime.conmonPath, runtime.config, json, nocgroups, supportsKVM[name]) |
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 think we should save the value of this like we do nocgroups and json above
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.
Removed and figured it out inside of the function.
☔ The latest upstream changes (presumably #5727) made this pull request unmergeable. Please resolve the merge conflicts. |
☔ The latest upstream changes (presumably #5478) made this pull request unmergeable. Please resolve the merge conflicts. |
d33b1ed
to
7e922c6
Compare
11b1a95
to
79f34a5
Compare
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.
LGTM
☔ The latest upstream changes (presumably #5756) made this pull request unmergeable. Please resolve the merge conflicts. |
LGTM once the unhappy tests are happy |
☔ The latest upstream changes (presumably #5785) made this pull request unmergeable. Please resolve the merge conflicts. |
I just destroyed this PR> Will need to recreate it tomorrow. |
☔ The latest upstream changes (presumably #5786) made this pull request unmergeable. Please resolve the merge conflicts. |
c62bedb
to
da807e6
Compare
In order to better support kata containers and systemd containers container-selinux has added new types. Podman should execute the container with an SELinux process label to match the container type. Traditional Container process : container_t KVM Container Process: containre_kvm_t PID 1 Init process: container_init_t Signed-off-by: Daniel J Walsh <[email protected]>
@baude @mheon @giuseppe @vrothberg @TomSweeneyRedHat @QiWang19 @jwhonce this one is ready to go in. PTAL |
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.
LGTM
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: giuseppe, rhatdan 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:
Approvers can indicate their approval by writing |
/lgtm |
In order to better support kata containers and systemd containers
container-selinux has added new types. Podman should execute the
container with an SELinux process label to match the container type.
Traditional Container process : container_t
KVM Container Process: containre_kvm_t
PID 1 Init process: container_init_t
Signed-off-by: Daniel J Walsh [email protected]