Skip to content

Commit

Permalink
vendor: update go-mtree and image-spec
Browse files Browse the repository at this point in the history
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 <asarai@suse.com>
  • Loading branch information
cyphar committed Dec 10, 2016
1 parent f020e71 commit 98d9a82
Show file tree
Hide file tree
Showing 15 changed files with 110 additions and 40 deletions.
16 changes: 8 additions & 8 deletions glide.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions glide.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ import:
subpackages:
- generate
- package: github.com/opencontainers/image-spec
version: v1.0.0-rc2
version: v1.0.0-rc3
subpackages:
- specs-go
- package: github.com/opencontainers/runtime-spec
version: v1.0.0-rc2
subpackages:
- specs-go
- package: github.com/vbatts/go-mtree
version: master
version: ~v0.3.0
27 changes: 27 additions & 0 deletions hack/imagespec-0001-specs-go-add-labels-to-config.go.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
From 6ac650626feb8f806af721c4a024b2d9bb360da5 Mon Sep 17 00:00:00 2001
From: Lei Jitang <leijitang@huawei.com>
Date: Thu, 17 Nov 2016 14:04:59 +0800
Subject: [PATCH 1/2] specs-go: add labels to config.go

Signed-off-by: Lei Jitang <leijitang@huawei.com>
---
specs-go/v1/config.go | 3 +++
1 file changed, 3 insertions(+)

diff --git a/specs-go/v1/config.go b/specs-go/v1/config.go
index d42383622695..894cc6cb70f5 100644
--- a/specs-go/v1/config.go
+++ b/specs-go/v1/config.go
@@ -45,6 +45,9 @@ type ImageConfig struct {

// WorkingDir sets the current working directory of the entrypoint process in the container.
WorkingDir string `json:"WorkingDir,omitempty"`
+
+ // Labels contains arbitrary metadata for the container.
+ Labels map[string]string `json:"labels,omitempty"`
}

// RootFS describes a layer content addresses
--
2.11.0

9 changes: 9 additions & 0 deletions hack/patch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,14 @@ patch() {
command patch -d "$VENDOR/$project" -p1 <"$SCRIPTDIR/$patch"
}

# These are patches that I wrote as part of vbatts/go-mtree#96 (with a few
# changes to port the code to using pkg/unpriv). I'm doubtful that this code
# will ever be upstreamed -- at least not until pkg/unpriv is split into a
# separate project.
patch github.com/vbatts/go-mtree gomtree-0001-entries-prepend-all-hierarchies-with-keyword-metadat.patch
patch github.com/vbatts/go-mtree gomtree-0002-walk-implement-unprivileged-walking.patch

# Backport of opencontainers/image-spec#460. This patch wasn't included in
# v1.0.0-rc3 even though the change to the specification was, resulting in a
# mismatch. While upstream figures out a way to fix this, just patch it.
patch github.com/opencontainers/image-spec imagespec-0001-specs-go-add-labels-to-config.go.patch
2 changes: 1 addition & 1 deletion test/create.bats
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ function teardown() {
umoci stat --image "${NEWIMAGE}" --json
[ "$status" -eq 0 ]
# There should be no non-empty_layers.
[[ "$(echo "$output" | jq -SM '[.history[] | .empty_layer == false] | any')" == "false" ]]
[[ "$(echo "$output" | jq -SM '[.history[] | .empty_layer == null] | any')" == "false" ]]

# XXX: oci-image-validate doesn't like empty images (without layers)
#image-verify "$NEWIMAGE"
Expand Down
8 changes: 4 additions & 4 deletions test/repack.bats
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ function teardown() {
# Number of lines should be greater.
[ "$numLinesB" -gt "$numLinesA" ]
# Make sure that the new layer is a non-empty_layer.
[[ "$(echo "$output" | jq -SM '.history[-1].empty_layer')" == "false" ]]
[[ "$(echo "$output" | jq -SM '.history[-1].empty_layer')" == "null" ]]

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

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

image-verify "${IMAGE}"
}
Expand Down Expand Up @@ -224,7 +224,7 @@ function teardown() {
# Number of lines should be greater.
[ "$numLinesB" -gt "$numLinesA" ]
# The final layer should not be an empty_layer now.
[[ "$(echo "$output" | jq -SMr '.history[-1].empty_layer')" == "false" ]]
[[ "$(echo "$output" | jq -SMr '.history[-1].empty_layer')" == "null" ]]
# The author should've changed to --history.author.
[[ "$(echo "$output" | jq -SMr '.history[-1].author')" == "Some Author <jane@blogg.com>" ]]
# The comment should be added.
Expand Down
2 changes: 1 addition & 1 deletion test/stat.bats
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function teardown() {
[ "$output" -ge 1 ]

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

Expand Down
41 changes: 22 additions & 19 deletions vendor/github.com/opencontainers/image-spec/specs-go/v1/config.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 28 additions & 0 deletions vendor/github.com/opencontainers/image-spec/specs-go/v1/layout.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/github.com/vbatts/go-mtree/version.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 98d9a82

Please sign in to comment.