-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* supportos: fedora and rhel coreOS * fix: add errors import to configurer/linux/coreos
- Loading branch information
1 parent
8eda284
commit 0cbfc47
Showing
3 changed files
with
41 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package linux | ||
|
||
import ( | ||
"errors" | ||
"github.com/k0sproject/k0sctl/configurer" | ||
"github.com/k0sproject/rig" | ||
"github.com/k0sproject/rig/os" | ||
"github.com/k0sproject/rig/os/registry" | ||
"strings" | ||
) | ||
|
||
// CoreOS provides OS support for ostree based Fedora & RHEL systems | ||
type CoreOS struct { | ||
os.Linux | ||
BaseLinux | ||
} | ||
|
||
func init() { | ||
registry.RegisterOSModule( | ||
func(os rig.OSVersion) bool { | ||
return os.ID == "fedora" && strings.Contains(os.Name, "CoreOS") || os.ID == "rhel" && strings.Contains(os.Name, "CoreOS") | ||
}, | ||
func() interface{} { | ||
linuxType := &CoreOS{} | ||
linuxType.PathFuncs = interface{}(linuxType).(configurer.PathFuncs) | ||
return linuxType | ||
}, | ||
) | ||
} | ||
|
||
func (l CoreOS) InstallPackage(h os.Host, pkg ...string) error { | ||
return errors.New("CoreOS does not support installing packages manually") | ||
} | ||
|
||
func (l CoreOS) K0sBinaryPath() string { | ||
return "/opt/bin/k0s" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters