feat: daemon not works well on Windows

This commit is contained in:
fengcaiwen
2023-09-14 22:02:59 +08:00
committed by naison
parent 9641e29d6e
commit 53b90fef76
25 changed files with 527 additions and 80 deletions

View File

@@ -13,7 +13,7 @@ import (
"github.com/wencaiwulue/kubevpn/pkg/util"
)
func Complete(route *core.Route) error {
func RentIPIfNeeded(route *core.Route) error {
if v, ok := os.LookupEnv(config.EnvInboundPodTunIPv4); ok && v == "" {
namespace := os.Getenv(config.EnvPodNamespace)
if namespace == "" {
@@ -60,7 +60,7 @@ func Complete(route *core.Route) error {
return nil
}
func Final() error {
func ReleaseIPIfNeeded() error {
namespace := os.Getenv(config.EnvPodNamespace)
url := fmt.Sprintf("https://%s:80%s", util.GetTlsDomain(namespace), config.APIReleaseIP)
req, err := http.NewRequest("DELETE", url, nil)