config

package
v0.8.9 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: MPL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultLocalRegistryPort is the default user-facing port for the local registry used for exports.
	DefaultLocalRegistryPort = 8371

	// DefaultDarwinProxyImage is the image tag used for the Docker Desktop registry proxy on Darwin.
	DefaultDarwinProxyImage = "alpine/socat:1.7.4.4"

	// DefaultDarwinProxyWait is the maximum time to wait for the Darwin registry proxy support container to become available.
	DefaultDarwinProxyWait = 10 * time.Second

	// DefaultBuildkitScheme is the default scheme earthly uses to connect to its buildkitd. tcp or docker-container.
	DefaultBuildkitScheme = "docker-container"

	// DefaultConversionParallelism is the default conversion parallelism that Earthly uses internally to generate LLB for BuildKit to consume.
	DefaultConversionParallelism = 10

	// DefaultBuildkitMaxParallelism is the default max parallelism for buildkit workers.
	DefaultBuildkitMaxParallelism = 20

	// DefaultCACert is the default path to use when looking for a CA cert to use for TLS.
	DefaultCACert = "./certs/ca_cert.pem"

	// DefaultCAKey is the default path to use when looking for a CA key to use for TLS cert generation.
	DefaultCAKey = "./certs/ca_key.pem"

	// DefaultClientTLSCert is the default path to use when looking for the Earthly TLS cert
	DefaultClientTLSCert = "./certs/earthly_cert.pem"

	// DefaultClientTLSKey is the default path to use when looking for the Earthly TLS key
	DefaultClientTLSKey = "./certs/earthly_key.pem"

	// DefaultServerTLSCert is the default path to use when looking for the Buildkit TLS cert
	DefaultServerTLSCert = "./certs/buildkit_cert.pem"

	// DefaultServerTLSKey is the default path to use when looking for the Buildkit TLS key
	DefaultServerTLSKey = "./certs/buildkit_key.pem"

	// DefaultContainerFrontend is the default frontend program or interfacing with the running containers and saved images
	DefaultContainerFrontend = "auto"
)

Variables

View Source
var (
	// ErrInvalidTransport occurs when a URL transport type is invalid
	ErrInvalidTransport = errors.Errorf("invalid transport")

	// ErrInvalidAuth occurs when the auth type is invalid
	ErrInvalidAuth = errors.Errorf("invalid auth")
)

Functions

func Delete added in v0.6.15

func Delete(config []byte, path string) ([]byte, error)

Delete removes the key and value at the specified path. If no key/value exists, the function will eventually return cleanly.

func PortOffset added in v0.6.30

func PortOffset(installationName string) int

PortOffset is the offset to use for dev ports.

func PrintHelp added in v0.6.15

func PrintHelp(path string) error

PrintHelp describes the provided config option by printing its type and help tags to the console.

func ReadConfigFile added in v0.6.15

func ReadConfigFile(configPath string) ([]byte, error)

ReadConfigFile reads in the config file from the disk, into a byte slice.

func Upsert added in v0.6.15

func Upsert(config []byte, path, value string) ([]byte, error)

Upsert adds or modifies the key to be the specified value. This is saved to disk in your earthly config file.

func WriteConfigFile added in v0.6.15

func WriteConfigFile(configPath string, data []byte) error

WriteConfigFile writes the config file to disk with preset permission 0644

Types

type Config

type Config struct {
	Global    GlobalConfig         `yaml:"global"    help:"Global configuration object. Requires YAML literal to set directly."`
	Git       map[string]GitConfig `yaml:"git"       help:"Git configuration object. Requires YAML literal to set directly."`
	Satellite Satellite            `` /* 162-byte string literal not displayed */
}

Config contains user's configuration values from ~/earthly/config.yml

func ParseYAML added in v0.7.5

func ParseYAML(yamlData []byte, installationName string) (Config, error)

ParseYAML parse config data in yaml format.

type GitConfig

type GitConfig struct {
	// these are used for git vendors (e.g. github, gitlab)
	Pattern               string ``                                                                                                                       /* 238-byte string literal not displayed */
	Substitute            string ``                                                                                                                       /* 315-byte string literal not displayed */
	Suffix                string `yaml:"suffix"                       help:"The git repository suffix, like .git."`                                       // .git
	Auth                  string `yaml:"auth"                         help:"What authentication method do you use? Valid options are: http, https, ssh."` // http, https, ssh
	User                  string `yaml:"user"                         help:"The username to use when auth is set to git or https."`
	Port                  int    `yaml:"port"                         help:"The port to connect to when using git; has no effect for http(s)."`
	Prefix                string `` /* 136-byte string literal not displayed */
	Password              string `` /* 137-byte string literal not displayed */
	ServerKey             string `` /* 130-byte string literal not displayed */
	StrictHostKeyChecking *bool  `` /* 145-byte string literal not displayed */
	SSHCommand            string `` /* 151-byte string literal not displayed */
}

GitConfig contains git-specific config values

type GlobalConfig

type GlobalConfig struct {
	DisableAnalytics           bool          `yaml:"disable_analytics"              help:"Controls Earthly telemetry."`
	BuildkitCacheSizeMb        int           `yaml:"cache_size_mb"                  help:"Size of the buildkit cache in Megabytes."`
	BuildkitCacheSizePct       int           `yaml:"cache_size_pct"                 help:"Size of the buildkit cache, as percentage (0-100)."`
	BuildkitCacheKeepDurationS int           `yaml:"buildkit_cache_keep_duration_s" help:"Max age of cache, in seconds. 0 disables age-based cache expiry."`
	BuildkitImage              string        `yaml:"buildkit_image"                 help:"Choose a specific image for your buildkitd."`
	BuildkitRestartTimeoutS    int           `yaml:"buildkit_restart_timeout_s"     help:"How long to wait for buildkit to (re)start, in seconds."`
	BuildkitAdditionalArgs     []string      `` /* 166-byte string literal not displayed */
	BuildkitAdditionalConfig   string        `` /* 151-byte string literal not displayed */
	BuildkitMaxParallelism     int           `yaml:"buildkit_max_parallelism"       help:"Max parallelism for buildkit workers"`
	ConversionParallelism      int           `` /* 188-byte string literal not displayed */
	CniMtu                     uint16        `` /* 133-byte string literal not displayed */
	BuildkitHost               string        `yaml:"buildkit_host"                  help:"The URL of your buildkit, remote or local."`
	LocalRegistryHost          string        `yaml:"local_registry_host"            help:"The URL of the local registry used for image exports to Docker."`
	DarwinProxyImage           string        `yaml:"darwin_proxy_image"             help:"The container image & tag used for the Docker Desktop registry proxy."`
	DarwinProxyWait            time.Duration `` /* 138-byte string literal not displayed */
	TLSCACert                  string        `` /* 149-byte string literal not displayed */
	TLSCAKey                   string        `` /* 171-byte string literal not displayed */
	ClientTLSCert              string        `` /* 153-byte string literal not displayed */
	ClientTLSKey               string        `` /* 152-byte string literal not displayed */
	ServerTLSCert              string        `` /* 194-byte string literal not displayed */
	ServerTLSKey               string        `` /* 193-byte string literal not displayed */
	TLSEnabled                 bool          `` /* 139-byte string literal not displayed */
	ContainerFrontend          string        `` /* 191-byte string literal not displayed */
	IPTables                   string        `` /* 152-byte string literal not displayed */
	DisableLogSharing          bool          `` /* 150-byte string literal not displayed */
	SecretProvider             string        `yaml:"secret_provider"                help:"Command to execute to retrieve secret."`
	GitImage                   string        `yaml:"git_image"                      help:"Image used to resolve git repositories"`
	Org                        string        `` /* 170-byte string literal not displayed */

	// Obsolete.
	CachePath      string `yaml:"cache_path"         help:" *Deprecated* The path to keep Earthly's cache."`
	BuildkitScheme string `` /* 167-byte string literal not displayed */
}

GlobalConfig contains global config values

type Satellite added in v0.6.15

type Satellite struct {
	Name string `yaml:"name" help:"The name of the satellite to use"`
	Org  string `yaml:"org"  help:"*Deprecated* The org name to whom the satellite belongs"`
}

Satellite contains satellite config values

Jump to

Keyboard shortcuts

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