config

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEFAULT_CONFIG_PATH = "/etc/kube-upgraded/config.yaml"

	DEFAULT_LOG_LEVEL       = "info"
	DEFAULT_KUBECONFIG      = "/etc/kubernetes/kubelet.conf"
	DEFAULT_STREAM          = "ghcr.io/heathcliff26/fcos-k8s"
	DEFAULT_FLEETLOCK_GROUP = "default"
	DEFAULT_RPM_OSTREE_PATH = "/usr/bin/rpm-ostree"
	DEFAULT_KUBEADM_PATH    = "/usr/bin/kubeadm"
	DEFAULT_CHECK_INTERVAL  = 3 * time.Hour
	DEFAULT_RETRY_INTERVAL  = 5 * time.Minute
)

Variables

This section is empty.

Functions

func NewErrUnknownLogLevel

func NewErrUnknownLogLevel(level string) error

Types

type Config

type Config struct {
	// The log level used by slog, default "info"
	LogLevel string `yaml:"logLevel,omitempty"`
	// The path to the kubeconfig file, default is the kubelet config under "/etc/kubernetes/kubelet.conf"
	Kubeconfig string `yaml:"kubeconfig,omitempty"`
	// The container image repository for os rebases
	Stream string `yaml:"stream,omitempty"`
	// Configuration for fleetlock node locking
	Fleetlock FleetlockConfig `yaml:"fleetlock"`
	// The path to the rpm-ostree binary, default "/usr/bin/rpm-ostree"
	RPMOStreePath string `yaml:"rpm-ostree-path,omitempty"`
	// The path to the kubeadm binary, default "/usr/bin/kubeadm"
	KubeadmPath string `yaml:"kubeadm-path,omitempty"`

	// The interval between regular checks, default 3h
	CheckInterval time.Duration `yaml:"check-interval,omitempty"`
	// The interval between retries when an operation fails, default 5m
	RetryInterval time.Duration `yaml:"retry-interval,omitempty"`
}

func DefaultConfig

func DefaultConfig() *Config

func LoadConfig

func LoadConfig(path string) (*Config, error)

Loads the config from the given path. When path is empty, it checks the default path "/etc/kube-upgraded/config.yaml". When no config is found in the default path, it returns the default config. Returns error when the given config is invalid.

type ErrUnknownLogLevel

type ErrUnknownLogLevel struct {
	// contains filtered or unexported fields
}

func (*ErrUnknownLogLevel) Error

func (e *ErrUnknownLogLevel) Error() string

type FleetlockConfig

type FleetlockConfig struct {
	// URL to fleetlock server
	URL string `yaml:"url"`
	// The node group to use for fleetlock, default group is "default"
	Group string `yaml:"group,omitempty"`
}

Jump to

Keyboard shortcuts

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