diff --git a/app/cni/pkg/cni/annotations.go b/app/cni/pkg/cni/annotations_linux.go similarity index 100% rename from app/cni/pkg/cni/annotations.go rename to app/cni/pkg/cni/annotations_linux.go diff --git a/app/cni/pkg/cni/annotations_test.go b/app/cni/pkg/cni/annotations_linux_test.go similarity index 100% rename from app/cni/pkg/cni/annotations_test.go rename to app/cni/pkg/cni/annotations_linux_test.go diff --git a/app/cni/pkg/cni/injector_darwin.go b/app/cni/pkg/cni/injector_darwin.go deleted file mode 100644 index 1c3c629785f4..000000000000 --- a/app/cni/pkg/cni/injector_darwin.go +++ /dev/null @@ -1,11 +0,0 @@ -package cni - -import ( - "errors" - - "github.com/go-logr/logr" -) - -func Inject(netns string, logger logr.Logger, intermediateConfig *IntermediateConfig) error { - return errors.New("only implemented on linux") -} diff --git a/app/cni/pkg/cni/injector_windows.go b/app/cni/pkg/cni/injector_windows.go deleted file mode 100644 index 1c3c629785f4..000000000000 --- a/app/cni/pkg/cni/injector_windows.go +++ /dev/null @@ -1,11 +0,0 @@ -package cni - -import ( - "errors" - - "github.com/go-logr/logr" -) - -func Inject(netns string, logger logr.Logger, intermediateConfig *IntermediateConfig) error { - return errors.New("only implemented on linux") -} diff --git a/app/cni/pkg/cni/kubernetes.go b/app/cni/pkg/cni/kubernetes_linux.go similarity index 100% rename from app/cni/pkg/cni/kubernetes.go rename to app/cni/pkg/cni/kubernetes_linux.go diff --git a/app/cni/pkg/cni/main_darwin.go b/app/cni/pkg/cni/main_darwin.go new file mode 100644 index 000000000000..32e5840d41ec --- /dev/null +++ b/app/cni/pkg/cni/main_darwin.go @@ -0,0 +1,5 @@ +package cni + +func Run() { + panic("CNI not supported on Darwin") +} diff --git a/app/cni/pkg/cni/main.go b/app/cni/pkg/cni/main_linux.go similarity index 100% rename from app/cni/pkg/cni/main.go rename to app/cni/pkg/cni/main_linux.go diff --git a/app/cni/pkg/cni/main_test.go b/app/cni/pkg/cni/main_linux_test.go similarity index 100% rename from app/cni/pkg/cni/main_test.go rename to app/cni/pkg/cni/main_linux_test.go diff --git a/app/cni/pkg/cni/main_windows.go b/app/cni/pkg/cni/main_windows.go new file mode 100644 index 000000000000..0f1726ba4c45 --- /dev/null +++ b/app/cni/pkg/cni/main_windows.go @@ -0,0 +1,5 @@ +package cni + +func Run() { + panic("CNI not supported on Windows") +}