Skip to content

Commit 98d9a82

Browse files
committed
vendor: update go-mtree and image-spec
In order to fix a slight goof on the side of upstream (image-spec) we have to add a patch that includes opencontainers/image-spec#460 (which was _meant_ to be in v1.0.0-rc3 because the relevant spec change was included). Signed-off-by: Aleksa Sarai <[email protected]>
1 parent f020e71 commit 98d9a82

File tree

15 files changed

+110
-40
lines changed

15 files changed

+110
-40
lines changed

glide.lock

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

glide.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ import:
1313
subpackages:
1414
- generate
1515
- package: github.com/opencontainers/image-spec
16-
version: v1.0.0-rc2
16+
version: v1.0.0-rc3
1717
subpackages:
1818
- specs-go
1919
- package: github.com/opencontainers/runtime-spec
2020
version: v1.0.0-rc2
2121
subpackages:
2222
- specs-go
2323
- package: github.com/vbatts/go-mtree
24-
version: master
24+
version: ~v0.3.0
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
From 6ac650626feb8f806af721c4a024b2d9bb360da5 Mon Sep 17 00:00:00 2001
2+
From: Lei Jitang <[email protected]>
3+
Date: Thu, 17 Nov 2016 14:04:59 +0800
4+
Subject: [PATCH 1/2] specs-go: add labels to config.go
5+
6+
Signed-off-by: Lei Jitang <[email protected]>
7+
---
8+
specs-go/v1/config.go | 3 +++
9+
1 file changed, 3 insertions(+)
10+
11+
diff --git a/specs-go/v1/config.go b/specs-go/v1/config.go
12+
index d42383622695..894cc6cb70f5 100644
13+
--- a/specs-go/v1/config.go
14+
+++ b/specs-go/v1/config.go
15+
@@ -45,6 +45,9 @@ type ImageConfig struct {
16+
17+
// WorkingDir sets the current working directory of the entrypoint process in the container.
18+
WorkingDir string `json:"WorkingDir,omitempty"`
19+
+
20+
+ // Labels contains arbitrary metadata for the container.
21+
+ Labels map[string]string `json:"labels,omitempty"`
22+
}
23+
24+
// RootFS describes a layer content addresses
25+
--
26+
2.11.0
27+

hack/patch.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,14 @@ patch() {
2727
command patch -d "$VENDOR/$project" -p1 <"$SCRIPTDIR/$patch"
2828
}
2929

30+
# These are patches that I wrote as part of vbatts/go-mtree#96 (with a few
31+
# changes to port the code to using pkg/unpriv). I'm doubtful that this code
32+
# will ever be upstreamed -- at least not until pkg/unpriv is split into a
33+
# separate project.
3034
patch github.com/vbatts/go-mtree gomtree-0001-entries-prepend-all-hierarchies-with-keyword-metadat.patch
3135
patch github.com/vbatts/go-mtree gomtree-0002-walk-implement-unprivileged-walking.patch
36+
37+
# Backport of opencontainers/image-spec#460. This patch wasn't included in
38+
# v1.0.0-rc3 even though the change to the specification was, resulting in a
39+
# mismatch. While upstream figures out a way to fix this, just patch it.
40+
patch github.com/opencontainers/image-spec imagespec-0001-specs-go-add-labels-to-config.go.patch

test/create.bats

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ function teardown() {
9999
umoci stat --image "${NEWIMAGE}" --json
100100
[ "$status" -eq 0 ]
101101
# There should be no non-empty_layers.
102-
[[ "$(echo "$output" | jq -SM '[.history[] | .empty_layer == false] | any')" == "false" ]]
102+
[[ "$(echo "$output" | jq -SM '[.history[] | .empty_layer == null] | any')" == "false" ]]
103103

104104
# XXX: oci-image-validate doesn't like empty images (without layers)
105105
#image-verify "$NEWIMAGE"

test/repack.bats

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ function teardown() {
8282
# Number of lines should be greater.
8383
[ "$numLinesB" -gt "$numLinesA" ]
8484
# Make sure that the new layer is a non-empty_layer.
85-
[[ "$(echo "$output" | jq -SM '.history[-1].empty_layer')" == "false" ]]
85+
[[ "$(echo "$output" | jq -SM '.history[-1].empty_layer')" == "null" ]]
8686

8787
image-verify "${IMAGE}"
8888
}
@@ -132,7 +132,7 @@ function teardown() {
132132
# Make sure that the new layer is a non-empty_layer.
133133
umoci stat --image "${IMAGE}:${TAG}-new" --json
134134
[ "$status" -eq 0 ]
135-
[[ "$(echo "$output" | jq -SM '.history[-1].empty_layer')" == "false" ]]
135+
[[ "$(echo "$output" | jq -SM '.history[-1].empty_layer')" == "null" ]]
136136
}
137137

138138
@test "umoci repack [replace]" {
@@ -184,7 +184,7 @@ function teardown() {
184184
# Make sure that the new layer is a non-empty_layer.
185185
umoci stat --image "${IMAGE}:${TAG}" --json
186186
[ "$status" -eq 0 ]
187-
[[ "$(echo "$output" | jq -SM '.history[-1].empty_layer')" == "false" ]]
187+
[[ "$(echo "$output" | jq -SM '.history[-1].empty_layer')" == "null" ]]
188188

189189
image-verify "${IMAGE}"
190190
}
@@ -224,7 +224,7 @@ function teardown() {
224224
# Number of lines should be greater.
225225
[ "$numLinesB" -gt "$numLinesA" ]
226226
# The final layer should not be an empty_layer now.
227-
[[ "$(echo "$output" | jq -SMr '.history[-1].empty_layer')" == "false" ]]
227+
[[ "$(echo "$output" | jq -SMr '.history[-1].empty_layer')" == "null" ]]
228228
# The author should've changed to --history.author.
229229
[[ "$(echo "$output" | jq -SMr '.history[-1].author')" == "Some Author <[email protected]>" ]]
230230
# The comment should be added.

test/stat.bats

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ function teardown() {
4040
[ "$output" -ge 1 ]
4141

4242
# There should be at least one non-empty_layer.
43-
sane_run jq -SMr '[.history[] | .empty_layer == false] | any' "$statFile"
43+
sane_run jq -SMr '[.history[] | .empty_layer == null] | any' "$statFile"
4444
[ "$status" -eq 0 ]
4545
[[ "$output" == "true" ]]
4646

vendor/github.com/opencontainers/image-spec/specs-go/v1/config.go

Lines changed: 22 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/opencontainers/image-spec/specs-go/v1/descriptor.go

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/opencontainers/image-spec/specs-go/v1/layout.go

Lines changed: 28 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)