From 87fca370753de1ec30973f54cba0a2f71012e622 Mon Sep 17 00:00:00 2001 From: Gianluca Arbezzano Date: Tue, 24 Nov 2020 16:37:27 +0100 Subject: [PATCH 1/2] bump boots to 45a64dad03795133adf7f7177677f3d58a0018e2 The main reason for this bump is because we fixed multi arch support for boots binaries. Before docker images were multi arch but boots was always x86. This issue is not fixed. Signed-off-by: Gianluca Arbezzano --- current_versions.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/current_versions.sh b/current_versions.sh index 47269b5..14cab31 100644 --- a/current_versions.sh +++ b/current_versions.sh @@ -7,6 +7,6 @@ export OSIE_DOWNLOAD_LINK=https://tinkerbell-oss.s3.amazonaws.com/osie-uploads/osie-v0-n=366,c=1aec189,b=master.tar.gz export TINKERBELL_TINK_SERVER_IMAGE=quay.io/tinkerbell/tink:sha-0e8e5733 export TINKERBELL_TINK_CLI_IMAGE=quay.io/tinkerbell/tink-cli:sha-0e8e5733 -export TINKERBELL_TINK_BOOTS_IMAGE=quay.io/tinkerbell/boots:sha-9625559b +export TINKERBELL_TINK_BOOTS_IMAGE=quay.io/tinkerbell/boots:sha-45a64dad export TINKERBELL_TINK_HEGEL_IMAGE=quay.io/tinkerbell/hegel:sha-c17b512f export TINKERBELL_TINK_WORKER_IMAGE=quay.io/tinkerbell/tink-worker:sha-0e8e5733 From f6b43ada0b60d624bf8740819433ffb490dd315f Mon Sep 17 00:00:00 2001 From: Gianluca Arbezzano Date: Tue, 24 Nov 2020 17:09:48 +0100 Subject: [PATCH 2/2] Unpack all image and not just the last layer The go program we use to get binaries from a docker image was unpacking only the last layer. This is not required and it order to have a more generic approach and fewest requirement the program now unpack all the image Signed-off-by: Gianluca Arbezzano --- cmd/getbinariesfromquay/main.go | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/cmd/getbinariesfromquay/main.go b/cmd/getbinariesfromquay/main.go index f1add7b..5dad8af 100644 --- a/cmd/getbinariesfromquay/main.go +++ b/cmd/getbinariesfromquay/main.go @@ -98,14 +98,14 @@ func main() { if err != nil { log.Fatal(err) } - err = copyBinaryFromLastLayer(path.Join(imgsDir, imgDir), path.Join(releaseDir, imgDir), binaryToCopy) + err = untarLayers(path.Join(imgsDir, imgDir), path.Join(releaseDir, imgDir), binaryToCopy) if err != nil { log.Fatal(err) } } } -func copyBinaryFromLastLayer(src, dest, binaryPath string) error { +func untarLayers(src, dest, binaryPath string) error { b, err := ioutil.ReadFile(path.Join(src, "manifest.json")) if err != nil { return err @@ -114,14 +114,15 @@ func copyBinaryFromLastLayer(src, dest, binaryPath string) error { if err != nil { return err } - last := man.LayerInfos()[len(man.LayerInfos())-1] - layerTar, err := os.Open(path.Join(src, last.Digest.String()[7:])) - if err != nil { - return err - } - err = tar.Untar(src, layerTar) - if err != nil { - return err + for _, l := range man.LayerInfos() { + layerTar, err := os.Open(path.Join(src, l.Digest.String()[7:])) + if err != nil { + return err + } + err = tar.Untar(src, layerTar) + if err != nil { + return err + } } input, err := ioutil.ReadFile(path.Join(src, binaryPath))