From 9dfabee26a50680d89aec28d61bdf5d5f9cc9300 Mon Sep 17 00:00:00 2001 From: Kent Dong Date: Mon, 20 Mar 2023 13:00:33 +0800 Subject: [PATCH] feat: Support Wasm plugin OCI images with more than 2 layers (#244) --- .../istio/20230319-imagefetcher-oci.patch | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 istio/1.12/patches/istio/20230319-imagefetcher-oci.patch diff --git a/istio/1.12/patches/istio/20230319-imagefetcher-oci.patch b/istio/1.12/patches/istio/20230319-imagefetcher-oci.patch new file mode 100644 index 000000000..7c31e0ca0 --- /dev/null +++ b/istio/1.12/patches/istio/20230319-imagefetcher-oci.patch @@ -0,0 +1,20 @@ +diff --color -Naur external/istio/pkg/wasm/imagefetcher.go external/istio_new/pkg/wasm/imagefetcher.go +--- istio/pkg/wasm/imagefetcher.go 2023-03-19 17:56:55.238354950 +0800 ++++ istio_new/pkg/wasm/imagefetcher.go 2023-03-19 17:56:40.630410241 +0800 +@@ -176,12 +176,12 @@ + return nil, fmt.Errorf("could not fetch layers: %v", err) + } + +- // The image must be single-layered. +- if len(layers) != 1 { +- return nil, fmt.Errorf("number of layers must be 1 but got %d", len(layers)) ++ // The image must have at least one layer. ++ if len(layers) == 0 { ++ return nil, fmt.Errorf("number of layers must be greater than zero") + } + +- layer := layers[0] ++ layer := layers[len(layers)-1] + mt, err := layer.MediaType() + if err != nil { + return nil, fmt.Errorf("could not get media type: %v", err)