config

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: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsCloudConfig

func IsCloudConfig(userdata string) bool

Types

type CloudConfig

type CloudConfig struct {
	SSHAuthorizedKeys []string `yaml:"ssh_authorized_keys,omitempty"`
	WriteFiles        []File   `yaml:"write_files,omitempty"`
	Hostname          string   `yaml:"hostname,omitempty"`
	Users             []User   `yaml:"users,omitempty"`
	RunCmd            []string `yaml:"runcmd,omitempty"`

	Partitioning GrowPart `yaml:"growpart"`
	// this one is legacy, can be removed when no more kip controllers use it
	MilpaFiles []File `yaml:"milpa_files,omitempty"`
}

CloudConfig encapsulates the entire cloud-config configuration file and maps directly to YAML. Fields that cannot be set in the cloud-config (fields used for internal use) have the YAML tag '-' so that they aren't marshalled.

func NewCloudConfig

func NewCloudConfig(contents string) (*CloudConfig, error)

NewCloudConfig instantiates a new CloudConfig from the given contents (a string of YAML), returning any error encountered. It will ignore unknown fields but log encountering them.

type File

type File struct {
	Encoding           string `yaml:"encoding,omitempty" valid:"^(base64|b64|gz|gzip|gz\\+base64|gzip\\+base64|gz\\+b64|gzip\\+b64)$"`
	Content            string `yaml:"content,omitempty"`
	Owner              string `yaml:"owner,omitempty"`
	Path               string `yaml:"path,omitempty"`
	RawFilePermissions string `yaml:"permissions,omitempty" valid:"^0?[0-7]{3,4}$"`
}

type GrowPart

type GrowPart struct {
	Mode    string   `yaml:"mode,omitempty"`
	Devices []string `yaml:"devices"`
}

type User

type User struct {
	Name                 string   `yaml:"name,omitempty"`
	PasswordHash         string   `yaml:"passwd,omitempty"`
	SSHAuthorizedKeys    []string `yaml:"ssh_authorized_keys,omitempty"`
	SSHImportGithubUser  string   `` /* 139-byte string literal not displayed */
	SSHImportGithubUsers []string `` /* 139-byte string literal not displayed */
	SSHImportURL         string   `` /* 139-byte string literal not displayed */
	GECOS                string   `yaml:"gecos,omitempty"`
	Homedir              string   `yaml:"homedir,omitempty"`
	NoCreateHome         bool     `yaml:"no_create_home,omitempty"`
	PrimaryGroup         string   `yaml:"primary_group,omitempty"`
	Groups               []string `yaml:"groups,omitempty"`
	NoUserGroup          bool     `yaml:"no_user_group,omitempty"`
	System               bool     `yaml:"system,omitempty"`
	NoLogInit            bool     `yaml:"no_log_init,omitempty"`
	Shell                string   `yaml:"shell,omitempty"`
	LockPasswd           bool     `yaml:"lock_passwd"`
	UID                  string   `yaml:"uid"`
}

Jump to

Keyboard shortcuts

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