mirror of
https://github.com/containers/podman.git
synced 2025-12-04 04:09:40 +08:00
Update buildah to v1.11.0
Vendor in the latest changes for buildah to apply the implemented features here as well. Signed-off-by: Sascha Grunert <sgrunert@suse.com>
This commit is contained in:
31
vendor/github.com/containers/buildah/pkg/cgroups/cgroups_supported.go
generated
vendored
Normal file
31
vendor/github.com/containers/buildah/pkg/cgroups/cgroups_supported.go
generated
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
// +build linux
|
||||
|
||||
package cgroups
|
||||
|
||||
import (
|
||||
"sync"
|
||||
"syscall"
|
||||
)
|
||||
|
||||
const (
|
||||
_cgroup2SuperMagic = 0x63677270
|
||||
)
|
||||
|
||||
var (
|
||||
isUnifiedOnce sync.Once
|
||||
isUnified bool
|
||||
isUnifiedErr error
|
||||
)
|
||||
|
||||
// IsCgroup2UnifiedMode returns whether we are running in cgroup 2 cgroup2 mode.
|
||||
func IsCgroup2UnifiedMode() (bool, error) {
|
||||
isUnifiedOnce.Do(func() {
|
||||
var st syscall.Statfs_t
|
||||
if err := syscall.Statfs("/sys/fs/cgroup", &st); err != nil {
|
||||
isUnified, isUnifiedErr = false, err
|
||||
} else {
|
||||
isUnified, isUnifiedErr = st.Type == _cgroup2SuperMagic, nil
|
||||
}
|
||||
})
|
||||
return isUnified, isUnifiedErr
|
||||
}
|
||||
8
vendor/github.com/containers/buildah/pkg/cgroups/cgroups_unsupported.go
generated
vendored
Normal file
8
vendor/github.com/containers/buildah/pkg/cgroups/cgroups_unsupported.go
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
// +build !linux
|
||||
|
||||
package cgroups
|
||||
|
||||
// IsCgroup2UnifiedMode returns whether we are running in cgroup 2 cgroup2 mode.
|
||||
func IsCgroup2UnifiedMode() (bool, error) {
|
||||
return false, nil
|
||||
}
|
||||
Reference in New Issue
Block a user