system

package
v1.5.3 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2019 License: Apache-2.0, Apache-2.0 Imports: 18 Imported by: 0

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

AuthorizeSSHKeys adds the provided SSH public key to the core user's list of authorized keys

func CreateUser

func CreateUser(u *config.User) error

func DefaultReadConfig

func DefaultReadConfig() (io.Reader, error)

func EnsureDirectoryExists

func EnsureDirectoryExists(dir string) error

func SetUserPassword

func SetUserPassword(user, hash string) error

func UserExists

func UserExists(u *config.User) bool

func WriteEnvFile

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

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

type EtcHosts

type EtcHosts struct {
	config.EtcHosts
}

func (EtcHosts) File

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

type Etcd

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

func (ee Etcd) Units() []Unit

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

type Etcd2

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

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

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

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

type Fleet

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

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

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

func (ee Locksmith) Units() []Unit

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

type OEM

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

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

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

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

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
}

type Update

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

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

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