mirror of
https://github.com/luscis/openlan.git
synced 2025-10-20 23:51:31 +08:00
fix: cert not update
This commit is contained in:
2
Makefile
2
Makefile
@@ -55,7 +55,7 @@ clean: ## clean cache
|
|||||||
## prepare environment
|
## prepare environment
|
||||||
update:
|
update:
|
||||||
git submodule init
|
git submodule init
|
||||||
git submodule update
|
git submodule update --remote
|
||||||
|
|
||||||
vendor:
|
vendor:
|
||||||
go clean -modcache
|
go clean -modcache
|
||||||
|
@@ -153,12 +153,13 @@ func (s *Switch) Format() {
|
|||||||
for _, obj := range s.Network {
|
for _, obj := range s.Network {
|
||||||
context := obj.Specifies
|
context := obj.Specifies
|
||||||
obj.NewSpecifies()
|
obj.NewSpecifies()
|
||||||
if data, err := libol.Marshal(context, true); err == nil {
|
if obj.Specifies == nil {
|
||||||
if err := libol.Unmarshal(obj.Specifies, data); err != nil {
|
continue
|
||||||
libol.Warn("Switch.Format %s", err)
|
|
||||||
} else {
|
|
||||||
libol.Info("Switch.Format %v", obj.Specifies)
|
|
||||||
}
|
}
|
||||||
|
if data, err := libol.Marshal(context, true); err != nil {
|
||||||
|
libol.Warn("Switch.Format %s", err)
|
||||||
|
} else if err := libol.Unmarshal(obj.Specifies, data); err != nil {
|
||||||
|
libol.Warn("Switch.Format %s", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -39,7 +39,7 @@ func NewOpenLANWorker(c *co.Network) *OpenLANWorker {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (w *OpenLANWorker) updateVPN() {
|
func (w *OpenLANWorker) updateVPN() {
|
||||||
cfg, vpn := w.GetCfgs()
|
_, vpn := w.GetCfgs()
|
||||||
if vpn == nil {
|
if vpn == nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -47,7 +47,7 @@ func (w *OpenLANWorker) updateVPN() {
|
|||||||
routes := vpn.Routes
|
routes := vpn.Routes
|
||||||
routes = append(routes, vpn.Subnet)
|
routes = append(routes, vpn.Subnet)
|
||||||
if addr := w.Subnet(); addr != "" {
|
if addr := w.Subnet(); addr != "" {
|
||||||
libol.Info("OpenLANWorker.updateVPN %s subnet %s", cfg.Name, addr)
|
w.out.Info("OpenLANWorker.updateVPN subnet %s", addr)
|
||||||
routes = append(routes, addr)
|
routes = append(routes, addr)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -33,6 +33,7 @@ func (w *RouterWorker) updateVPN() {
|
|||||||
routes := vpn.Routes
|
routes := vpn.Routes
|
||||||
routes = append(routes, vpn.Subnet)
|
routes = append(routes, vpn.Subnet)
|
||||||
for _, sub := range spec.Subnets {
|
for _, sub := range spec.Subnets {
|
||||||
|
w.out.Info("RouterWorker.updateVPN subnet %s", sub.CIDR)
|
||||||
routes = append(routes, sub.CIDR)
|
routes = append(routes, sub.CIDR)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user