mirror of
https://github.com/containers/podman.git
synced 2025-11-08 02:46:02 +08:00
vendor: bump buildah to v1.26.1-0.20220524184833-5500333c2e06
Bump buildah to v1.26.1-0.20220524184833-5500333c2e06 Signed-off-by: Aditya R <arajan@redhat.com>
This commit is contained in:
2
vendor/github.com/containers/storage/go.mod
generated
vendored
2
vendor/github.com/containers/storage/go.mod
generated
vendored
@ -18,7 +18,7 @@ require (
|
||||
github.com/mistifyio/go-zfs v2.1.2-0.20190413222219-f784269be439+incompatible
|
||||
github.com/moby/sys/mountinfo v0.6.1
|
||||
github.com/opencontainers/go-digest v1.0.0
|
||||
github.com/opencontainers/runc v1.1.1
|
||||
github.com/opencontainers/runc v1.1.2
|
||||
github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417
|
||||
github.com/opencontainers/selinux v1.10.1
|
||||
github.com/pkg/errors v0.9.1
|
||||
|
||||
4
vendor/github.com/containers/storage/go.sum
generated
vendored
4
vendor/github.com/containers/storage/go.sum
generated
vendored
@ -521,8 +521,8 @@ github.com/opencontainers/runc v1.0.0-rc8.0.20190926000215-3e425f80a8c9/go.mod h
|
||||
github.com/opencontainers/runc v1.0.0-rc9/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U=
|
||||
github.com/opencontainers/runc v1.0.0-rc93/go.mod h1:3NOsor4w32B2tC0Zbl8Knk4Wg84SM2ImC1fxBuqJ/H0=
|
||||
github.com/opencontainers/runc v1.0.2/go.mod h1:aTaHFFwQXuA71CiyxOdFFIorAoemI04suvGRQFzWTD0=
|
||||
github.com/opencontainers/runc v1.1.1 h1:PJ9DSs2sVwE0iVr++pAHE6QkS9tzcVWozlPifdwMgrU=
|
||||
github.com/opencontainers/runc v1.1.1/go.mod h1:Tj1hFw6eFWp/o33uxGf5yF2BX5yz2Z6iptFpuvbbKqc=
|
||||
github.com/opencontainers/runc v1.1.2 h1:2VSZwLx5k/BfsBxMMipG/LYUnmqOD/BPkIVgQUcTlLw=
|
||||
github.com/opencontainers/runc v1.1.2/go.mod h1:Tj1hFw6eFWp/o33uxGf5yF2BX5yz2Z6iptFpuvbbKqc=
|
||||
github.com/opencontainers/runtime-spec v0.1.2-0.20190507144316-5b71a03e2700/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0=
|
||||
github.com/opencontainers/runtime-spec v1.0.1/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0=
|
||||
github.com/opencontainers/runtime-spec v1.0.2-0.20190207185410-29686dbc5559/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0=
|
||||
|
||||
84
vendor/github.com/containers/storage/pkg/system/meminfo_freebsd.go
generated
vendored
Normal file
84
vendor/github.com/containers/storage/pkg/system/meminfo_freebsd.go
generated
vendored
Normal file
@ -0,0 +1,84 @@
|
||||
//go:build freebsd && cgo
|
||||
// +build freebsd,cgo
|
||||
|
||||
package system
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"unsafe"
|
||||
|
||||
"golang.org/x/sys/unix"
|
||||
)
|
||||
|
||||
// #include <unistd.h>
|
||||
// #include <sys/vmmeter.h>
|
||||
// #include <sys/sysctl.h>
|
||||
// #include <vm/vm_param.h>
|
||||
import "C"
|
||||
|
||||
func getMemInfo() (int64, int64, error) {
|
||||
data, err := unix.SysctlRaw("vm.vmtotal")
|
||||
if err != nil {
|
||||
return -1, -1, fmt.Errorf("Can't get kernel info: %v", err)
|
||||
}
|
||||
if len(data) != C.sizeof_struct_vmtotal {
|
||||
return -1, -1, fmt.Errorf("unexpected vmtotal size %d", len(data))
|
||||
}
|
||||
|
||||
total := (*C.struct_vmtotal)(unsafe.Pointer(&data[0]))
|
||||
|
||||
pagesize := int64(C.sysconf(C._SC_PAGESIZE))
|
||||
npages := int64(C.sysconf(C._SC_PHYS_PAGES))
|
||||
return pagesize * npages, pagesize * int64(total.t_free), nil
|
||||
}
|
||||
|
||||
func getSwapInfo() (int64, int64, error) {
|
||||
var (
|
||||
total int64 = 0
|
||||
used int64 = 0
|
||||
)
|
||||
swapCount, err := unix.SysctlUint32("vm.nswapdev")
|
||||
if err != nil {
|
||||
return -1, -1, fmt.Errorf("error reading vm.nswapdev: %v", err)
|
||||
}
|
||||
for i := 0; i < int(swapCount); i++ {
|
||||
data, err := unix.SysctlRaw("vm.swap_info", i)
|
||||
if err != nil {
|
||||
return -1, -1, fmt.Errorf("error reading vm.swap_info.%d: %v", i, err)
|
||||
}
|
||||
if len(data) != C.sizeof_struct_xswdev {
|
||||
return -1, -1, fmt.Errorf("unexpected swap_info size %d", len(data))
|
||||
}
|
||||
xsw := (*C.struct_xswdev)(unsafe.Pointer(&data[0]))
|
||||
total += int64(xsw.xsw_nblks)
|
||||
used += int64(xsw.xsw_used)
|
||||
}
|
||||
pagesize := int64(C.sysconf(C._SC_PAGESIZE))
|
||||
return pagesize * total, pagesize * (total - used), nil
|
||||
}
|
||||
|
||||
// ReadMemInfo retrieves memory statistics of the host system and returns a
|
||||
// MemInfo type.
|
||||
func ReadMemInfo() (*MemInfo, error) {
|
||||
MemTotal, MemFree, err := getMemInfo()
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error getting memory totals %v\n", err)
|
||||
}
|
||||
SwapTotal, SwapFree, err := getSwapInfo()
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error getting swap totals %v\n", err)
|
||||
}
|
||||
|
||||
if MemTotal < 0 || MemFree < 0 || SwapTotal < 0 || SwapFree < 0 {
|
||||
return nil, fmt.Errorf("error getting system memory info %v\n", err)
|
||||
}
|
||||
|
||||
meminfo := &MemInfo{}
|
||||
// Total memory is total physical memory less than memory locked by kernel
|
||||
meminfo.MemTotal = MemTotal
|
||||
meminfo.MemFree = MemFree
|
||||
meminfo.SwapTotal = SwapTotal
|
||||
meminfo.SwapFree = SwapFree
|
||||
|
||||
return meminfo, nil
|
||||
}
|
||||
3
vendor/github.com/containers/storage/pkg/system/meminfo_unsupported.go
generated
vendored
3
vendor/github.com/containers/storage/pkg/system/meminfo_unsupported.go
generated
vendored
@ -1,4 +1,5 @@
|
||||
// +build !linux,!windows,!solaris
|
||||
//go:build !linux && !windows && !solaris && !freebsd
|
||||
// +build !linux,!windows,!solaris,!freebsd
|
||||
|
||||
package system
|
||||
|
||||
|
||||
2
vendor/github.com/containers/storage/pkg/unshare/unshare.c
generated
vendored
2
vendor/github.com/containers/storage/pkg/unshare/unshare.c
generated
vendored
@ -1,4 +1,4 @@
|
||||
#ifndef UNSHARE_NO_CODE_AT_ALL
|
||||
#if !defined(UNSHARE_NO_CODE_AT_ALL) && defined(__linux__)
|
||||
|
||||
#define _GNU_SOURCE
|
||||
#include <sys/types.h>
|
||||
|
||||
24
vendor/github.com/containers/storage/pkg/unshare/unshare.go
generated
vendored
24
vendor/github.com/containers/storage/pkg/unshare/unshare.go
generated
vendored
@ -7,7 +7,7 @@ import (
|
||||
"sync"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
"github.com/syndtr/gocapability/capability"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
var (
|
||||
@ -38,19 +38,13 @@ func HomeDir() (string, error) {
|
||||
return homeDir, homeDirErr
|
||||
}
|
||||
|
||||
// HasCapSysAdmin returns whether the current process has CAP_SYS_ADMIN.
|
||||
func HasCapSysAdmin() (bool, error) {
|
||||
hasCapSysAdminOnce.Do(func() {
|
||||
currentCaps, err := capability.NewPid2(0)
|
||||
if err != nil {
|
||||
hasCapSysAdminErr = err
|
||||
return
|
||||
func bailOnError(err error, format string, a ...interface{}) { // nolint: golint,goprintffuncname
|
||||
if err != nil {
|
||||
if format != "" {
|
||||
logrus.Errorf("%s: %v", fmt.Sprintf(format, a...), err)
|
||||
} else {
|
||||
logrus.Errorf("%v", err)
|
||||
}
|
||||
if err = currentCaps.Load(); err != nil {
|
||||
hasCapSysAdminErr = err
|
||||
return
|
||||
}
|
||||
hasCapSysAdminRet = currentCaps.Get(capability.EFFECTIVE, capability.CAP_SYS_ADMIN)
|
||||
})
|
||||
return hasCapSysAdminRet, hasCapSysAdminErr
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
3
vendor/github.com/containers/storage/pkg/unshare/unshare_cgo.go
generated
vendored
3
vendor/github.com/containers/storage/pkg/unshare/unshare_cgo.go
generated
vendored
@ -1,4 +1,5 @@
|
||||
// +build linux,cgo,!gccgo
|
||||
//go:build (linux && cgo && !gccgo) || (freebsd && cgo)
|
||||
// +build linux,cgo,!gccgo freebsd,cgo
|
||||
|
||||
package unshare
|
||||
|
||||
|
||||
76
vendor/github.com/containers/storage/pkg/unshare/unshare_freebsd.c
generated
vendored
Normal file
76
vendor/github.com/containers/storage/pkg/unshare/unshare_freebsd.c
generated
vendored
Normal file
@ -0,0 +1,76 @@
|
||||
#if !defined(UNSHARE_NO_CODE_AT_ALL) && defined(__FreeBSD__)
|
||||
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
static int _containers_unshare_parse_envint(const char *envname) {
|
||||
char *p, *q;
|
||||
long l;
|
||||
|
||||
p = getenv(envname);
|
||||
if (p == NULL) {
|
||||
return -1;
|
||||
}
|
||||
q = NULL;
|
||||
l = strtol(p, &q, 10);
|
||||
if ((q == NULL) || (*q != '\0')) {
|
||||
fprintf(stderr, "Error parsing \"%s\"=\"%s\"!\n", envname, p);
|
||||
_exit(1);
|
||||
}
|
||||
unsetenv(envname);
|
||||
return l;
|
||||
}
|
||||
|
||||
void _containers_unshare(void)
|
||||
{
|
||||
int pidfd, continuefd, n, pgrp, sid, ctty;
|
||||
char buf[2048];
|
||||
|
||||
pidfd = _containers_unshare_parse_envint("_Containers-pid-pipe");
|
||||
if (pidfd != -1) {
|
||||
snprintf(buf, sizeof(buf), "%llu", (unsigned long long) getpid());
|
||||
size_t size = write(pidfd, buf, strlen(buf));
|
||||
if (size != strlen(buf)) {
|
||||
fprintf(stderr, "Error writing PID to pipe on fd %d: %m\n", pidfd);
|
||||
_exit(1);
|
||||
}
|
||||
close(pidfd);
|
||||
}
|
||||
continuefd = _containers_unshare_parse_envint("_Containers-continue-pipe");
|
||||
if (continuefd != -1) {
|
||||
n = read(continuefd, buf, sizeof(buf));
|
||||
if (n > 0) {
|
||||
fprintf(stderr, "Error: %.*s\n", n, buf);
|
||||
_exit(1);
|
||||
}
|
||||
close(continuefd);
|
||||
}
|
||||
sid = _containers_unshare_parse_envint("_Containers-setsid");
|
||||
if (sid == 1) {
|
||||
if (setsid() == -1) {
|
||||
fprintf(stderr, "Error during setsid: %m\n");
|
||||
_exit(1);
|
||||
}
|
||||
}
|
||||
pgrp = _containers_unshare_parse_envint("_Containers-setpgrp");
|
||||
if (pgrp == 1) {
|
||||
if (setpgrp(0, 0) == -1) {
|
||||
fprintf(stderr, "Error during setpgrp: %m\n");
|
||||
_exit(1);
|
||||
}
|
||||
}
|
||||
ctty = _containers_unshare_parse_envint("_Containers-ctty");
|
||||
if (ctty != -1) {
|
||||
if (ioctl(ctty, TIOCSCTTY, 0) == -1) {
|
||||
fprintf(stderr, "Error while setting controlling terminal to %d: %m\n", ctty);
|
||||
_exit(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
179
vendor/github.com/containers/storage/pkg/unshare/unshare_freebsd.go
generated
vendored
Normal file
179
vendor/github.com/containers/storage/pkg/unshare/unshare_freebsd.go
generated
vendored
Normal file
@ -0,0 +1,179 @@
|
||||
//go:build freebsd
|
||||
// +build freebsd
|
||||
|
||||
package unshare
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
"os/exec"
|
||||
"runtime"
|
||||
"strconv"
|
||||
"syscall"
|
||||
|
||||
"github.com/containers/storage/pkg/reexec"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
// Cmd wraps an exec.Cmd created by the reexec package in unshare(),
|
||||
// and one day might handle setting ID maps and other related setting*s
|
||||
// by triggering initialization code in the child.
|
||||
type Cmd struct {
|
||||
*exec.Cmd
|
||||
Setsid bool
|
||||
Setpgrp bool
|
||||
Ctty *os.File
|
||||
Hook func(pid int) error
|
||||
}
|
||||
|
||||
// Command creates a new Cmd which can be customized.
|
||||
func Command(args ...string) *Cmd {
|
||||
cmd := reexec.Command(args...)
|
||||
return &Cmd{
|
||||
Cmd: cmd,
|
||||
}
|
||||
}
|
||||
|
||||
func (c *Cmd) Start() error {
|
||||
runtime.LockOSThread()
|
||||
defer runtime.UnlockOSThread()
|
||||
|
||||
// Set environment variables to tell the child to synchronize its startup.
|
||||
if c.Env == nil {
|
||||
c.Env = os.Environ()
|
||||
}
|
||||
|
||||
// Create the pipe for reading the child's PID.
|
||||
pidRead, pidWrite, err := os.Pipe()
|
||||
if err != nil {
|
||||
return errors.Wrapf(err, "error creating pid pipe")
|
||||
}
|
||||
c.Env = append(c.Env, fmt.Sprintf("_Containers-pid-pipe=%d", len(c.ExtraFiles)+3))
|
||||
c.ExtraFiles = append(c.ExtraFiles, pidWrite)
|
||||
|
||||
// Create the pipe for letting the child know to proceed.
|
||||
continueRead, continueWrite, err := os.Pipe()
|
||||
if err != nil {
|
||||
pidRead.Close()
|
||||
pidWrite.Close()
|
||||
return errors.Wrapf(err, "error creating pid pipe")
|
||||
}
|
||||
c.Env = append(c.Env, fmt.Sprintf("_Containers-continue-pipe=%d", len(c.ExtraFiles)+3))
|
||||
c.ExtraFiles = append(c.ExtraFiles, continueRead)
|
||||
|
||||
// Pass along other instructions.
|
||||
if c.Setsid {
|
||||
c.Env = append(c.Env, "_Containers-setsid=1")
|
||||
}
|
||||
if c.Setpgrp {
|
||||
c.Env = append(c.Env, "_Containers-setpgrp=1")
|
||||
}
|
||||
if c.Ctty != nil {
|
||||
c.Env = append(c.Env, fmt.Sprintf("_Containers-ctty=%d", len(c.ExtraFiles)+3))
|
||||
c.ExtraFiles = append(c.ExtraFiles, c.Ctty)
|
||||
}
|
||||
|
||||
// Make sure we clean up our pipes.
|
||||
defer func() {
|
||||
if pidRead != nil {
|
||||
pidRead.Close()
|
||||
}
|
||||
if pidWrite != nil {
|
||||
pidWrite.Close()
|
||||
}
|
||||
if continueRead != nil {
|
||||
continueRead.Close()
|
||||
}
|
||||
if continueWrite != nil {
|
||||
continueWrite.Close()
|
||||
}
|
||||
}()
|
||||
|
||||
// Start the new process.
|
||||
err = c.Cmd.Start()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Close the ends of the pipes that the parent doesn't need.
|
||||
continueRead.Close()
|
||||
continueRead = nil
|
||||
pidWrite.Close()
|
||||
pidWrite = nil
|
||||
|
||||
// Read the child's PID from the pipe.
|
||||
pidString := ""
|
||||
b := new(bytes.Buffer)
|
||||
if _, err := io.Copy(b, pidRead); err != nil {
|
||||
return errors.Wrapf(err, "Reading child PID")
|
||||
}
|
||||
pidString = b.String()
|
||||
pid, err := strconv.Atoi(pidString)
|
||||
if err != nil {
|
||||
fmt.Fprintf(continueWrite, "error parsing PID %q: %v", pidString, err)
|
||||
return errors.Wrapf(err, "error parsing PID %q", pidString)
|
||||
}
|
||||
|
||||
// Run any additional setup that we want to do before the child starts running proper.
|
||||
if c.Hook != nil {
|
||||
if err = c.Hook(pid); err != nil {
|
||||
fmt.Fprintf(continueWrite, "hook error: %v", err)
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c *Cmd) Run() error {
|
||||
if err := c.Start(); err != nil {
|
||||
return err
|
||||
}
|
||||
return c.Wait()
|
||||
}
|
||||
|
||||
func (c *Cmd) CombinedOutput() ([]byte, error) {
|
||||
return nil, errors.New("unshare: CombinedOutput() not implemented")
|
||||
}
|
||||
|
||||
func (c *Cmd) Output() ([]byte, error) {
|
||||
return nil, errors.New("unshare: Output() not implemented")
|
||||
}
|
||||
|
||||
type Runnable interface {
|
||||
Run() error
|
||||
}
|
||||
|
||||
// ExecRunnable runs the specified unshare command, captures its exit status,
|
||||
// and exits with the same status.
|
||||
func ExecRunnable(cmd Runnable, cleanup func()) {
|
||||
exit := func(status int) {
|
||||
if cleanup != nil {
|
||||
cleanup()
|
||||
}
|
||||
os.Exit(status)
|
||||
}
|
||||
if err := cmd.Run(); err != nil {
|
||||
if exitError, ok := errors.Cause(err).(*exec.ExitError); ok {
|
||||
if exitError.ProcessState.Exited() {
|
||||
if waitStatus, ok := exitError.ProcessState.Sys().(syscall.WaitStatus); ok {
|
||||
if waitStatus.Exited() {
|
||||
logrus.Debugf("%v", exitError)
|
||||
exit(waitStatus.ExitStatus())
|
||||
}
|
||||
if waitStatus.Signaled() {
|
||||
logrus.Debugf("%v", exitError)
|
||||
exit(int(waitStatus.Signal()) + 128)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
logrus.Errorf("%v", err)
|
||||
logrus.Errorf("(Unable to determine exit status)")
|
||||
exit(1)
|
||||
}
|
||||
exit(0)
|
||||
}
|
||||
28
vendor/github.com/containers/storage/pkg/unshare/unshare_linux.go
generated
vendored
28
vendor/github.com/containers/storage/pkg/unshare/unshare_linux.go
generated
vendored
@ -414,17 +414,6 @@ type Runnable interface {
|
||||
Run() error
|
||||
}
|
||||
|
||||
func bailOnError(err error, format string, a ...interface{}) { // nolint: golint,goprintffuncname
|
||||
if err != nil {
|
||||
if format != "" {
|
||||
logrus.Errorf("%s: %v", fmt.Sprintf(format, a...), err)
|
||||
} else {
|
||||
logrus.Errorf("%v", err)
|
||||
}
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
// MaybeReexecUsingUserNamespace re-exec the process in a new namespace
|
||||
func MaybeReexecUsingUserNamespace(evenForRoot bool) {
|
||||
// If we've already been through this once, no need to try again.
|
||||
@ -674,3 +663,20 @@ func ParseIDMappings(uidmap, gidmap []string) ([]idtools.IDMap, []idtools.IDMap,
|
||||
}
|
||||
return uid, gid, nil
|
||||
}
|
||||
|
||||
// HasCapSysAdmin returns whether the current process has CAP_SYS_ADMIN.
|
||||
func HasCapSysAdmin() (bool, error) {
|
||||
hasCapSysAdminOnce.Do(func() {
|
||||
currentCaps, err := capability.NewPid2(0)
|
||||
if err != nil {
|
||||
hasCapSysAdminErr = err
|
||||
return
|
||||
}
|
||||
if err = currentCaps.Load(); err != nil {
|
||||
hasCapSysAdminErr = err
|
||||
return
|
||||
}
|
||||
hasCapSysAdminRet = currentCaps.Get(capability.EFFECTIVE, capability.CAP_SYS_ADMIN)
|
||||
})
|
||||
return hasCapSysAdminRet, hasCapSysAdminErr
|
||||
}
|
||||
|
||||
6
vendor/github.com/containers/storage/pkg/unshare/unshare_unsupported.go
generated
vendored
6
vendor/github.com/containers/storage/pkg/unshare/unshare_unsupported.go
generated
vendored
@ -1,3 +1,4 @@
|
||||
//go:build !linux
|
||||
// +build !linux
|
||||
|
||||
package unshare
|
||||
@ -43,3 +44,8 @@ func GetHostIDMappings(pid string) ([]specs.LinuxIDMapping, []specs.LinuxIDMappi
|
||||
func ParseIDMappings(uidmap, gidmap []string) ([]idtools.IDMap, []idtools.IDMap, error) {
|
||||
return nil, nil, nil
|
||||
}
|
||||
|
||||
// HasCapSysAdmin returns whether the current process has CAP_SYS_ADMIN.
|
||||
func HasCapSysAdmin() (bool, error) {
|
||||
return os.Geteuid() == 0, nil
|
||||
}
|
||||
|
||||
3
vendor/github.com/containers/storage/pkg/unshare/unshare_unsupported_cgo.go
generated
vendored
3
vendor/github.com/containers/storage/pkg/unshare/unshare_unsupported_cgo.go
generated
vendored
@ -1,4 +1,5 @@
|
||||
// +build !linux,cgo
|
||||
//go:build cgo && !(linux || freebsd)
|
||||
// +build cgo,!linux,!freebsd
|
||||
|
||||
package unshare
|
||||
|
||||
|
||||
11
vendor/github.com/containers/storage/store.go
generated
vendored
11
vendor/github.com/containers/storage/store.go
generated
vendored
@ -173,6 +173,7 @@ type Store interface {
|
||||
GraphRoot() string
|
||||
GraphDriverName() string
|
||||
GraphOptions() []string
|
||||
PullOptions() map[string]string
|
||||
UIDMap() []idtools.IDMap
|
||||
GIDMap() []idtools.IDMap
|
||||
|
||||
@ -607,6 +608,7 @@ type store struct {
|
||||
graphRoot string
|
||||
graphDriverName string
|
||||
graphOptions []string
|
||||
pullOptions map[string]string
|
||||
uidMap []idtools.IDMap
|
||||
gidMap []idtools.IDMap
|
||||
autoUsernsUser string
|
||||
@ -726,6 +728,7 @@ func GetStore(options types.StoreOptions) (Store, error) {
|
||||
additionalGIDs: nil,
|
||||
usernsLock: usernsLock,
|
||||
disableVolatile: options.DisableVolatile,
|
||||
pullOptions: options.PullOptions,
|
||||
}
|
||||
if err := s.load(); err != nil {
|
||||
return nil, err
|
||||
@ -776,6 +779,14 @@ func (s *store) GraphOptions() []string {
|
||||
return s.graphOptions
|
||||
}
|
||||
|
||||
func (s *store) PullOptions() map[string]string {
|
||||
cp := make(map[string]string, len(s.pullOptions))
|
||||
for k, v := range s.pullOptions {
|
||||
cp[k] = v
|
||||
}
|
||||
return cp
|
||||
}
|
||||
|
||||
func (s *store) UIDMap() []idtools.IDMap {
|
||||
return copyIDMap(s.uidMap)
|
||||
}
|
||||
|
||||
9
vendor/github.com/containers/storage/types/options.go
generated
vendored
9
vendor/github.com/containers/storage/types/options.go
generated
vendored
@ -187,6 +187,7 @@ func getRootlessStorageOpts(rootlessUID int, systemOpts StoreOptions) (StoreOpti
|
||||
return opts, err
|
||||
}
|
||||
opts.RunRoot = rootlessRuntime
|
||||
opts.PullOptions = systemOpts.PullOptions
|
||||
if systemOpts.RootlessStoragePath != "" {
|
||||
opts.GraphRoot, err = expandEnvPath(systemOpts.RootlessStoragePath, rootlessUID)
|
||||
if err != nil {
|
||||
@ -203,7 +204,7 @@ func getRootlessStorageOpts(rootlessUID int, systemOpts StoreOptions) (StoreOpti
|
||||
opts.GraphDriverName = driver
|
||||
}
|
||||
if opts.GraphDriverName == overlay2 {
|
||||
logrus.Warnf("Switching default driver from overlay2 to the equivalent overlay driver.")
|
||||
logrus.Warnf("Switching default driver from overlay2 to the equivalent overlay driver")
|
||||
opts.GraphDriverName = overlayDriver
|
||||
}
|
||||
|
||||
@ -280,7 +281,7 @@ func ReloadConfigurationFile(configFile string, storeOptions *StoreOptions) {
|
||||
if err == nil {
|
||||
keys := meta.Undecoded()
|
||||
if len(keys) > 0 {
|
||||
logrus.Warningf("Failed to decode the keys %q from %q.", keys, configFile)
|
||||
logrus.Warningf("Failed to decode the keys %q from %q", keys, configFile)
|
||||
}
|
||||
} else {
|
||||
if !os.IsNotExist(err) {
|
||||
@ -299,11 +300,11 @@ func ReloadConfigurationFile(configFile string, storeOptions *StoreOptions) {
|
||||
storeOptions.GraphDriverName = config.Storage.Driver
|
||||
}
|
||||
if storeOptions.GraphDriverName == overlay2 {
|
||||
logrus.Warnf("Switching default driver from overlay2 to the equivalent overlay driver.")
|
||||
logrus.Warnf("Switching default driver from overlay2 to the equivalent overlay driver")
|
||||
storeOptions.GraphDriverName = overlayDriver
|
||||
}
|
||||
if storeOptions.GraphDriverName == "" {
|
||||
logrus.Errorf("The storage 'driver' option must be set in %s, guarantee proper operation.", configFile)
|
||||
logrus.Errorf("The storage 'driver' option must be set in %s to guarantee proper operation", configFile)
|
||||
}
|
||||
if config.Storage.RunRoot != "" {
|
||||
storeOptions.RunRoot = config.Storage.RunRoot
|
||||
|
||||
Reference in New Issue
Block a user