precheck

package
v0.0.0-...-fa603ae Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 18, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckRoot

func CheckRoot() error

CheckRoot returns an error if the process's runtime user isn't root.

Types

type Check

type Check interface {
	// GetName returns the name of the precheck step; this is shown to the user.
	GetName() string

	// Run executes the precheck step.
	Run() (*Report, error)
}

Check represents a single precheck step.

func NewDisksCheck

func NewDisksCheck() Check

NewDisksCheck instantiates a DisksCheck instance.

type DisksCheck

type DisksCheck struct {
	// contains filtered or unexported fields
}

DisksCheck performs disk configuration checking:

  • finding the root filesystem partition
  • checking if the device is MBR
  • checking whether the root mount is physically located on a single disk. The check fails, for example, when the root mount is on an LVM logical volume that spans multiple disks.
  • check for GRUB
  • warning for any mount points from partitions from other devices

func (*DisksCheck) GetName

func (c *DisksCheck) GetName() string

GetName returns the name of the precheck step; this is shown to the user.

func (*DisksCheck) Run

func (c *DisksCheck) Run() (r *Report, err error)

Run executes the precheck step.

type OSVersionCheck

type OSVersionCheck struct {
	OSInfo *osinfo.OSInfo
}

OSVersionCheck is a precheck.Check that verifies the disk's operating system is importable.

func (*OSVersionCheck) GetName

func (c *OSVersionCheck) GetName() string

GetName returns the name of the precheck step; this is shown to the user.

func (*OSVersionCheck) Run

func (c *OSVersionCheck) Run() (*Report, error)

Run executes the precheck step.

type PowershellCheck

type PowershellCheck struct{}

PowershellCheck is a precheck.Check that verifies Powershell is installed, and that its version is sufficient to perform translation.

func (*PowershellCheck) GetName

func (c *PowershellCheck) GetName() string

GetName returns the name of the precheck step; this is shown to the user.

func (*PowershellCheck) Run

func (c *PowershellCheck) Run() (*Report, error)

Run executes the precheck step.

type Report

type Report struct {
	// contains filtered or unexported fields
}

Report contains the results of running one or more precheck steps.

func (*Report) Failed

func (r *Report) Failed() bool

Failed returns whether one or more precheck steps failed.

func (*Report) Fatal

func (r *Report) Fatal(s string)

Fatal messages indicate that the system is not importable.

func (*Report) Info

func (r *Report) Info(s string)

Info messages are informational and shown to the user.

func (*Report) String

func (r *Report) String() string

func (*Report) Warn

func (r *Report) Warn(s string)

Warn messages indicate that the user should perform a manual check.

type Result

type Result int

Result indicates the result of the check.

const (
	// Passed means the check passed.
	Passed Result = iota

	// Failed means the check ran and found an error such that
	// the machine is not importable.
	Failed

	// Skipped means the check didn't run.
	Skipped

	// Unknown means the test couldn't run, and that the user
	// should run a manual verification.
	Unknown
)

func (Result) String

func (r Result) String() string

type SHA2DriverSigningCheck

type SHA2DriverSigningCheck struct {
	OSInfo *osinfo.OSInfo
}

SHA2DriverSigningCheck is a precheck.Check that confirms a Windows 2008 system has KB4474419 installed.

func (*SHA2DriverSigningCheck) GetName

func (s *SHA2DriverSigningCheck) GetName() string

GetName returns the name of the precheck step; this is shown to the user.

func (*SHA2DriverSigningCheck) Run

func (s *SHA2DriverSigningCheck) Run() (*Report, error)

Run executes the precheck step.

type SSHCheck

type SSHCheck struct{}

SSHCheck is a precheck.Check that confirms that port 22 is open and that the SSH server daemon is running.

func (*SSHCheck) GetName

func (c *SSHCheck) GetName() string

GetName returns the name of the precheck step; this is shown to the user.

func (*SSHCheck) Run

func (c *SSHCheck) Run() (*Report, error)

Run executes the precheck step.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL