summaryrefslogtreecommitdiff
path: root/libpod/runtime_ctr.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2018-10-23 09:22:12 -0700
committerGitHub <noreply@github.com>2018-10-23 09:22:12 -0700
commit8ff974248084f752d328d7a8d1cd6af2959bc3fd (patch)
tree06e527e0f1c8b1736d6af2c1bb53d2e856099872 /libpod/runtime_ctr.go
parentc019830a750d3c2cdb20d2568c9e0f9fdc35165e (diff)
parenta95d71f1135165ae51c28b49275e5a3948fbbd2b (diff)
downloadpodman-8ff974248084f752d328d7a8d1cd6af2959bc3fd.tar.gz
podman-8ff974248084f752d328d7a8d1cd6af2959bc3fd.tar.bz2
podman-8ff974248084f752d328d7a8d1cd6af2959bc3fd.zip
Merge pull request #1687 from rhatdan/vendor
Move selinux label reservations to containers storage.
Diffstat (limited to 'libpod/runtime_ctr.go')
-rw-r--r--libpod/runtime_ctr.go30
1 files changed, 0 insertions, 30 deletions
diff --git a/libpod/runtime_ctr.go b/libpod/runtime_ctr.go
index 4256a84a0..b63726f29 100644
--- a/libpod/runtime_ctr.go
+++ b/libpod/runtime_ctr.go
@@ -11,7 +11,6 @@ import (
"github.com/containers/storage"
"github.com/containers/storage/pkg/stringid"
spec "github.com/opencontainers/runtime-spec/specs-go"
- "github.com/opencontainers/selinux/go-selinux/label"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"github.com/ulule/deepcopier"
@@ -329,10 +328,6 @@ func (r *Runtime) removeContainer(ctx context.Context, c *Container, force bool)
}
}
- if r.config.EnableLabeling {
- label.ReleaseLabel(c.ProcessLabel())
- r.reserveLabels()
- }
// Delete the container.
// Not needed in Configured and Exited states, where the container
// doesn't exist in the runtime
@@ -467,28 +462,3 @@ func (r *Runtime) GetLatestContainer() (*Container, error) {
}
return ctrs[lastCreatedIndex], nil
}
-
-// reserveLabels walks the list o fcontainers and reserves the label, so new containers will not
-// get them.
-// TODO Performance wise this should only run if the state has changed since the last time it was run.
-func (r *Runtime) reserveLabels() error {
- containers, err := r.state.AllContainers()
- if err != nil {
- return err
- }
- for _, ctr := range containers {
- label.ReserveLabel(ctr.ProcessLabel())
- }
- return nil
-}
-
-// initLabels allocates an new label to return to the caller
-func (r *Runtime) initLabels(labelOpts []string) (string, string, error) {
- if !r.config.EnableLabeling {
- return "", "", nil
- }
- if err := r.reserveLabels(); err != nil {
- return "", "", errors.Wrapf(err, "unable to reserve labels")
- }
- return label.InitLabels(labelOpts)
-}