Skip to content

Commit

Permalink
Don't try to compile CPLB on darwin
Browse files Browse the repository at this point in the history
The unix build tag includes darwin, but CPLB only compiles on Linux. Use
the linux build tag for the implementation instead, and use the current
windows stub for anything that isn't linux.

Signed-off-by: Tom Wieczorek <[email protected]>
  • Loading branch information
twz123 committed Nov 13, 2024
1 parent d0915d1 commit 1cfc8ff
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
//go:build unix

/*
Copyright 2024 k0s authors
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build !linux

/*
Copyright 2024 k0s authors
Expand All @@ -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"
Expand All @@ -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)
}

0 comments on commit 1cfc8ff

Please sign in to comment.