From: chengli3 Date: Fri, 6 Mar 2020 03:38:09 +0000 (+0800) Subject: Visit openwrt api with namespace suffix X-Git-Tag: v1.0~40 X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=commitdiff_plain;h=3cda56734949e2cab22dec1207b3b2e1135d5b3d;p=icn%2Fsdwan.git Visit openwrt api with namespace suffix openwrt api requests are sent from the sdewan controller pod. As the controller namespace may be different with the openwrt pod. We add the namespace suffix so that the controller can always resolv the openwrt svc. Signed-off-by: chengli3 Change-Id: I49c62ecda5d2a22e1feaaf717cfa411d4ba01b05 --- diff --git a/wrtprovider/wrtprovider.go b/wrtprovider/wrtprovider.go index 634932e..4545c61 100644 --- a/wrtprovider/wrtprovider.go +++ b/wrtprovider/wrtprovider.go @@ -116,7 +116,7 @@ func Mwan3ReplaceRules(rules []openwrt.SdewanRule, existOnes []openwrt.SdewanRul // apply policy and rules func Mwan3Apply(mwan3Conf *sdewanv1alpha1.Mwan3Conf, sdewan *sdewanv1alpha1.Sdewan) error { reqLogger := log.WithValues("Mwan3Provider", mwan3Conf.Name, "Sdewan", sdewan.Name) - openwrtClient := openwrt.NewOpenwrtClient(sdewan.Name, "root", "") + openwrtClient := openwrt.NewOpenwrtClient(sdewan.Name + "." + sdewan.Namespace, "root", "") mwan3 := openwrt.Mwan3Client{OpenwrtClient: openwrtClient} service := openwrt.ServiceClient{OpenwrtClient: openwrtClient} netMap := NetworkInterfaceMap(sdewan)