Allow docker to free container labels when containers are removed.

Currently we do not remove reservations on MCS labels when a container
is removed.  Not a big problem, since on reboot it would be freed.
But we should be cleaning this up.  Currently we support ~500,000
labels.

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
This commit is contained in:
Dan Walsh 2014-08-20 16:43:15 -04:00
parent db65c35051
commit f5d6269371
2 changed files with 12 additions and 0 deletions

View File

@ -39,3 +39,7 @@ func Init() {
func ReserveLabel(label string) error {
return nil
}
func UnreserveLabel(label string) error {
return nil
}

View File

@ -128,3 +128,11 @@ func ReserveLabel(label string) error {
selinux.ReserveLabel(label)
return nil
}
// UnreserveLabel will remove the reservation of the MCS label.
// This will allow InitLabels to use the MCS label in a newly created
// containers
func UnreserveLabel(label string) error {
selinux.FreeLxcContexts(label)
return nil
}