From 4ee200ce432672ab42a2d08c4f9033ff5609ee0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Graber?= Date: Thu, 28 Nov 2024 13:52:31 -0500 Subject: [PATCH] incusd: Use new ETag instance function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Graber Sponsored-by: https://webdock.io --- cmd/incusd/instance_patch.go | 3 +-- cmd/incusd/instance_put.go | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/cmd/incusd/instance_patch.go b/cmd/incusd/instance_patch.go index 544e7a18026..76ef4f22b07 100644 --- a/cmd/incusd/instance_patch.go +++ b/cmd/incusd/instance_patch.go @@ -102,8 +102,7 @@ func instancePatch(d *Daemon, r *http.Request) response.Response { } // Validate the ETag - etag := []any{c.Architecture(), c.LocalConfig(), c.LocalDevices(), c.IsEphemeral(), c.Profiles()} - err = localUtil.EtagCheck(r, etag) + err = localUtil.EtagCheck(r, c.ETag()) if err != nil { return response.PreconditionFailed(err) } diff --git a/cmd/incusd/instance_put.go b/cmd/incusd/instance_put.go index cf57024005d..57e447237a8 100644 --- a/cmd/incusd/instance_put.go +++ b/cmd/incusd/instance_put.go @@ -110,8 +110,7 @@ func instancePut(d *Daemon, r *http.Request) response.Response { } // Validate the ETag - etag := []any{inst.Architecture(), inst.LocalConfig(), inst.LocalDevices(), inst.IsEphemeral(), inst.Profiles()} - err = localUtil.EtagCheck(r, etag) + err = localUtil.EtagCheck(r, inst.ETag()) if err != nil { return response.PreconditionFailed(err) }