diff --git a/pkg/component/controller/cplb_unix.go b/pkg/component/controller/cplb_linux.go similarity index 99% rename from pkg/component/controller/cplb_unix.go rename to pkg/component/controller/cplb_linux.go index 6d14cfdfeb4f..ec6751829996 100644 --- a/pkg/component/controller/cplb_unix.go +++ b/pkg/component/controller/cplb_linux.go @@ -1,5 +1,3 @@ -//go:build unix - /* Copyright 2024 k0s authors diff --git a/pkg/component/controller/cplb_windows.go b/pkg/component/controller/cplb_other.go similarity index 72% rename from pkg/component/controller/cplb_windows.go rename to pkg/component/controller/cplb_other.go index 93f023251030..48698989424f 100644 --- a/pkg/component/controller/cplb_windows.go +++ b/pkg/component/controller/cplb_other.go @@ -1,3 +1,5 @@ +//go:build !linux + /* Copyright 2024 k0s authors @@ -19,6 +21,8 @@ package controller import ( "context" "errors" + "fmt" + "runtime" k0sAPI "github.com/k0sproject/k0s/pkg/apis/k0s/v1beta1" "github.com/k0sproject/k0s/pkg/config" @@ -35,14 +39,14 @@ type Keepalived struct { KubeConfigPath string } -func (k *Keepalived) Init(_ context.Context) error { - return errors.New("CPLB is not supported on Windows") +func (k *Keepalived) Init(context.Context) error { + return fmt.Errorf("%w: CPLB is not supported on %s", errors.ErrUnsupported, runtime.GOOS) } -func (k *Keepalived) Start(_ context.Context) error { - return errors.New("CPLB is not supported on Windows") +func (k *Keepalived) Start(context.Context) error { + return fmt.Errorf("%w: CPLB is not supported on %s", errors.ErrUnsupported, runtime.GOOS) } func (k *Keepalived) Stop() error { - return errors.New("CPLB is not supported on Windows") + return fmt.Errorf("%w: CPLB is not supported on %s", errors.ErrUnsupported, runtime.GOOS) }