Skip to content

Commit

Permalink
incusd: Reset OVS as needed
Browse files Browse the repository at this point in the history
Signed-off-by: Stéphane Graber <[email protected]>
  • Loading branch information
stgraber committed Aug 27, 2024
1 parent ab44781 commit 3ddbdcc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
11 changes: 11 additions & 0 deletions cmd/incusd/api_1.0.go
Original file line number Diff line number Diff line change
Expand Up @@ -801,6 +801,7 @@ func doApi10UpdateTriggers(d *Daemon, nodeChanged, clusterChanged map[string]str
oidcChanged := false
openFGAChanged := false
ovnChanged := false
ovsChanged := false
syslogChanged := false

for key := range clusterChanged {
Expand Down Expand Up @@ -856,6 +857,9 @@ func doApi10UpdateTriggers(d *Daemon, nodeChanged, clusterChanged map[string]str

case "core.syslog_socket":
syslogChanged = true

case "network.ovs.connection":
ovsChanged = true
}
}

Expand Down Expand Up @@ -993,6 +997,13 @@ func doApi10UpdateTriggers(d *Daemon, nodeChanged, clusterChanged map[string]str
}
}

if ovsChanged {
err := d.setupOVS()
if err != nil {
return err
}
}

if syslogChanged {
err := d.setupSyslogSocket(nodeConfig.SyslogSocket())
if err != nil {
Expand Down
3 changes: 3 additions & 0 deletions cmd/incusd/api_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -773,6 +773,9 @@ func clusterPutJoin(d *Daemon, r *http.Request, req api.ClusterPut) response.Res
// Refresh the state.
s = d.State()

// Re-connect OVS if needed.
_ = d.setupOVS()

// Re-connect OVN if needed.
_ = d.setupOVN()

Expand Down

0 comments on commit 3ddbdcc

Please sign in to comment.