Skip to content

Commit 76743c4

Browse files
committed
cgroups: provide UserConnection for non-linux platforms
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
1 parent 8354404 commit 76743c4

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

pkg/cgroups/cgroups_unsupported.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@
44
package cgroups
55

66
import (
7+
"fmt"
78
"os"
9+
10+
systemdDbus "github.com/coreos/go-systemd/v22/dbus"
811
)
912

1013
// IsCgroup2UnifiedMode returns whether we are running in cgroup 2 cgroup2 mode.
@@ -21,3 +24,8 @@ func UserOwnsCurrentSystemdCgroup() (bool, error) {
2124
func rmDirRecursively(path string) error {
2225
return os.RemoveAll(path)
2326
}
27+
28+
// UserConnection returns an user connection to D-BUS
29+
func UserConnection(uid int) (*systemdDbus.Conn, error) {
30+
return nil, fmt.Errorf("systemd d-bus is not supported on this platform")
31+
}

0 commit comments

Comments
 (0)