From 26df7ea8c045a697e19a5d22dd399c3aaf7f350a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Graber?= Date: Wed, 3 Apr 2024 17:53:06 -0400 Subject: [PATCH 1/2] lxd-to-incus: Support all LXD 5.21.x releases MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Graber --- cmd/lxd-to-incus/validate.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/lxd-to-incus/validate.go b/cmd/lxd-to-incus/validate.go index 7e36d04d9e4..bc629110494 100644 --- a/cmd/lxd-to-incus/validate.go +++ b/cmd/lxd-to-incus/validate.go @@ -12,7 +12,7 @@ import ( ) var minLXDVersion = &version.DottedVersion{Major: 4, Minor: 0, Patch: 0} -var maxLXDVersion = &version.DottedVersion{Major: 5, Minor: 21, Patch: 0} +var maxLXDVersion = &version.DottedVersion{Major: 5, Minor: 21, Patch: 99} func (c *cmdMigrate) validate(source source, target target) error { srcClient, err := source.connect() From d04cef88fd08a1bd8d870efc93efc3a294ee8b8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Graber?= Date: Wed, 3 Apr 2024 17:54:27 -0400 Subject: [PATCH 2/2] lxd-to-incus: Handle unrestricted metrics certificates MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Graber --- cmd/lxd-to-incus/main.go | 1 + 1 file changed, 1 insertion(+) diff --git a/cmd/lxd-to-incus/main.go b/cmd/lxd-to-incus/main.go index 2851b5e354f..6088cbde92c 100644 --- a/cmd/lxd-to-incus/main.go +++ b/cmd/lxd-to-incus/main.go @@ -415,6 +415,7 @@ UPDATE schema SET version=69 WHERE version=73;`) INSERT INTO certificates (id, fingerprint, type, name, certificate, restricted) SELECT id, identifier, 1, name, json_extract(metadata, "$.cert"), 0 FROM identities WHERE type=2; INSERT INTO certificates (id, fingerprint, type, name, certificate, restricted) SELECT id, identifier, 2, name, json_extract(metadata, "$.cert"), 0 FROM identities WHERE type=3; INSERT INTO certificates (id, fingerprint, type, name, certificate, restricted) SELECT id, identifier, 3, name, json_extract(metadata, "$.cert"), 1 FROM identities WHERE type=4; +INSERT INTO certificates (id, fingerprint, type, name, certificate, restricted) SELECT id, identifier, 3, name, json_extract(metadata, "$.cert"), 0 FROM identities WHERE type=6; INSERT INTO certificates_projects (certificate_id, project_id) SELECT identity_id, project_id FROM identities_projects;`) // Drop the other tables.