The change makes "weave expose" to call the "/expose" HTTP endpoint implemented in router which exposes the bridge. Such architectural change required as we need to know whether NPC is enabled when exposing the bridge and weaver knows this fact the best. Unfortunately, this change makes impossible to "weave expose" when weaver is not running.
13 lines
260 B
Go
13 lines
260 B
Go
package api
|
|
|
|
import (
|
|
"fmt"
|
|
"net"
|
|
)
|
|
|
|
// Expose calls the router to assign the given IP addr to the weave bridge.
|
|
func (client *Client) Expose(ipAddr *net.IPNet) error {
|
|
_, err := client.httpVerb("POST", fmt.Sprintf("/expose/%s", ipAddr), nil)
|
|
return err
|
|
}
|