From 3cda56734949e2cab22dec1207b3b2e1135d5b3d Mon Sep 17 00:00:00 2001 From: chengli3 Date: Fri, 6 Mar 2020 11:38:09 +0800 Subject: [PATCH] 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 --- wrtprovider/wrtprovider.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) -- 2.16.6