mirror of
https://github.com/containers/buildah.git
synced 2026-02-05 09:45:38 +01:00
Fix a build break on FreeBSD
The build breaks trying to build libcontainer/userns which no longer builds on FreeBSD. Fortunately we only need this for userns.RunningInUserNS so this change moves that call to a linux-only file and adds a stub for FreeBSD. [NO NEW TESTS NEEDED] Signed-off-by: Doug Rabson <dfr@rabson.org>
This commit is contained in:
5
add.go
5
add.go
@@ -23,7 +23,6 @@ import (
|
||||
"github.com/containers/storage/pkg/idtools"
|
||||
"github.com/hashicorp/go-multierror"
|
||||
digest "github.com/opencontainers/go-digest"
|
||||
"github.com/opencontainers/runc/libcontainer/userns"
|
||||
"github.com/opencontainers/runtime-spec/specs-go"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
@@ -438,7 +437,7 @@ func (b *Builder) Add(destination string, extract bool, options AddAndCopyOption
|
||||
ChmodDirs: nil,
|
||||
ChownFiles: nil,
|
||||
ChmodFiles: nil,
|
||||
IgnoreDevices: userns.RunningInUserNS(),
|
||||
IgnoreDevices: runningInUserNS(),
|
||||
}
|
||||
putErr = copier.Put(extractDirectory, extractDirectory, putOptions, io.TeeReader(pipeReader, hasher))
|
||||
}
|
||||
@@ -579,7 +578,7 @@ func (b *Builder) Add(destination string, extract bool, options AddAndCopyOption
|
||||
ChmodDirs: nil,
|
||||
ChownFiles: nil,
|
||||
ChmodFiles: nil,
|
||||
IgnoreDevices: userns.RunningInUserNS(),
|
||||
IgnoreDevices: runningInUserNS(),
|
||||
}
|
||||
putErr = copier.Put(extractDirectory, extractDirectory, putOptions, io.TeeReader(pipeReader, hasher))
|
||||
}
|
||||
|
||||
8
add_common.go
Normal file
8
add_common.go
Normal file
@@ -0,0 +1,8 @@
|
||||
//go:build !linux
|
||||
// +build !linux
|
||||
|
||||
package buildah
|
||||
|
||||
func runningInUserNS() bool {
|
||||
return false
|
||||
}
|
||||
9
add_linux.go
Normal file
9
add_linux.go
Normal file
@@ -0,0 +1,9 @@
|
||||
package buildah
|
||||
|
||||
import (
|
||||
"github.com/opencontainers/runc/libcontainer/userns"
|
||||
)
|
||||
|
||||
func runningInUserNS() bool {
|
||||
return userns.RunningInUserNS()
|
||||
}
|
||||
Reference in New Issue
Block a user