Skip to content

Commit

Permalink
service: Fetch local interfaces even when not bootstrapping
Browse files Browse the repository at this point in the history
Signed-off-by: Max Asnaashari <[email protected]>
  • Loading branch information
masnax committed Jun 12, 2024
1 parent 42b5f32 commit 333a2b1
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions service/lxd.go
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,17 @@ func getClientsAndNetworks(s LXDService, ctx context.Context, bootstrap bool, pe
for _, info := range peers {
// Don't include a local interface unless we are bootstrapping, in which case we shouldn't use the remote client.
if info.Name == s.Name() {
if clients[info.Name] == nil {
clients[info.Name], err = s.Client(ctx, "")
if err != nil {
return nil, nil, err
}

networks[info.Name], err = clients[info.Name].GetNetworks()
if err != nil {
return nil, nil, err
}
}
continue
}

Expand Down

0 comments on commit 333a2b1

Please sign in to comment.