Skip to content

Commit

Permalink
lxd/networks: Emit lifecycle event for OVN networks (from Incus) (#14416
Browse files Browse the repository at this point in the history
)

Adds a missing lifecycle event on creation of cluster wide networks
(e.g. when one is created first on a per member basis).
  • Loading branch information
tomponline authored Nov 12, 2024
2 parents a968488 + 5c8f415 commit db47f43
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lxd/networks.go
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,14 @@ func networksPost(d *Daemon, r *http.Request) response.Response {
if err != nil {
return response.SmartError(err)
}

n, err := network.LoadByName(s, projectName, req.Name)
if err != nil {
return response.SmartError(fmt.Errorf("Failed loading network: %w", err))
}

requestor := request.CreateRequestor(r)
s.Events.SendLifecycle(projectName, lifecycle.NetworkCreated.Event(n, requestor, nil))
}

err = networksPostCluster(s, projectName, netInfo, req, clientType, netType)
Expand Down

0 comments on commit db47f43

Please sign in to comment.