INNER CODE UNIT · Go

NewRebooter

kubereboot/kured · internal/validators.go:18

func NewRebooter(rebootMethod string, rebootCommand string, rebootSignal int) (reboot.Rebooter, error) {
	switch rebootMethod {
	case "command":
		log.Infof("Reboot command: %s", rebootCommand)
		return reboot.NewCommandRebooter(rebootCommand)
	case "signal":
		log.Infof("Reboot signal: %d", rebootSignal)
		return reboot.NewSignalRebooter(rebootSignal)
	default:
		return nil, fmt.Errorf("invalid reboot-method configured %s, expected signal or command", rebootMethod)
	}
}

// NewRebootChecker validates the rebootSentinelCommand, rebootSentinelFile input,
// then chains to the right constructor.
func NewRebootChecker(rebootSentinelCommand string, rebootSentinelFile string) (checkers.Checker, error) {
	// An override of rebootSentinelCommand means a privileged command
	if rebootSentinelCommand != "" {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…