-
Notifications
You must be signed in to change notification settings - Fork 935
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Network: Return ACL logs from syslogs when the OVN controller is deployed in MicroOVN #14327
base: main
Are you sure you want to change the base?
Conversation
ddd4d19
to
af03834
Compare
d4828be
to
316aeed
Compare
@tomponline this should be working. Regarding the documentation, as we discussed earlier, we probably need to add a note in the doc section |
Here is the lxd-ci PR: canonical/lxd-ci#330 |
ab7cce7
to
1794edb
Compare
@tomponline the lxd-ci PR is ready at: https://github.com/canonical/lxd-ci/actions/runs/11599574607/job/32305555034?pr=330 Actually this lxd-ci PR completely enables MicroOVN as a 'backend' for the OVN tests so no need to add new |
bc42c46
to
fea89eb
Compare
Heads up @mionaalex - the "Documentation" label was applied to this issue. |
fea89eb
to
0106b44
Compare
0106b44
to
c2de174
Compare
c2de174
to
c70a986
Compare
ff7f5a4
to
bebe6e1
Compare
bebe6e1
to
18ae201
Compare
…n external timestamp When reading a log file, the logtime (timestamp of the log entry) is part of the entry but when we read a syslog, the logtime is not contained in the log entry fields and need to be parsed and converted. We added two local functions to cope with these two usages: * 'parseLogTimeFromFields' * 'parseLogTimeFromTimestamp' (used when the OVN deployment is part of MicroOVN and we need to read the syslog) Signed-off-by: Gabriel Mougard <[email protected]>
In the case of an OVN controller being deployed as part of a MicroOVN deployment, the OVN controller logs are stored in MicroOVN's snap syslog. The LXD snap should have root access, which means that it should be authorized (this is being tested) to read the OVN controller logs. Signed-off-by: Gabriel Mougard <[email protected]>
Passing the request ctx to the GetLog function allows to stop the syslog stream (in case of OVN being deployed with MicroOVN) in case of request interruption Signed-off-by: Gabriel Mougard <[email protected]>
…ion to LXD When a user decides to deploy OVN through a MicroOVN deployment, it is not clearly explained how to connect LXD and MicroOVN. The only missing info was how to correctly setup the northbound connection: `lxc config set network.ovn.northbound_connection <ovn-northd-nb-db>` With `<ovn-northd-nb-db>` that MUST use the `ssl:<microovn_node_ip>:6641`. Passing a UNIX socket targeting `ovnnb_db.sock` inside the MicroOVN snap will produce certificate errors so we MUSN'T use the UNIX notation. Signed-off-by: Gabriel Mougard <[email protected]>
18ae201
to
29c825d
Compare
doc tests failing |
The fix is a rebase away AFAICT. |
canonical/lxd#14327 is needed to get access to MicroOVN logs. Signed-off-by: Simon Deziel <[email protected]>
canonical/lxd#14327 is needed to get access to MicroOVN logs. Signed-off-by: Simon Deziel <[email protected]>
canonical/lxd#14327 is needed to get access to MicroOVN logs. Signed-off-by: Simon Deziel <[email protected]>
prefix := fmt.Sprintf("lxd_acl%d-", d.id) | ||
logEntries, err = ovnParseLogEntriesFromJournald(context.TODO(), "snap.microovn.chassis.service", prefix) | ||
if err != nil { | ||
return "", fmt.Errorf("Failed to get OVN log entries from syslog: %v\n", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We shouldnt use \n
in returned errors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should use %w
when wrapping errors
|
||
// First, check if we can resolve the /run/openvswitch symlink to determine if OVN is in use. | ||
// This is used in case of a MicroOVN deployment is interfaced with LXD. | ||
targetPath, err := os.Readlink("/run/openvswitch") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please break out the logic to detect if microovn is being used into a different function in network_utils.go
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor refactoring to do please
closes #12836
We need to remember to enable the log tests for microovn on canonical/lxd-ci#368 when this is merged