From 8234174b0455dd6d6656a24155014c4fba8fad49 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Tue, 13 Feb 2024 17:36:25 +0000 Subject: gentoo auto-resync : 13:02:2024 - 17:36:25 --- ...0.3-pr-12834-dont-stop-parsing-image-info.patch | 79 ++++++++++++++++++++++ .../lxd-5.0.3-pr-12847-ignore-incus-archives.patch | 26 +++++++ 2 files changed, 105 insertions(+) create mode 100644 app-containers/lxd/files/lxd-5.0.3-pr-12834-dont-stop-parsing-image-info.patch create mode 100644 app-containers/lxd/files/lxd-5.0.3-pr-12847-ignore-incus-archives.patch (limited to 'app-containers/lxd/files') diff --git a/app-containers/lxd/files/lxd-5.0.3-pr-12834-dont-stop-parsing-image-info.patch b/app-containers/lxd/files/lxd-5.0.3-pr-12834-dont-stop-parsing-image-info.patch new file mode 100644 index 000000000000..768e4d160132 --- /dev/null +++ b/app-containers/lxd/files/lxd-5.0.3-pr-12834-dont-stop-parsing-image-info.patch @@ -0,0 +1,79 @@ +From fe71f2135bdc3aa6ea28de7ed1ac324f7d689ed6 Mon Sep 17 00:00:00 2001 +From: Thomas Parrott +Date: Wed, 7 Feb 2024 16:53:29 +0000 +Subject: [PATCH 1/2] shared/simplestreams/products: Fix regression in parsing + version files + +Don't stop when finding first matching version file because the index is parsed +in random order and LXD calls it multiple times when figuring out which image +file to download and so stopping early can cause mismatches when trying to match +a converted alias to a specific file fingerprint. + +Introduced with 3e9acc4 + +Signed-off-by: Thomas Parrott +(cherry picked from commit 3681d5e54649fcc2fc9375b6820c1133f140228d) +--- + shared/simplestreams/products.go | 4 ---- + 1 file changed, 4 deletions(-) + +diff --git a/shared/simplestreams/products.go b/shared/simplestreams/products.go +index a07e4d5b1b5b..542051403899 100644 +--- a/shared/simplestreams/products.go ++++ b/shared/simplestreams/products.go +@@ -279,8 +279,6 @@ func (s *Products) ToLXD() ([]api.Image, map[string][][]string) { + if err != nil { + continue + } +- +- break // Stop at first compatible item found. + } else if shared.StringInSlice(item.FileType, lxdCompatItems) { + // Locate the root files + for _, subItem := range version.Items { +@@ -291,8 +289,6 @@ func (s *Products) ToLXD() ([]api.Image, map[string][][]string) { + } + } + } +- +- break // Stop at first compatible item found. + } + } + } + +From d3253e4cbc85b97e3bc6dba9a27fd2ab0c4d8685 Mon Sep 17 00:00:00 2001 +From: Thomas Parrott +Date: Wed, 7 Feb 2024 10:28:36 +0000 +Subject: [PATCH 2/2] shared/simplestreams/simplestreams: Improve error + messages + +Signed-off-by: Thomas Parrott +(cherry picked from commit 56364f5a97373155d5e6a5a6b10d06d16a25fb3c) +--- + shared/simplestreams/simplestreams.go | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/shared/simplestreams/simplestreams.go b/shared/simplestreams/simplestreams.go +index 3f3255cac913..68e1d96278a3 100644 +--- a/shared/simplestreams/simplestreams.go ++++ b/shared/simplestreams/simplestreams.go +@@ -377,7 +377,7 @@ func (s *SimpleStreams) GetFiles(fingerprint string) (map[string]DownloadableFil + } + } + +- return nil, fmt.Errorf("Couldn't find the requested image") ++ return nil, fmt.Errorf("Couldn't find the requested image for fingerprint %q", fingerprint) + } + + // ListAliases returns a list of image aliases for the provided image fingerprint. +@@ -501,9 +501,9 @@ func (s *SimpleStreams) GetImage(fingerprint string) (*api.Image, error) { + } + + if len(matches) == 0 { +- return nil, fmt.Errorf("The requested image couldn't be found") ++ return nil, fmt.Errorf("The requested image couldn't be found for fingerprint %q", fingerprint) + } else if len(matches) > 1 { +- return nil, fmt.Errorf("More than one match for the provided partial fingerprint") ++ return nil, fmt.Errorf("More than one match for the provided partial fingerprint %q", fingerprint) + } + + return &matches[0], nil diff --git a/app-containers/lxd/files/lxd-5.0.3-pr-12847-ignore-incus-archives.patch b/app-containers/lxd/files/lxd-5.0.3-pr-12847-ignore-incus-archives.patch new file mode 100644 index 000000000000..76a6a1476de8 --- /dev/null +++ b/app-containers/lxd/files/lxd-5.0.3-pr-12847-ignore-incus-archives.patch @@ -0,0 +1,26 @@ +From 55bd4024dbfc315c0f57da57f2f9bd9c5c97dad1 Mon Sep 17 00:00:00 2001 +From: Din Music +Date: Thu, 18 Jan 2024 17:08:36 +0100 +Subject: [PATCH] shared/simplestreams/products: Search only for lxd archives + +Signed-off-by: Din Music +(cherry picked from commit 0c9253da9448475e6de60dd345c67c0179884f13) +--- + shared/simplestreams/products.go | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/shared/simplestreams/products.go b/shared/simplestreams/products.go +index 542051403899..d80d8e7be251 100644 +--- a/shared/simplestreams/products.go ++++ b/shared/simplestreams/products.go +@@ -10,8 +10,8 @@ import ( + "github.com/canonical/lxd/shared/osarch" + ) + +-var lxdCompatCombinedItems = []string{"lxd_combined.tar.gz", "incus_combined.tar.gz"} +-var lxdCompatItems = []string{"lxd.tar.xz", "incus.tar.xz"} ++var lxdCompatCombinedItems = []string{"lxd_combined.tar.gz"} ++var lxdCompatItems = []string{"lxd.tar.xz"} + + // Products represents the base of download.json. + type Products struct { -- cgit v1.2.3