summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBruce Ashfield <bruce.ashfield@windriver.com>2017-11-17 00:01:06 -0500
committerBruce Ashfield <bruce.ashfield@windriver.com>2017-11-17 11:06:03 -0500
commit68ab20d0c4d7728a2df9b8baa41187fac82784bf (patch)
treecab7588651c90d2cb5af82598c9b9c3343b41d9e
parent5b6773e6cffd42e243d67613fc4638440703b4fa (diff)
downloadmeta-virtualization-68ab20d0c4d7728a2df9b8baa41187fac82784bf.tar.gz
oci-image-tools: make Config.User mapping errors a warning
Rather than throwing an error if we can't map a user to a uid, output a warning. We aren't actually running the code, but are just extracting it .. so the user not existing isn't an issue. With this, we avoid the not-so-useful traces like this: config.User: unsupported format github.com/opencontainers/image-tools/image.(*config).runtimeSpec oci-image-tools/0.2.0-dev+gitAUTOINC+4abe1a166f-r0/oci-image-tools-0.2.0-dev+gitAUTOINC+4abe1a16 6f/src/import/vendor/src/github.com/opencontainers/image-tools/image/config.go:109 <...> src/import/cmd/oci-image-tool/main.go:57 runtime.main /usr/lib64/go/src/runtime/proc.go:185 runtime.goexit /usr/lib64/go/src/runtime/asm_amd64.s:2337 Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
-rw-r--r--recipes-containers/oci-image-tools/files/0001-config-make-Config.User-mapping-errors-a-warning.patch30
-rw-r--r--recipes-containers/oci-image-tools/oci-image-tools_git.bb3
2 files changed, 32 insertions, 1 deletions
diff --git a/recipes-containers/oci-image-tools/files/0001-config-make-Config.User-mapping-errors-a-warning.patch b/recipes-containers/oci-image-tools/files/0001-config-make-Config.User-mapping-errors-a-warning.patch
new file mode 100644
index 00000000..78d2b9d0
--- /dev/null
+++ b/recipes-containers/oci-image-tools/files/0001-config-make-Config.User-mapping-errors-a-warning.patch
@@ -0,0 +1,30 @@
1From fbd62eff9ff2f447c2eb4634398110609fbf9d59 Mon Sep 17 00:00:00 2001
2From: Bruce Ashfield <bruce.ashfield@windriver.com>
3Date: Thu, 16 Nov 2017 23:40:17 -0500
4Subject: [PATCH] config: make Config.User mapping errors a warning
5
6Rather than throwing an error if we can't map a user to a uid,
7output a warning. We aren't actually running the code, but are
8just extracting it .. so the user not existing isn't an issue.
9
10Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
11---
12 image/config.go | 2 +-
13 1 file changed, 1 insertion(+), 1 deletion(-)
14
15diff --git a/src/import/image/config.go b/src/import/image/config.go
16index d28b1bc4fe5f..37dfd1f14ef7 100644
17--- a/src/import/image/config.go
18+++ b/src/import/image/config.go
19@@ -106,7 +106,7 @@ func (c *config) runtimeSpec(rootfs string) (*specs.Spec, error) {
20 s.Process.User.UID = uint32(uid)
21 s.Process.User.GID = uint32(gid)
22 } else if c.Config.User != "" {
23- return nil, errors.New("config.User: unsupported format")
24+ fmt.Println("Warning: could not map UID for user:", c.Config.User)
25 }
26
27 s.Linux = &specs.Linux{}
28--
292.4.0.53.g8440f74
30
diff --git a/recipes-containers/oci-image-tools/oci-image-tools_git.bb b/recipes-containers/oci-image-tools/oci-image-tools_git.bb
index 68d73c37..807ee26c 100644
--- a/recipes-containers/oci-image-tools/oci-image-tools_git.bb
+++ b/recipes-containers/oci-image-tools/oci-image-tools_git.bb
@@ -14,7 +14,8 @@ DEPENDS = "\
14 14
15SRC_URI = "git://github.com/opencontainers/image-tools.git \ 15SRC_URI = "git://github.com/opencontainers/image-tools.git \
16 file://0001-image-manifest-Recursively-remove-pre-existing-entri.patch \ 16 file://0001-image-manifest-Recursively-remove-pre-existing-entri.patch \
17 file://0002-image-manifest-Split-unpackLayerEntry-into-its-own-f.patch" 17 file://0002-image-manifest-Split-unpackLayerEntry-into-its-own-f.patch \
18 file://0001-config-make-Config.User-mapping-errors-a-warning.patch"
18 19
19SRCREV = "4abe1a166f9be97e8e71b1bb4d7599cc29323011" 20SRCREV = "4abe1a166f9be97e8e71b1bb4d7599cc29323011"
20PV = "0.2.0-dev+git${SRCPV}" 21PV = "0.2.0-dev+git${SRCPV}"