system

package
v1.14.0 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2018 License: Apache-2.0 Imports: 22 Imported by: 109

Documentation

Index

Constants

View Source
const DefaultIpv4Address = "127.0.0.1"

Variables

This section is empty.

Functions

func AuthorizeSSHKeys

func AuthorizeSSHKeys(user string, keysName string, keys []string) error

Add the provide SSH public key to the core user's list of authorized keys

func CreateUser

func CreateUser(u *config.User) error

func DefaultReadConfig added in v0.10.4

func DefaultReadConfig() (io.Reader, error)

func EnsureDirectoryExists

func EnsureDirectoryExists(dir string) error

func ExecuteScript

func ExecuteScript(scriptPath string) (string, error)

func Hostname

func Hostname() (string, error)

func MachineID

func MachineID(root string) string

func RestartNetwork added in v0.7.4

func RestartNetwork(interfaces []network.InterfaceGenerator) (err error)

func SetHostname

func SetHostname(hostname string) error

func SetUserPassword

func SetUserPassword(user, hash string) error

func UserExists

func UserExists(u *config.User) bool

func WriteEnvFile added in v0.8.8

func WriteEnvFile(ef *EnvFile, root string) error

WriteEnvFile updates an existing env `KEY=value` formated file with new values provided in EnvFile.Vars; File.Content is ignored. Existing ordering and any unknown formatting such as comments are preserved. If no changes are required the file is untouched.

func WriteFile

func WriteFile(f *File, root string) (string, error)

WriteFile writes given endecoded file to the filesystem

Types

type EnvFile added in v0.8.8

type EnvFile struct {
	Vars map[string]string
	// mask File.Content, it shouldn't be used.
	Content interface{} `json:"-" yaml:"-"`
	*File
}

type EtcHosts added in v0.10.4

type EtcHosts struct {
	config.EtcHosts
}

func (EtcHosts) File added in v0.10.4

func (eh EtcHosts) File() (*File, error)

type Etcd added in v0.10.4

type Etcd struct {
	config.Etcd
}

Etcd is a top-level structure which embeds its underlying configuration, config.Etcd, and provides the system-specific Unit().

func (Etcd) Units added in v0.10.4

func (ee Etcd) Units() []Unit

Units creates a Unit file drop-in for etcd, using any configured options.

type Etcd2 added in v1.4.0

type Etcd2 struct {
	config.Etcd2
}

Etcd2 is a top-level structure which embeds its underlying configuration, config.Etcd2, and provides the system-specific Unit().

func (Etcd2) Units added in v1.4.0

func (ee Etcd2) Units() []Unit

Units creates a Unit file drop-in for etcd, using any configured options.

type File

type File struct {
	config.File
}

File is a top-level structure which embeds its underlying configuration, config.File, and provides the system-specific Permissions().

func (*File) Permissions

func (f *File) Permissions() (os.FileMode, error)

type Flannel added in v0.11.1

type Flannel struct {
	config.Flannel
}

flannel is a top-level structure which embeds its underlying configuration, config.Flannel, and provides the system-specific Unit().

func (Flannel) File added in v1.1.0

func (fl Flannel) File() (*File, error)

type Fleet added in v0.10.4

type Fleet struct {
	config.Fleet
}

Fleet is a top-level structure which embeds its underlying configuration, config.Fleet, and provides the system-specific Unit().

func (Fleet) Units added in v0.10.4

func (fe Fleet) Units() []Unit

Units generates a Unit file drop-in for fleet, if any fleet options were configured in cloud-config

type Locksmith added in v1.0.2

type Locksmith struct {
	config.Locksmith
}

Locksmith is a top-level structure which embeds its underlying configuration, config.Locksmith, and provides the system-specific Unit().

func (Locksmith) Units added in v1.0.2

func (ee Locksmith) Units() []Unit

Units creates a Unit file drop-in for etcd, using any configured options.

type OEM added in v0.10.4

type OEM struct {
	config.OEM
}

OEM is a top-level structure which embeds its underlying configuration, config.OEM, and provides the system-specific File().

func (OEM) File added in v0.10.4

func (oem OEM) File() (*File, error)

type Unit

type Unit struct {
	config.Unit
}

Unit is a top-level structure which embeds its underlying configuration, config.Unit, and provides the system-specific Destination(), Type(), and Group().

func (Unit) Destination added in v0.7.5

func (u Unit) Destination(root string) string

Destination builds the appropriate absolute file path for the Unit. The root argument indicates the effective base directory of the system (similar to a chroot).

func (Unit) DropInDestination added in v1.0.0

func (u Unit) DropInDestination(root string, dropIn config.UnitDropIn) string

DropInDestination builds the appropriate absolute file path for the UnitDropIn. The root argument indicates the effective base directory of the system (similar to a chroot) and the dropIn argument is the UnitDropIn for which the destination is being calculated.

func (Unit) Group

func (u Unit) Group() string

Group returns "network" or "system" depending on whether or not the unit is a network unit or otherwise.

func (Unit) Type

func (u Unit) Type() string

Type returns the extension of the unit (everything that follows the final period).

type UnitManager added in v0.9.0

type UnitManager interface {
	PlaceUnit(unit Unit) error
	PlaceUnitDropIn(unit Unit, dropIn config.UnitDropIn) error
	EnableUnitFile(unit Unit) error
	RunUnitCommand(unit Unit, command string) (string, error)
	MaskUnit(unit Unit) error
	UnmaskUnit(unit Unit) error
	DaemonReload() error
}

func NewUnitManager added in v0.9.0

func NewUnitManager(root string) UnitManager

type Update added in v0.10.4

type Update struct {
	ReadConfig func() (io.Reader, error)
	config.Update
}

Update is a top-level structure which contains its underlying configuration, config.Update, a function for reading the configuration (the default implementation reading from the filesystem), and provides the system-specific File() and Unit().

func (Update) File added in v0.10.4

func (uc Update) File() (*File, error)

File generates an `/etc/coreos/update.conf` file (if any update configuration options are set in cloud-config) by either rewriting the existing file on disk, or starting from `/usr/share/coreos/update.conf`

func (Update) Units added in v0.10.4

func (uc Update) Units() []Unit

Units generates units for the cloud-init initializer to act on: - a locksmith Unit, if "reboot-strategy" was set in cloud-config - an update_engine Unit, if "group" or "server" was set in cloud-config

Jump to

Keyboard shortcuts

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