vmspec

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultServices = []string{"chrony", "ssh"}

Functions

func ValidateServices

func ValidateServices(services []string) error

Types

type EBSVolumeSource

type EBSVolumeSource struct {
	Attach bool   `json:"attach,omitempty"`
	Device string `json:"device,omitempty"`
	FSType string `json:"fs-type,omitempty"`
	MakeFS bool   `json:"make-fs,omitempty"`
	Mount  Mount  `json:"mount,omitempty"`
}

type EnvFrom

type EnvFrom struct {
	Prefix         string                   `json:"prefix,omitempty"`
	S3             *S3EnvSource             `json:"s3,omitempty"`
	SecretsManager *SecretsManagerEnvSource `json:"secrets-manager,omitempty"`
	SSM            *SSMEnvSource            `json:"ssm,omitempty"`
}

func (*EnvFrom) Validate

func (e *EnvFrom) Validate() error

type EnvFromSource

type EnvFromSource []EnvFrom

type Mount

type Mount struct {
	Destination string   `json:"destination,omitempty"`
	GroupID     *int     `json:"group-id,omitempty"`
	Mode        string   `json:"mode,omitempty"`
	Options     []string `json:"options,omitempty"`
	UserID      *int     `json:"user-id,omitempty"`
}

type NameValue

type NameValue struct {
	Name  string `json:"name,omitempty"`
	Value string `json:"value,omitempty"`
}

type NameValueSource

type NameValueSource []NameValue

func (NameValueSource) Find

func (n NameValueSource) Find(key string) (string, int)

Find returns the value of the item at key with its index, or -1 if not found.

func (NameValueSource) ToStrings

func (n NameValueSource) ToStrings() []string

type S3EnvSource

type S3EnvSource struct {
	Base64Encode bool   `json:"base64-encode,omitempty"`
	Bucket       string `json:"bucket,omitempty"`
	Key          string `json:"key,omitempty"`
	Name         string `json:"name,omitempty"`
	Optional     bool   `json:"optional,omitempty"`
}

type S3VolumeSource

type S3VolumeSource struct {
	Bucket    string `json:"bucket,omitempty"`
	KeyPrefix string `json:"key-prefix,omitempty"`
	Mount     Mount  `json:"mount,omitempty"`
	Optional  bool   `json:"optional,omitempty"`
}

type SSHD

type SSHD struct {
	Enable bool `json:"enable,omitempty"`
}

type SSMEnvSource

type SSMEnvSource struct {
	Base64Encode bool   `json:"base64-encode,omitempty"`
	Name         string `json:"name,omitempty"`
	Optional     bool   `json:"optional,omitempty"`
	Path         string `json:"path,omitempty"`
}

type SSMVolumeSource

type SSMVolumeSource struct {
	Mount    Mount  `json:"mount,omitempty"`
	Optional bool   `json:"optional,omitempty"`
	Path     string `json:"path,omitempty"`
}

type SecretsManagerEnvSource

type SecretsManagerEnvSource struct {
	Base64Encode bool   `json:"base64-encode,omitempty"`
	Name         string `json:"name,omitempty"`
	Optional     bool   `json:"optional,omitempty"`
	SecretID     string `json:"secret-id,omitempty"`
}

type SecretsManagerVolumeSource

type SecretsManagerVolumeSource struct {
	Mount    Mount  `json:"mount,omitempty"`
	SecretID string `json:"secret-id,omitempty"`
	Optional bool   `json:"optional,omitempty"`
}

type SecurityContext

type SecurityContext struct {
	ReadonlyRootFS bool `json:"readonly-root-fs,omitempty"`
	RunAsGroupID   *int `json:"run-as-group-id,omitempty"`
	RunAsUserID    *int `json:"run-as-user-id,omitempty"`
	SSHD           SSHD `json:"sshd,omitempty"`
}

type VMSpec

type VMSpec struct {
	Args                []string        `json:"args,omitempty"`
	Command             []string        `json:"command,omitempty"`
	Debug               bool            `json:"debug,omitempty"`
	DisableServices     []string        `json:"disable-services,omitempty"`
	Env                 NameValueSource `json:"env,omitempty"`
	EnvFrom             EnvFromSource   `json:"env-from,omitempty"`
	InitScripts         []string        `json:"init-scripts,omitempty"`
	ReplaceInit         bool            `json:"replace-init,omitempty"`
	Security            SecurityContext `json:"security,omitempty"`
	ShutdownGracePeriod int             `json:"shutdown-grace-period,omitempty"`
	Sysctls             NameValueSource `json:"sysctls,omitempty"`
	Volumes             Volumes         `json:"volumes,omitempty"`
	WorkingDir          string          `json:"working-dir,omitempty"`
}

func (*VMSpec) Merge

func (v *VMSpec) Merge(other *VMSpec) error

func (*VMSpec) SetDefaults

func (v *VMSpec) SetDefaults()

func (*VMSpec) Validate

func (v *VMSpec) Validate() error

type Volume

type Volume struct {
	EBS            *EBSVolumeSource            `json:"ebs,omitempty"`
	SecretsManager *SecretsManagerVolumeSource `json:"secrets-manager,omitempty"`
	SSM            *SSMVolumeSource            `json:"ssm,omitempty"`
	S3             *S3VolumeSource             `json:"s3,omitempty"`
}

func (*Volume) Validate

func (v *Volume) Validate() error

type Volumes

type Volumes []Volume

func (Volumes) MountPoints

func (v Volumes) MountPoints() []string

Jump to

Keyboard shortcuts

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