plugins

package
v0.0.0-...-d19b8bf Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2023 License: Apache-2.0 Imports: 50 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Commands

func Commands(l logger.Interface, s schema.Stage, fs vfs.FS, console Console) error

func DNS

func DNS(l logger.Interface, s schema.Stage, fs vfs.FS, console Console) error

func DataSources

func DataSources(l logger.Interface, s schema.Stage, fs vfs.FS, console Console) error

func DecodeMultipartVmware

func DecodeMultipartVmware(data []byte) []byte

DecodeMultipartVmware will try to decode the user-data from VMWARE provider as it returns a multipart/mixed data instead of the simple cloud-config

func DeleteEntities

func DeleteEntities(l logger.Interface, s schema.Stage, fs vfs.FS, console Console) error

func Download

func Download(l logger.Interface, s schema.Stage, fs vfs.FS, console Console) error

func EnsureDirectories

func EnsureDirectories(l logger.Interface, s schema.Stage, fs vfs.FS, console Console) error

func EnsureFiles

func EnsureFiles(l logger.Interface, s schema.Stage, fs vfs.FS, console Console) error

func Entities

func Entities(l logger.Interface, s schema.Stage, fs vfs.FS, console Console) error

func Environment

func Environment(l logger.Interface, s schema.Stage, fs vfs.FS, console Console) error

func Git

func Git(l logger.Interface, s schema.Stage, fs vfs.FS, console Console) error

func Hostname

func Hostname(l logger.Interface, s schema.Stage, fs vfs.FS, console Console) error

func IfConditional

func IfConditional(l logger.Interface, s schema.Stage, fs vfs.FS, console Console) error

func Layout

func Layout(l logger.Interface, s schema.Stage, fs vfs.FS, console Console) error

func LoadModules

func LoadModules(l logger.Interface, s schema.Stage, fs vfs.FS, console Console) error

func MatchPartitionFSLabel

func MatchPartitionFSLabel(l logger.Interface, label string, console Console) string

func MatchPartitionPLabel

func MatchPartitionPLabel(l logger.Interface, label string, console Console) string

func MiBToSectors

func MiBToSectors(size uint, sectorSize uint) uint

func NodeConditional

func NodeConditional(l logger.Interface, s schema.Stage, fs vfs.FS, console Console) error

func SSH

func SSH(l logger.Interface, s schema.Stage, fs vfs.FS, console Console) error

func Sysctl

func Sysctl(l logger.Interface, s schema.Stage, fs vfs.FS, console Console) error

func SystemHostname

func SystemHostname(hostname string, fs vfs.FS) error

func Systemctl

func Systemctl(l logger.Interface, s schema.Stage, fs vfs.FS, console Console) error

func SystemdFirstboot

func SystemdFirstboot(l logger.Interface, s schema.Stage, fs vfs.FS, console Console) error

func Timesyncd

func Timesyncd(l logger.Interface, s schema.Stage, fs vfs.FS, console Console) error

func UpdateHostsFile

func UpdateHostsFile(hostname string, fs vfs.FS) error

func User

func User(l logger.Interface, s schema.Stage, fs vfs.FS, console Console) error

Types

type Console

type Console interface {
	Run(string, ...func(*exec.Cmd)) (string, error)
	Start(*exec.Cmd, ...func(*exec.Cmd)) error
	RunTemplate([]string, string) error
}

type Disk

type Disk struct {
	Device  string
	SectorS uint
	LastS   uint
	Parts   []Partition
}

func FindDiskFromPartitionLabel

func FindDiskFromPartitionLabel(l logger.Interface, label string, console Console) (Disk, error)

func FindDiskFromPath

func FindDiskFromPath(path string, console Console) (Disk, error)

func (*Disk) AddPartition

func (dev *Disk) AddPartition(l logger.Interface, label string, size uint, fileSystem string, pLabel string, console Console) (string, error)

Size is expressed in MiB here

func (*Disk) CheckDiskFreeSpaceMiB

func (dev *Disk) CheckDiskFreeSpaceMiB(l logger.Interface, minSpace uint, console Console) bool

Size is expressed in MiB here

func (*Disk) ExpandLastPartition

func (dev *Disk) ExpandLastPartition(l logger.Interface, size uint, console Console) (string, error)

ExpandLastPartition will call growpart + resize tool in a given partition to grow it up to max space available

func (Disk) FindPartitionDevice

func (dev Disk) FindPartitionDevice(l logger.Interface, partNum int, console Console) (string, error)

func (*Disk) GetFreeSpace

func (dev *Disk) GetFreeSpace(l logger.Interface, console Console) (uint, error)

func (*Disk) Reload

func (dev *Disk) Reload(console Console) error

func (Disk) ReloadPartitionTable

func (dev Disk) ReloadPartitionTable(l logger.Interface, console Console) error

func (Disk) String

func (dev Disk) String() string

type GdiskCall

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

func NewGdiskCall

func NewGdiskCall(dev string) *GdiskCall

func (*GdiskCall) CreatePartition

func (gd *GdiskCall) CreatePartition(p *Partition)

func (*GdiskCall) DeletePartition

func (gd *GdiskCall) DeletePartition(num int)

func (*GdiskCall) ExpandPTable

func (gd *GdiskCall) ExpandPTable()

func (GdiskCall) GetLastSector

func (gd GdiskCall) GetLastSector(printOut string) (uint, error)

Parses the output of a GdiskCall.Print call

func (GdiskCall) GetPartitionData

func (gd GdiskCall) GetPartitionData(partNum int, console Console) (*Partition, error)

func (GdiskCall) GetPartitions

func (gd GdiskCall) GetPartitions(printOut string) []Partition

Parses the output of a GdiskCall.Print call

func (GdiskCall) GetSectorSize

func (gd GdiskCall) GetSectorSize(printOut string) (uint, error)

Parses the output of a GdiskCall.Print call There was a change in the output of sgdisk in version 1.0.2 https://www.rodsbooks.com/gdisk/revisions.html We are trying to match both possible outputs

func (GdiskCall) HasUnallocatedSpace

func (gd GdiskCall) HasUnallocatedSpace(console Console) bool

func (GdiskCall) Info

func (gd GdiskCall) Info(partNum int, console Console) (string, error)

func (GdiskCall) Print

func (gd GdiskCall) Print(console Console) (string, error)

func (*GdiskCall) SetPretend

func (gd *GdiskCall) SetPretend(pretend bool)

func (GdiskCall) Verify

func (gd GdiskCall) Verify(console Console) (string, error)

func (*GdiskCall) WipeTable

func (gd *GdiskCall) WipeTable(wipe bool)

func (*GdiskCall) WriteChanges

func (gd *GdiskCall) WriteChanges(console Console) (string, error)

type MkfsCall

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

func (MkfsCall) Apply

func (mkfs MkfsCall) Apply(console Console) (string, error)

type Partition

type Partition struct {
	Number     int
	StartS     uint
	SizeS      uint
	PLabel     string
	FileSystem string
	FSLabel    string
	Type       string
}

We only manage sizes in sectors unit for the Partition struct and sgdisk wrapper

Jump to

Keyboard shortcuts

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