config

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindConfigFile

func FindConfigFile() (string, error)

FindConfigFile searches for a config file in standard locations

func ParseProviderConfig

func ParseProviderConfig[T any](raw ProviderConfig) (*T, error)

ParseProviderConfig unmarshals a provider's raw config into a typed struct

Types

type Config

type Config struct {
	Server    ServerConfig              `yaml:"server"`
	Export    ExportConfig              `yaml:"export"`
	Schedule  ScheduleConfig            `yaml:"schedule"`
	Providers map[string]ProviderConfig `yaml:"providers"`
}

Config is the top-level configuration

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns a config with sensible defaults

func Load

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

Load reads a config file from the given path

func (*Config) ProviderDataDir

func (c *Config) ProviderDataDir(relativeDir string) string

ProviderDataDir returns the absolute path for a provider's data directory

func (*Config) ProviderEnabled

func (c *Config) ProviderEnabled(name string) bool

ProviderEnabled checks if a provider is enabled in the config

type ContainerImagesProviderConfig

type ContainerImagesProviderConfig struct {
	Enabled bool `yaml:"enabled"`
	// Images is a list of newline-friendly image references such as:
	// docker://quay.io/org/repo:tag
	// oci://registry.example.com/ns/repo@sha256:...
	Images []string `yaml:"images"`
	// Legacy fields kept for backward compatibility with existing configs.
	OCMirrorBinary string `yaml:"oc_mirror_binary"`
	ImagesetConfig string `yaml:"imageset_config"`
	OutputDir      string `yaml:"output_dir"`
}

ContainerImagesProviderConfig is the typed config for container images

type CustomFileSource

type CustomFileSource struct {
	Name        string `yaml:"name"`
	URL         string `yaml:"url"`
	ChecksumURL string `yaml:"checksum_url"`
	OutputDir   string `yaml:"output_dir"`
}

CustomFileSource is a single custom file source

type CustomFilesProviderConfig

type CustomFilesProviderConfig struct {
	Enabled bool               `yaml:"enabled"`
	Sources []CustomFileSource `yaml:"sources"`
}

CustomFilesProviderConfig is the typed config for custom file sources

type EPELProviderConfig

type EPELProviderConfig struct {
	Enabled                bool             `yaml:"enabled"`
	Repos                  []EPELRepoConfig `yaml:"repos"`
	MaxConcurrentDownloads int              `yaml:"max_concurrent_downloads"`
	RetryAttempts          int              `yaml:"retry_attempts"`
	CleanupRemovedPackages bool             `yaml:"cleanup_removed_packages"`
}

EPELProviderConfig is the typed config for the EPEL provider

type EPELRepoConfig

type EPELRepoConfig struct {
	Name      string `yaml:"name"`
	BaseURL   string `yaml:"base_url"`
	OutputDir string `yaml:"output_dir"`
}

EPELRepoConfig represents a single EPEL repo definition

type ExportConfig

type ExportConfig struct {
	SplitSize    string `yaml:"split_size"`
	Compression  string `yaml:"compression"`
	OutputDir    string `yaml:"output_dir"`
	ManifestName string `yaml:"manifest_name"`
}

ExportConfig holds export/transfer settings

type OCPBinariesProviderConfig

type OCPBinariesProviderConfig struct {
	Enabled         bool     `yaml:"enabled"`
	BaseURL         string   `yaml:"base_url"`
	Versions        []string `yaml:"versions"`
	IgnoredPatterns []string `yaml:"ignored_patterns"`
	OutputDir       string   `yaml:"output_dir"`
	RetryAttempts   int      `yaml:"retry_attempts"`
}

OCPBinariesProviderConfig is the typed config for OCP binaries

type OCPClientsProviderConfig

type OCPClientsProviderConfig struct {
	Enabled   bool     `yaml:"enabled"`
	Channels  []string `yaml:"channels"`   // e.g. ["stable-4.21", "fast-4.22"] — auto-discover releases
	Versions  []string `yaml:"versions"`   // pinned versions e.g. ["4.21.1", "4.20.5"]
	Platforms []string `yaml:"platforms"`  // ["linux", "linux-arm64", "mac", "mac-arm64", "windows"]
	OutputDir string   `yaml:"output_dir"` // default "ocp-clients"
}

OCPClientsProviderConfig is the typed config for OCP client binaries (oc + openshift-install) with channel-based auto-discovery and platform filtering.

type ProviderConfig

type ProviderConfig map[string]interface{}

ProviderConfig is the raw YAML config for a provider

type RHCOSProviderConfig

type RHCOSProviderConfig struct {
	Enabled         bool     `yaml:"enabled"`
	BaseURL         string   `yaml:"base_url"`
	Versions        []string `yaml:"versions"`
	IgnoredPatterns []string `yaml:"ignored_patterns"`
	OutputDir       string   `yaml:"output_dir"`
	RetryAttempts   int      `yaml:"retry_attempts"`
}

RHCOSProviderConfig is the typed config for RHCOS images

type RegistryProviderConfig

type RegistryProviderConfig struct {
	Enabled              bool   `yaml:"enabled"`
	MirrorRegistryBinary string `yaml:"mirror_registry_binary"`
	QuayRoot             string `yaml:"quay_root"`
	Endpoint             string `yaml:"endpoint"`
	RepositoryPrefix     string `yaml:"repository_prefix"`
	Username             string `yaml:"username"`
	Password             string `yaml:"password"`
	InsecureSkipTLS      bool   `yaml:"insecure_skip_tls"`
	SkopeoBinary         string `yaml:"skopeo_binary"`
}

RegistryProviderConfig is the typed config for mirror-registry

type ScheduleConfig

type ScheduleConfig struct {
	Enabled     bool   `yaml:"enabled"`
	DefaultCron string `yaml:"default_cron"`
}

ScheduleConfig holds scheduler settings

type ServerConfig

type ServerConfig struct {
	Listen  string `yaml:"listen"`
	DataDir string `yaml:"data_dir"`
	DBPath  string `yaml:"db_path"`
}

ServerConfig holds server settings

Jump to

Keyboard shortcuts

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