config

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package config handles parsing and applying options from finch's config file. These options can be applied to any aspect of the project, from the VMM to components running inside the VM.

Currently, VMM options are applied to one of Lima's configuration files and options within the VM are applied via running SSH commands and writing files via SFTP.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Finch

type Finch struct {
	CPUs   *int    `yaml:"cpus"`
	Memory *string `yaml:"memory"`
}

Finch represents the configuration file for Finch CLI.

func Load

func Load(fs afero.Fs, cfgPath string, log flog.Logger, systemDeps LoadSystemDeps, mem fmemory.Memory) (*Finch, error)

Load loads Finch's configuration from a YAML file and initializes default values.

type LimaConfigApplier

type LimaConfigApplier interface {
	Apply() error
}

LimaConfigApplier applies lima configuration changes.

func NewLimaApplier

func NewLimaApplier(cfg *Finch, fs afero.Fs, limaConfigPath string) LimaConfigApplier

NewLimaApplier creates a new LimaConfigApplier that applies lima configuration changes by writing to the lima config file on the disk.

type LoadSystemDeps

type LoadSystemDeps interface {
	system.RuntimeCPUGetter
}

LoadSystemDeps contains the system dependencies for Load.

type Nerdctl

type Nerdctl struct {
	Debug            bool     `toml:"debug,omitempty"`
	DebugFull        bool     `toml:"debug_full1,omitempty"`
	Address          string   `toml:"address,omitempty"`
	Namespace        string   `toml:"namespace,omitempty"`
	Snapshotter      string   `toml:"snapshotter,omitempty"`
	CNIPath          string   `toml:"cni_path,omitempty"`
	CNINetConfPath   string   `toml:"cni_netconfpath,omitempty"`
	DataRoot         string   `toml:"data_root,omitempty"`
	CgroupManager    string   `toml:"cgroup_manager,omitempty"`
	InsecureRegistry bool     `toml:"insecure_registry,omitempty"`
	HostsDir         []string `toml:"hosts_dir,omitempty"`
}

Nerdctl is a copy from github.com/containerd/nerdctl/cmd/nerdctl/main.go TODO: make PR to nerdctl repo to move this config out of the main package so it can be imported on macOS.

type NerdctlConfigApplier

type NerdctlConfigApplier interface {
	Apply(remoteAddr string) error
}

NerdctlConfigApplier applies nerdctl configuration changes.

func NewNerdctlApplier

func NewNerdctlApplier(dialer fssh.Dialer, fs afero.Fs, privateKeyPath string, systemDeps NerdctlConfigApplierSystemDeps) NerdctlConfigApplier

NewNerdctlApplier creates a new NerdctlConfigApplier that applies nerdctl configuration changes by SSHing to the lima VM to update the nerdctl configuration file in it.

type NerdctlConfigApplierSystemDeps

type NerdctlConfigApplierSystemDeps interface {
	system.EnvGetter
}

NerdctlConfigApplierSystemDeps contains the system dependencies required for NewNerdctlApplier.

Jump to

Keyboard shortcuts

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