mirror of
https://github.com/rancher/plugins.git
synced 2025-09-13 07:42:35 +00:00
Initial Windows port for K3s multi-exec binary (#7)
This commit is contained in:
committed by
Roberto Bonafiglia
parent
acb807c502
commit
e6ef086965
36
main_windows.go
Normal file
36
main_windows.go
Normal file
@@ -0,0 +1,36 @@
|
||||
//go:build windows
|
||||
// +build windows
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"github.com/docker/docker/pkg/reexec"
|
||||
|
||||
"github.com/containernetworking/cni/pkg/version"
|
||||
bv "github.com/containernetworking/plugins/pkg/utils/buildversion"
|
||||
hostlocal "github.com/containernetworking/plugins/plugins/ipam/host-local"
|
||||
"github.com/containernetworking/plugins/plugins/main/windows/win-bridge"
|
||||
"github.com/containernetworking/plugins/plugins/main/windows/win-overlay"
|
||||
"github.com/containernetworking/plugins/plugins/meta/flannel"
|
||||
)
|
||||
|
||||
func main() {
|
||||
os.Args[0] = filepath.Base(os.Args[0])
|
||||
reexec.Register("flannel", flannel.Main)
|
||||
reexec.Register("host-local", hostlocal.Main)
|
||||
reexec.Register("win-bridge", winbridge.Main)
|
||||
reexec.Register("win-overlay", winoverlay.Main)
|
||||
reexec.Register("flannel.exe", flannel.Main)
|
||||
reexec.Register("host-local.exe", hostlocal.Main)
|
||||
reexec.Register("win-bridge.exe", winbridge.Main)
|
||||
reexec.Register("win-overlay.exe", winoverlay.Main)
|
||||
if !reexec.Init() {
|
||||
_, _ = fmt.Fprintln(os.Stderr, bv.BuildString("plugins"))
|
||||
_, _ = fmt.Fprintf(os.Stderr, "CNI protocol versions supported: %s\n", strings.Join(version.All.SupportedVersions(), ", "))
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user