config

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2024 License: Apache-2.0 Imports: 10 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

View Source
const (
	DefaultCPUs   = 0
	DefaultMemory = ""
)

Default values for the command line arguments --cpus and --memory.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdditionalDirectory added in v0.2.0

type AdditionalDirectory struct {
	Path *string `yaml:"path"`
}

AdditionalDirectory represents the additional directory used in Finch config.

type Finch

type Finch struct {
	SharedSettings `yaml:",inline"`
}

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,
	ecc command.Creator,
) (*Finch, error)

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

type LimaConfigApplier

type LimaConfigApplier interface {
	ConfigureOverrideLimaYaml() error
	ConfigureDefaultLimaYaml() error
	GetFinchConfigPath() string
}

LimaConfigApplier applies lima configuration changes.

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: this should be importable on macOS once nerdctl v2 is released.

type NerdctlConfigApplier

type NerdctlConfigApplier interface {
	Apply(remoteAddr string) error
}

NerdctlConfigApplier applies nerdctl configuration changes.

type SharedSettings added in v1.3.0

type SharedSettings struct {
	Snapshotters []string `yaml:"snapshotters,omitempty"`
	CredsHelpers []string `yaml:"creds_helpers,omitempty"`
	DockerCompat bool     `yaml:"dockercompat,omitempty"`
}

SharedSettings represents settings shared by all Finch configurations.

type SharedSystemSettings added in v1.3.0

type SharedSystemSettings struct {
	VMType *limayaml.VMType `yaml:"vmType,omitempty"`
}

SharedSystemSettings represents all settings shared by virtualized Finch configurations.

type VMConfigOpts added in v1.2.0

type VMConfigOpts struct {
	CPUs   int
	Memory string
}

VMConfigOpts represents the Options for finch vm settings command.

Jump to

Keyboard shortcuts

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