Documentation
¶
Index ¶
- Constants
- Variables
- func Convert(x, y any, comment string) error
- func ExistingLimaVersion(instDir string) string
- func FillCopyToHostDefaults(rule *limatype.CopyToHost, instDir string, user limatype.User, ...)
- func FillDefault(ctx context.Context, y, d, o *limatype.LimaYAML, filePath string, warn bool)
- func FillPortForwardDefaults(rule *limatype.PortForward, instDir string, user limatype.User, ...)
- func FirstUsernetIndex(l *limatype.LimaYAML) int
- func IsExistingInstanceDir(dir string) bool
- func IsNativeArch(arch limatype.Arch) bool
- func Load(ctx context.Context, b []byte, filePath string) (*limatype.LimaYAML, error)
- func LoadWithWarnings(ctx context.Context, b []byte, filePath string) (*limatype.LimaYAML, error)
- func MACAddress(uniqueID string) string
- func Marshal(y *limatype.LimaYAML, stream bool) ([]byte, error)
- func ResolveArch(s *string) limatype.Arch
- func ResolveOS(s *string) limatype.OS
- func Unmarshal(data []byte, y *limatype.LimaYAML, comment string) error
- func Validate(y *limatype.LimaYAML, warn bool) error
- func ValidateAgainstLatestConfig(ctx context.Context, yNew, yLatest []byte) error
- type ContainerdYAML
Constants ¶
const ( // Default9pSecurityModel is "none" for supporting symlinks // https://gitlab.com/qemu-project/qemu/-/issues/173 Default9pSecurityModel string = "none" Default9pProtocolVersion string = "9p2000.L" Default9pMsize string = "128KiB" Default9pCacheForRO string = "fscache" Default9pCacheForRW string = "mmap" DefaultVirtiofsQueueSize int = 1024 )
Variables ¶
var (
IPv4loopback1 = net.IPv4(127, 0, 0, 1)
)
Functions ¶
func ExistingLimaVersion ¶
ExistingLimaVersion returns empty if the instance was created with Lima prior to v0.20.
func FillCopyToHostDefaults ¶
func FillDefault ¶
FillDefault updates undefined fields in y with defaults from d (or built-in default), and overwrites with values from o. Both d and o may be empty.
Maps (`Env`) are being merged: first populated from d, overwritten by y, and again overwritten by o. Slices (e.g. `Mounts`, `Provision`) are appended, starting with o, followed by y, and finally d. This makes sure o takes priority over y over d, in cases it matters (e.g. `PortForwards`, where the first matching rule terminates the search).
Exceptions:
- Mounts are appended in d, y, o order, but "merged" when the Location matches a previous entry; the highest priority Writable setting wins.
- Networks are appended in d, y, o order
- DNS are picked from the highest priority where DNS is not empty.
- CACertificates Files and Certs are uniquely appended in d, y, o order
func FillPortForwardDefaults ¶
func FirstUsernetIndex ¶
FirstUsernetIndex gets the index of first usernet network under l.Network[]. Returns -1 if no usernet network found.
func IsExistingInstanceDir ¶
func IsNativeArch ¶
func Load ¶
Load loads the yaml and fulfills unspecified fields with the default values.
Load does not validate. Use Validate for validation.
func LoadWithWarnings ¶
LoadWithWarnings will call FillDefaults with warnings enabled (e.g. when the username is not valid on Linux and must be replaced by "Lima"). It is called when creating or editing an instance.
func MACAddress ¶
func ResolveArch ¶
func ValidateAgainstLatestConfig ¶
ValidateAgainstLatestConfig validates the values between the latest YAML and the updated(New) YAML. This validates configuration rules that disallow certain changes, such as shrinking the disk.