fix: cert not update

This commit is contained in:
Daniel Ding
2023-09-26 20:50:55 +08:00
parent b093aefd8c
commit 668788dc0d
4 changed files with 11 additions and 9 deletions

View File

@@ -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

View File

@@ -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)
} }
} }
} }

View File

@@ -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)
} }

View File

@@ -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)
} }