Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

Commit

Permalink
Stop collecting addresses in launch script now we do it in Go
Browse files Browse the repository at this point in the history
  • Loading branch information
bboreham committed Feb 9, 2017
1 parent be3bdbe commit 9b56239
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
3 changes: 3 additions & 0 deletions ipam/allocator.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,9 @@ func (alloc *Allocator) Start() {
default:
alloc.infof("Initialising as observer - awaiting IPAM data from another peer")
}
if loadedPersistedData { // do any pre-claims right away
alloc.tryOps(&alloc.pendingClaims)
}
actionChan := make(chan func(), mesh.ChannelSize)
stopChan := make(chan struct{})
alloc.actionChan = actionChan
Expand Down
9 changes: 0 additions & 9 deletions prog/weave-kube/launch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,6 @@ post_start_actions() {
sleep 1
done

# Tell the newly-started weave about existing weave bridge IPs
/usr/bin/weaveutil container-addrs weave weave:expose | while read ID IFACE MAC IPS; do
reclaim_ips "weave:expose" $IPS
done
# Tell weave about existing weave process IPs
/usr/bin/weaveutil process-addrs weave | while read ID IFACE MAC IPS; do
reclaim_ips "_" $IPS
done

# Install CNI plugin binary to typical CNI bin location
# with fall-back to CNI directory used by kube-up on GCI OS
if ! mkdir -p $HOST_ROOT/opt/cni/bin ; then
Expand Down
6 changes: 3 additions & 3 deletions prog/weaver/reclaim.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

func a(cidr *net.IPNet) address.CIDR {
prefixLength, _ := cidr.Mask.Size()
return address.CIDR{address.FromIP4(cidr.IP), prefixLength}
return address.CIDR{Addr: address.FromIP4(cidr.IP), PrefixLen: prefixLength}
}

// Get all the existing Weave IPs at startup, so we can stop IPAM
Expand All @@ -23,7 +23,7 @@ func findExistingAddresses(bridgeName string) (addrs []ipam.PreClaim, err error)
return nil, err
}
for _, cidr := range bridgeNetDev.CIDRs {
addrs = append(addrs, ipam.PreClaim{"weave:expose", a(cidr)})
addrs = append(addrs, ipam.PreClaim{Ident: "weave:expose", Cidr: a(cidr)})
}

// Then find all veths connected to the bridge
Expand All @@ -46,7 +46,7 @@ func findExistingAddresses(bridgeName string) (addrs []ipam.PreClaim, err error)
for _, netDev := range netDevs {
for _, cidr := range netDev.CIDRs {
// We don't know the container ID, so use special magic string
addrs = append(addrs, ipam.PreClaim{"_", a(cidr)})
addrs = append(addrs, ipam.PreClaim{Ident: "_", Cidr: a(cidr)})
}
}
}
Expand Down

0 comments on commit 9b56239

Please sign in to comment.