Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions pkg/cgroups/cgroups_unsupported.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
package cgroups

import (
"fmt"
"os"

systemdDbus "github.com/coreos/go-systemd/v22/dbus"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this library compile on non-linux? Is there a way to fake the prototype so it isn't necessary to pull in this package?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that is a good idea, I'll look into it. For now I've just tried to fix some of the issues I've introduced with #1716 that prevented revendoring into Podman: containers/podman#20568

There is still room for cleanups in the cgroups package.

)

// IsCgroup2UnifiedMode returns whether we are running in cgroup 2 cgroup2 mode.
Expand All @@ -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")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Errorf() could probably just be Error()?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't the linter have blocked this?

}