config

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2022 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewToBool

func NewToBool() schemas2.Mapper

func NewToMap

func NewToMap() schemas2.Mapper

func NewToSlice

func NewToSlice() schemas2.Mapper

func NewTypeConverter

func NewTypeConverter(fieldType string, converter Converter) schemas2.Mapper

func PrintInstall

func PrintInstall(cfg Config) ([]byte, error)

func ToBytes

func ToBytes(cfg Config) ([]byte, error)

func ToEnv

func ToEnv(cfg Config) ([]string, error)

ToEnv converts the config into a slice env. The configuration fields are prefixed with "_COS" to allow installation parameters to be set in the cos.sh script: e.g. https://github.com/rancher-sandbox/cOS-toolkit/blob/affc831b76d50298bbbbe637f31c81c52c5489b8/packages/backports/installer/cos.sh#L698

func ToFile

func ToFile(cfg Config, output string) error

Types

type Config

type Config struct {
	SSHAuthorizedKeys []string               `json:"ssh_authorized_keys,omitempty"`
	RancherOS         RancherOS              `json:"rancheros,omitempty"`
	Data              map[string]interface{} `json:"-"`
}

func ReadConfig

func ReadConfig(ctx context.Context, cfg string, includeCmdline bool) (result Config, err error)

type Converter

type Converter func(val interface{}) interface{}

type FuzzyNames

type FuzzyNames struct {
	mappers.DefaultMapper
	// contains filtered or unexported fields
}

func (*FuzzyNames) ModifySchema

func (f *FuzzyNames) ModifySchema(schema *schemas2.Schema, schemas *schemas2.Schemas) error

func (*FuzzyNames) ToInternal

func (f *FuzzyNames) ToInternal(data data.Object) error

type Install

type Install struct {
	Automatic          bool   `json:"automatic,omitempty"`
	Firmware           string `json:"firmware,omitempty"`
	Device             string `json:"device,omitempty"`
	ConfigURL          string `json:"configUrl,omitempty"`
	ISOURL             string `json:"isoUrl,omitempty"`
	ContainerImage     string `json:"containerImage,omitempty"`
	PowerOff           bool   `json:"powerOff,omitempty"`
	Reboot             bool   `json:"reboot,omitempty"`
	NoFormat           bool   `json:"noFormat,omitempty"`
	Debug              bool   `json:"debug,omitempty"`
	TTY                string `json:"tty,omitempty"`
	ServerURL          string `json:"-"`
	Token              string `json:"-"`
	Role               string `json:"-"`
	Password           string `json:"password,omitempty"`
	RegistrationURL    string `json:"registrationUrl,omitempty"`
	RegistrationCACert string `json:"registrationCaCert,omitempty"`
	EjectCD            bool   `json:"ejectCD,omitempty"`
}

type RancherOS

type RancherOS struct {
	Install Install `json:"install,omitempty"`
}

type Rancherd

type Rancherd struct {
	Server string `json:"server,omitempty"`
	Role   string `json:"role,omitempty"`
	Token  string `json:"token,omitempty"`
}

type Stage

type Stage struct {
	Users map[string]User `json:"users,omitempty"`
}

type User

type User struct {
	Name              string   `json:"name,omitempty"`
	PasswordHash      string   `json:"passwd,omitempty"`
	SSHAuthorizedKeys []string `json:"ssh_authorized_keys,omitempty"`
}

type YipConfig

type YipConfig struct {
	Stages   map[string][]Stage `json:"stages,omitempty"`
	Rancherd Rancherd           `json:"rancherd,omitempty"`
}

Jump to

Keyboard shortcuts

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