Skip to content

Commit c3fa22e

Browse files
committed
Make OvnClient.updateRefs() a no-op
updateRefs used to derive component control socket paths from the system run directory and each daemon's tracked PID. Now that GetProcessInfo no longer tracks PIDs (it probes the control socket directly), the derived paths collapse to invalid values like ".../ovn-northd.0.ctl" that overwrite whatever the caller configured explicitly. Callers that previously read the derived socket paths should now configure them up front via the existing Database.{NB,SB}.Socket.Control and Service.Northd.Socket.Control fields, populated from CLI flags. The method is kept as a no-op rather than deleted so that every existing call site (which there are several of across the package) compiles unchanged. OvsClient.updateRefs is untouched; ovs_exporter still needs the PID-based socket derivation for Open_vSwitch.
1 parent c04b1a3 commit c3fa22e

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

ovn.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,9 @@ func (cli *OvnClient) Close() {
147147
}
148148
}
149149

150+
// updateRefs is retained for compatibility with callers that invoke it, but
151+
// is now a no-op for OvnClient: component control sockets are configured
152+
// explicitly via CLI flags and must not be re-derived from PID data that
153+
// this client no longer tracks.
150154
func (cli *OvnClient) updateRefs() {
151-
cli.Database.Vswitch.Socket.Control = fmt.Sprintf("unix:%s/ovsdb-server.%d.ctl", cli.System.RunDir, cli.Database.Vswitch.Process.ID)
152-
cli.Service.Vswitchd.Socket.Control = fmt.Sprintf("unix:%s/ovs-vswitchd.%d.ctl", cli.System.RunDir, cli.Service.Vswitchd.Process.ID)
153-
cli.Service.Northd.Socket.Control = fmt.Sprintf("unix:%s/ovn-northd.%d.ctl", cli.System.RunDir, cli.Service.Northd.Process.ID)
154155
}

0 commit comments

Comments
 (0)