Skip to content

Commit

Permalink
incusd: Use new ETag instance function
Browse files Browse the repository at this point in the history
Signed-off-by: Stéphane Graber <[email protected]>
Sponsored-by: https://webdock.io
  • Loading branch information
stgraber committed Nov 28, 2024
1 parent 7eda98e commit 4ee200c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions cmd/incusd/instance_patch.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
3 changes: 1 addition & 2 deletions cmd/incusd/instance_put.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 4ee200c

Please sign in to comment.