config

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2024 License: Apache-2.0 Imports: 4 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_RPM_OSTREE_PATH = "/usr/bin/rpm-ostree"
	DEFAULT_KUBEADM_PATH    = "/usr/bin/kubeadm"
)

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 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"`
}

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

Jump to

Keyboard shortcuts

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