mirror of
https://github.com/kubenetworks/kubevpn.git
synced 2025-10-04 15:03:01 +08:00
hotfix: fix bugs (#468)
This commit is contained in:
@@ -756,7 +756,7 @@ func (c *ConnectOptions) getCIDR(ctx context.Context, m *dhcp.Manager) (err erro
|
|||||||
}
|
}
|
||||||
if len(c.cidrs) != 0 {
|
if len(c.cidrs) != 0 {
|
||||||
log.Infoln("Got network CIDR from cache")
|
log.Infoln("Got network CIDR from cache")
|
||||||
return
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -773,12 +773,12 @@ func (c *ConnectOptions) getCIDR(ctx context.Context, m *dhcp.Manager) (err erro
|
|||||||
}
|
}
|
||||||
c.cidrs = util.RemoveLargerOverlappingCIDRs(append(c.cidrs, cidrs...))
|
c.cidrs = util.RemoveLargerOverlappingCIDRs(append(c.cidrs, cidrs...))
|
||||||
_ = m.Set(ctx, config.KeyClusterIPv4POOLS, strings.Join(s.UnsortedList(), " "))
|
_ = m.Set(ctx, config.KeyClusterIPv4POOLS, strings.Join(s.UnsortedList(), " "))
|
||||||
return
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// (3) fallback to get cidr from node/pod/service
|
// (3) fallback to get cidr from node/pod/service
|
||||||
c.cidrs = util.GetCIDRFromResourceUgly(ctx, c.clientset, c.Namespace)
|
c.cidrs = util.GetCIDRFromResourceUgly(ctx, c.clientset, c.Namespace)
|
||||||
return
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *ConnectOptions) removeCIDRsContainingIPs(ipList []net.IP) {
|
func (c *ConnectOptions) removeCIDRsContainingIPs(ipList []net.IP) {
|
||||||
@@ -950,6 +950,9 @@ func (c *ConnectOptions) upgradeDeploy(ctx context.Context) error {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if len(spec.ImagePullSecrets) == 0 {
|
||||||
|
spec.ImagePullSecrets = nil
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@@ -481,12 +481,14 @@ kubevpn serve -L "tcp://:10800" -L "tun://:8422?net=${TunIPv4}" -L "gtcp://:1080
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
RestartPolicy: v1.RestartPolicyAlways,
|
RestartPolicy: v1.RestartPolicyAlways,
|
||||||
ImagePullSecrets: []v1.LocalObjectReference{{
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
if imagePullSecretName != "" {
|
||||||
|
deploy.Spec.Template.Spec.ImagePullSecrets = []v1.LocalObjectReference{{
|
||||||
Name: imagePullSecretName,
|
Name: imagePullSecretName,
|
||||||
}},
|
}}
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
return deploy
|
return deploy
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user