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 <cheng1.li@intel.com>
Change-Id: I49c62ecda5d2a22e1feaaf717cfa411d4ba01b05
// 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)