-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Support for FlatcarContainerLinux #221
Add Support for FlatcarContainerLinux #221
Conversation
You need to at least implement func (l FlatcarContainerLinux) InstallPackage(h os.Host, pkg ...string) error {
return h.Execf("SOME_COMMAND_TO_INSTALL_PACKAGES_HERE %s", strings.Join(pkg, " "), exec.Sudo(h))
} |
@kke Ok, OS detection works and |
Hmm. I'm not entirely sure why the I think it should cause a compilation error if there are ambiguous functions 🤔 It may be required that the package linux
type writableUSR struct {}
func (w writableUSR) K0sBinaryPath() string {
return "/usr/local/bin/k0s"
} and then embedding that to all the other linuxes: type Debian struct {
linux.Ubuntu
configurer.Linux
writableUSR
} |
Using a dedicated interface enables distro-specific structs to 'override' functions returning string constants such as config folders or paths.
@kke I solved the problem by using a dedicated interface for functions returning a static string such as the K0S Binary Path. The MR now consists of three logical commits:
It works now as intended. 🎉 |
Shaping up nicely, some wizardry going on, need to tinker it with a bit myself before yanking the lever :) |
I have just changed the default path for flatcar to |
@kke Did you already found time to check the changes? It would be great to use the official k0sctl binaries for my deployments. |
Sorry, not yet, trying to look into it asap. |
It's a pretty clever way to override the functions 🤔 |
@kke Okay, let me update the PR to include bespoked ideas. :) |
@kke Updated. 🚀 |
Fixes #189.