From 76743c41ae26cc61cd37d642593a194a3ad73a4a Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Thu, 2 Nov 2023 11:45:03 +0100 Subject: [PATCH] cgroups: provide UserConnection for non-linux platforms Signed-off-by: Giuseppe Scrivano --- pkg/cgroups/cgroups_unsupported.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkg/cgroups/cgroups_unsupported.go b/pkg/cgroups/cgroups_unsupported.go index b3dcb2d33..f2558728d 100644 --- a/pkg/cgroups/cgroups_unsupported.go +++ b/pkg/cgroups/cgroups_unsupported.go @@ -4,7 +4,10 @@ package cgroups import ( + "fmt" "os" + + systemdDbus "github.com/coreos/go-systemd/v22/dbus" ) // IsCgroup2UnifiedMode returns whether we are running in cgroup 2 cgroup2 mode. @@ -21,3 +24,8 @@ func UserOwnsCurrentSystemdCgroup() (bool, error) { func rmDirRecursively(path string) error { return os.RemoveAll(path) } + +// UserConnection returns an user connection to D-BUS +func UserConnection(uid int) (*systemdDbus.Conn, error) { + return nil, fmt.Errorf("systemd d-bus is not supported on this platform") +}