From 8386506560cc8eaff44cc141f529f3bbdb081982 Mon Sep 17 00:00:00 2001 From: wanyaoqi Date: Wed, 23 Dec 2020 16:23:43 +0800 Subject: [PATCH] fix(glance): list image by os arch use startwith --- pkg/cloudcommon/db/archs.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/cloudcommon/db/archs.go b/pkg/cloudcommon/db/archs.go index 6ab67d8f64..14424544ec 100644 --- a/pkg/cloudcommon/db/archs.go +++ b/pkg/cloudcommon/db/archs.go @@ -42,11 +42,11 @@ func (manager *SMultiArchResourceBaseManager) ListItemFilter( if len(query.OsArch) > 0 { if query.OsArch == compute.OS_ARCH_X86 { q = q.Filter(sqlchemy.OR( - sqlchemy.Equals(q.Field("os_arch"), query.OsArch), + sqlchemy.Startswith(q.Field("os_arch"), query.OsArch), sqlchemy.IsNullOrEmpty(q.Field("os_arch")), )) } else { - q = q.Equals("os_arch", query.OsArch) + q = q.Startswith("os_arch", query.OsArch) } } return q, nil