summaryrefslogtreecommitdiff
path: root/libpod
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-10-05 10:32:28 +0200
committerGitHub <noreply@github.com>2020-10-05 10:32:28 +0200
commit7353000a06f3636515ebcd3b79ca8309db48b693 (patch)
tree0144357de85b0e2c59a3d6529268477421156200 /libpod
parent7c12967257742063206c05f0baec517bc08cbeb6 (diff)
parentd0f3c17912643aca73372aa87f3eadf757621ccc (diff)
downloadpodman-7353000a06f3636515ebcd3b79ca8309db48b693.tar.gz
podman-7353000a06f3636515ebcd3b79ca8309db48b693.tar.bz2
podman-7353000a06f3636515ebcd3b79ca8309db48b693.zip
Merge pull request #7902 from rhatdan/selinux
Add SELinux support for pods
Diffstat (limited to 'libpod')
-rw-r--r--libpod/pod.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/libpod/pod.go b/libpod/pod.go
index a5a0532be..c8f62ca18 100644
--- a/libpod/pod.go
+++ b/libpod/pod.go
@@ -327,3 +327,21 @@ func (p *Pod) GetPodStats(previousContainerStats map[string]*define.ContainerSta
}
return newContainerStats, nil
}
+
+// ProcessLabel returns the SELinux label associated with the pod
+func (p *Pod) ProcessLabel() (string, error) {
+ if !p.HasInfraContainer() {
+ return "", nil
+ }
+
+ id, err := p.InfraContainerID()
+ if err != nil {
+ return "", err
+ }
+
+ ctr, err := p.runtime.state.Container(id)
+ if err != nil {
+ return "", err
+ }
+ return ctr.ProcessLabel(), nil
+}