|
| 1 | +package configurer |
| 2 | + |
| 3 | +import ( |
| 4 | + "time" |
| 5 | + |
| 6 | + "github.com/k0sproject/rig/exec" |
| 7 | + "github.com/k0sproject/rig/os" |
| 8 | +) |
| 9 | + |
| 10 | +// Configurer defines the per-host operations required for managing a host. |
| 11 | +type Configurer interface { |
| 12 | + Kind() string |
| 13 | + OSKind() string |
| 14 | + CheckPrivilege(os.Host) error |
| 15 | + StartService(os.Host, string) error |
| 16 | + StopService(os.Host, string) error |
| 17 | + RestartService(os.Host, string) error |
| 18 | + ServiceIsRunning(os.Host, string) bool |
| 19 | + Arch(os.Host) (string, error) |
| 20 | + K0sCmdf(string, ...interface{}) string |
| 21 | + K0sBinaryPath() string |
| 22 | + K0sConfigPath() string |
| 23 | + DataDirDefaultPath() string |
| 24 | + K0sJoinTokenPath() string |
| 25 | + WriteFile(os.Host, string, string, string) error |
| 26 | + UpdateEnvironment(os.Host, map[string]string) error |
| 27 | + DaemonReload(os.Host) error |
| 28 | + ReplaceK0sTokenPath(os.Host, string) error |
| 29 | + ServiceScriptPath(os.Host, string) (string, error) |
| 30 | + ReadFile(os.Host, string) (string, error) |
| 31 | + FileExist(os.Host, string) bool |
| 32 | + Chmod(os.Host, string, string, ...exec.Option) error |
| 33 | + Chown(os.Host, string, string, ...exec.Option) error |
| 34 | + DownloadURL(os.Host, string, string, ...exec.Option) error |
| 35 | + InstallPackage(os.Host, ...string) error |
| 36 | + FileContains(os.Host, string, string) bool |
| 37 | + MoveFile(os.Host, string, string) error |
| 38 | + MkDir(os.Host, string, ...exec.Option) error |
| 39 | + DeleteFile(os.Host, string) error |
| 40 | + CommandExist(os.Host, string) bool |
| 41 | + Hostname(os.Host) string |
| 42 | + KubectlCmdf(os.Host, string, string, ...interface{}) string |
| 43 | + KubeconfigPath(os.Host, string) string |
| 44 | + IsContainer(os.Host) bool |
| 45 | + FixContainer(os.Host) error |
| 46 | + HTTPStatus(os.Host, string) (int, error) |
| 47 | + PrivateInterface(os.Host) (string, error) |
| 48 | + PrivateAddress(os.Host, string, string) (string, error) |
| 49 | + TempDir(os.Host) (string, error) |
| 50 | + TempFile(os.Host) (string, error) |
| 51 | + UpdateServiceEnvironment(os.Host, string, map[string]string) error |
| 52 | + CleanupServiceEnvironment(os.Host, string) error |
| 53 | + Stat(os.Host, string, ...exec.Option) (*os.FileInfo, error) |
| 54 | + DeleteDir(os.Host, string, ...exec.Option) error |
| 55 | + K0sctlLockFilePath(os.Host) string |
| 56 | + UpsertFile(os.Host, string, string) error |
| 57 | + MachineID(os.Host) (string, error) |
| 58 | + SetPath(string, string) |
| 59 | + SystemTime(os.Host) (time.Time, error) |
| 60 | + Touch(os.Host, string, time.Time, ...exec.Option) error |
| 61 | +} |
0 commit comments