Skip to content

Commit 1a1eae0

Browse files
committed
crio: filter out systemd related components
Do not allow registration of systemd related services.
1 parent 167d846 commit 1a1eae0

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

container/crio/factory.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ import (
3232
// The namespace under which crio aliases are unique.
3333
const CrioNamespace = "crio"
3434

35+
// The namespace systemd runs components under.
36+
const SystemdNamespace = "system-systemd"
37+
3538
// Regexp that identifies CRI-O cgroups
3639
var crioCgroupRegexp = regexp.MustCompile(`([a-z0-9]{64})`)
3740

@@ -114,6 +117,9 @@ func (f *crioFactory) CanHandleAndAccept(name string) (bool, bool, error) {
114117
if !strings.HasPrefix(path.Base(name), CrioNamespace) {
115118
return false, false, nil
116119
}
120+
if strings.HasPrefix(path.Base(name), SystemdNamespace) {
121+
return true, false, nil
122+
}
117123
// if the container is not associated with CRI-O, we can't handle it or accept it.
118124
if !isContainerName(name) {
119125
return false, false, nil

0 commit comments

Comments
 (0)