diff --git a/configurer/linux/flatcar.go b/configurer/linux/flatcar.go index c5192d48..44e4822a 100644 --- a/configurer/linux/flatcar.go +++ b/configurer/linux/flatcar.go @@ -30,7 +30,3 @@ func init() { func (l Flatcar) InstallPackage(h os.Host, pkg ...string) error { return errors.New("FlatcarContainerLinux does not support installing packages manually") } - -func (l Flatcar) K0sBinaryPath() string { - return "/opt/bin/k0s" -} diff --git a/configurer/linux/linux_test.go b/configurer/linux/linux_test.go index ac20b338..99ad79d7 100644 --- a/configurer/linux/linux_test.go +++ b/configurer/linux/linux_test.go @@ -6,6 +6,7 @@ import ( "github.com/k0sproject/k0sctl/configurer" "github.com/k0sproject/rig/exec" + "github.com/k0sproject/rig/os" "github.com/stretchr/testify/require" ) @@ -44,9 +45,19 @@ func (m mockHost) Sudo(string) (string, error) { return "", nil } -// TestPaths tests the slightly weird way to perform function overloading +type custompaths struct { + BaseLinux +} + +func (l custompaths) InstallPackage(_ os.Host, pkg ...string) error { + return nil +} +func (l custompaths) K0sBinaryPath() string { + return "/opt/bin/k0s" +} + func TestPaths(t *testing.T) { - fc := &Flatcar{} + fc := &custompaths{} fc.PathFuncs = interface{}(fc).(configurer.PathFuncs) ubuntu := &Ubuntu{}