Skip to content

Commit

Permalink
lxd: Update logic for project config patch
Browse files Browse the repository at this point in the history
Signed-off-by: Mark Bolton <[email protected]>
  • Loading branch information
boltmark committed Jul 19, 2024
1 parent 6fcc631 commit fa5eb8a
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions lxd/api_project.go
Original file line number Diff line number Diff line change
Expand Up @@ -599,14 +599,14 @@ func projectPatch(d *Daemon, r *http.Request) response.Response {
req.Description = project.Description
}

config, err := reqRaw.GetMap("config")
if err != nil {
req.Config = project.Config
} else {
for k, v := range project.Config {
_, ok := config[k]
if !ok {
config[k] = v
// Perform config patch
req.Config = util.CopyConfig(project.Config)
patches, err := reqRaw.GetMap("config")
if err == nil {
for k, v := range patches {
strVal, ok := v.(string)
if ok {
req.Config[k] = strVal
}
}
}
Expand Down

0 comments on commit fa5eb8a

Please sign in to comment.