network-get filters on loopback addresses

Bug #2017307 reported by Peter Jose De Sousa
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical Juju
Fix Released
High
Joseph Phillips

Bug Description

Hello,

Currently the jujud agent will discover /32 addresses from a manual machine but network-get will filter these addresses if they have a config type fo loopback.

Example:

juju spaces:

Name Space ID Subnets
alpha 0 <CIDRS...>
bgp x.x.x.x/32
                 y.y.y.y/32
                 u.u.u.u/32

unit/x in juju debug-env (magpie bound to bgp):

lo: x.x.x.x/32
network-get --ingress-address magpie

ERROR no network config found for binding "magpie"

This appears to be caused by this line in the juju network method ConvertToSpaceAddress: https://github.com/juju/juju/blob/develop/core/network/address.go#L880

as removing this line like shown in the diff to remove the ConfigLoopback check fixes this issue:

+++ b/core/network/address.go
@@ -918,7 +918,7 @@ func ConvertToSpaceAddress(addr SpaceAddressCandidate, lookup SubnetLookup) (Spa

        // If this is not a loopback device, attempt to
        // set the space ID based on the subnet.
- if addr.ConfigMethod() != ConfigLoopback && cidr != "" {
+ if cidr != "" {
                allMatching, err := subnets.GetByCIDR(cidr)
                if err != nil {

Im not sure if this is the correct change in the long run, but has the desired result,

Thank you,
Peter

Tags: bgp
Revision history for this message
Peter Jose De Sousa (pjds) wrote :
Changed in juju:
status: New → In Progress
importance: Undecided → High
assignee: nobody → Joseph Phillips (manadart)
milestone: none → 2.9.43
Revision history for this message
Joseph Phillips (manadart) wrote :

Commit above is included in:
https://github.com/juju/juju/pull/15530

Changed in juju:
status: In Progress → Fix Committed
Changed in juju:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.