Init: Set OVN connection string only if necessary - #1505
Merged
roosterfish merged 2 commits intoAug 18, 2026
Conversation
Starting the with the ovn_dynamic_northbound_connection API extension in LXD, we don't anymore have to manually set the OVN northbound DB connection string. This also has the benefit that in case it requires a change, LXD always picks up the latest info from file setup by MicroOVN. Signed-off-by: Julian Pelizäus <julian.pelizaeus@canonical.com>
There was a problem hiding this comment.
Pull request overview
Updates MicroCloud’s init-time LXD configuration to avoid explicitly setting the OVN northbound DB connection string when LXD supports dynamically discovering it via MicroOVN’s ovn.env file (API extension: ovn_dynamic_northbound_connection), aligning initialization behavior with newer LXD capabilities.
Changes:
- Gate setting
network.ovn.northbound_connectionon the absence of LXD’sovn_dynamic_northbound_connectionextension. - Adjust OVN validation in shell test helpers to skip connection-string validation when the extension is present.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| cmd/microcloud/main_init.go | Conditionally sets LXD global OVN northbound connection config based on the LXD API extension. |
| test/includes/microcloud.sh | Skips validating the northbound connection string when LXD can determine it dynamically. |
Suppressed comments (1)
cmd/microcloud/main_init.go:935
- This implements skipping the OVN northbound connection config when the LXD API extension is present, but it does not implement the required behavior of unsetting
network.ovn.northbound_connectionwhen the extension is present and the key was previously set (per the linked issue/PR description). As written, clusters upgraded to a new LXD will keep the stale global config indefinitely.
newServer := server.Writable()
changed := false
for k, v := range config {
if newServer.Config[k] != v {
changed = true
}
newServer.Config[k] = v
}
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Signed-off-by: Julian Pelizäus <julian.pelizaeus@canonical.com>
roosterfish
force-pushed
the
fix_ovn_connection_string
branch
from
August 18, 2026 08:01
5c14f30 to
02c5c1f
Compare
roosterfish
marked this pull request as ready for review
August 18, 2026 09:23
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1286
Starting the with the ovn_dynamic_northbound_connection API extension in LXD, we don't anymore have to manually set the OVN northbound DB connection string. This also has the benefit that in case it requires a change, LXD always picks up the latest info from file setup by MicroOVN.