From 12b31be2d2ed1c8bcce2f17d6142070c60d9bc5e Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Mon, 30 Jan 2023 12:06:09 +0100 Subject: [PATCH] TEST: test storage patch Signed-off-by: Giuseppe Scrivano --- go.mod | 2 +- go.sum | 4 ++-- .../pkg/idmap/idmapped_utils_unsupported.go | 22 +++++++++++++++++++ vendor/modules.txt | 4 ++-- 4 files changed, 27 insertions(+), 5 deletions(-) create mode 100644 vendor/github.com/containers/storage/pkg/idmap/idmapped_utils_unsupported.go diff --git a/go.mod b/go.mod index 477a9308f202..71dc77d4d2a4 100644 --- a/go.mod +++ b/go.mod @@ -178,4 +178,4 @@ require ( replace github.com/opencontainers/runc => github.com/opencontainers/runc v1.1.1-0.20220617142545-8b9452f75cbc -replace github.com/containers/storage => github.com/containers/storage v1.45.3-0.20230128103133-e14503c40a7e +replace github.com/containers/storage => github.com/giuseppe/storage v1.19.2-0.20230130113912-04cf69a17212 diff --git a/go.sum b/go.sum index 7ec92ad210c1..01e1b96f3718 100644 --- a/go.sum +++ b/go.sum @@ -276,8 +276,6 @@ github.com/containers/ocicrypt v1.1.7 h1:thhNr4fu2ltyGz8aMx8u48Ae0Pnbip3ePP9/mzk github.com/containers/ocicrypt v1.1.7/go.mod h1:7CAhjcj2H8AYp5YvEie7oVSK2AhBY8NscCYRawuDNtw= github.com/containers/psgo v1.8.0 h1:2loGekmGAxM9ir5OsXWEfGwFxorMPYnc6gEDsGFQvhY= github.com/containers/psgo v1.8.0/go.mod h1:T8ZxnX3Ur4RvnhxFJ7t8xJ1F48RhiZB4rSrOaR/qGHc= -github.com/containers/storage v1.45.3-0.20230128103133-e14503c40a7e h1:pKDJZGGi/wz4leOiHEGssPTeND7bCqniUo2ulYJ92qk= -github.com/containers/storage v1.45.3-0.20230128103133-e14503c40a7e/go.mod h1:ikiIaFiVqg3QAtJWkh/VKQSdSlYE963sxwgHY5rIDu4= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-iptables v0.4.5/go.mod h1:/mVI274lEDI2ns62jHCDnCyBF9Iwsmekav8Dbxlm1MU= @@ -396,6 +394,8 @@ github.com/garyburd/redigo v0.0.0-20150301180006-535138d7bcd7/go.mod h1:NR3MbYis github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/giuseppe/storage v1.19.2-0.20230130113912-04cf69a17212 h1:FrgdeMp9iIwivzcYYxhbZua/yqgtlkaqoS52kiCHbLo= +github.com/giuseppe/storage v1.19.2-0.20230130113912-04cf69a17212/go.mod h1:ikiIaFiVqg3QAtJWkh/VKQSdSlYE963sxwgHY5rIDu4= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= diff --git a/vendor/github.com/containers/storage/pkg/idmap/idmapped_utils_unsupported.go b/vendor/github.com/containers/storage/pkg/idmap/idmapped_utils_unsupported.go new file mode 100644 index 000000000000..81c6072aad33 --- /dev/null +++ b/vendor/github.com/containers/storage/pkg/idmap/idmapped_utils_unsupported.go @@ -0,0 +1,22 @@ +//go:build !linux +// +build !linux + +package idmap + +import ( + "fmt" + + "github.com/containers/storage/pkg/idtools" +) + +// CreateIDMappedMount creates a IDMapped bind mount from SOURCE to TARGET using the user namespace +// for the PID process. +func CreateIDMappedMount(source, target string, pid int) error { + return fmt.Errorf("IDMapped mounts are not supported") +} + +// CreateUsernsProcess forks the current process and creates a user namespace using the specified +// mappings. It returns the pid of the new process. +func CreateUsernsProcess(uidMaps []idtools.IDMap, gidMaps []idtools.IDMap) (int, func(), error) { + return -1, nil, fmt.Errorf("IDMapped mounts are not supported") +} diff --git a/vendor/modules.txt b/vendor/modules.txt index 2ea7cad7f641..155a77aabfb9 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -276,7 +276,7 @@ github.com/containers/psgo/internal/dev github.com/containers/psgo/internal/host github.com/containers/psgo/internal/proc github.com/containers/psgo/internal/process -# github.com/containers/storage v1.45.3 => github.com/containers/storage v1.45.3-0.20230128103133-e14503c40a7e +# github.com/containers/storage v1.45.3 => github.com/giuseppe/storage v1.19.2-0.20230130113912-04cf69a17212 ## explicit; go 1.17 github.com/containers/storage github.com/containers/storage/drivers @@ -1131,4 +1131,4 @@ gopkg.in/yaml.v3 ## explicit; go 1.12 sigs.k8s.io/yaml # github.com/opencontainers/runc => github.com/opencontainers/runc v1.1.1-0.20220617142545-8b9452f75cbc -# github.com/containers/storage => github.com/containers/storage v1.45.3-0.20230128103133-e14503c40a7e +# github.com/containers/storage => github.com/giuseppe/storage v1.19.2-0.20230130113912-04cf69a17212