Documentation
¶
Overview ¶
Package engineconfig manages upstream k3s/RKE2 source pins, source pulls, and config struct codegen.
Index ¶
- Constants
- func GenerateEngineConfig() error
- func LatestTag(repoURL, prefix string) (string, error)
- func PinTag(pins *EnginePins, distro, prefix string) (string, error)
- func PullAllEngineSources() error
- func PullEngineSource(p SourcePull) error
- func RemoteTags(repoURL, prefix string) ([]string, error)
- func TagMinor(tag string) (string, error)
- func TagVersion(tag string) ([3]int, error)
- func UpdateAllPins() error
- type EnginePins
- type PinDistro
- type SourcePull
Constants ¶
const (
// EngineConfigOut is where the generated config structs are written.
EngineConfigOut = "pkg/engineconfig/gen"
)
const EnginePinsPath = "thirdparty-src/pins.json"
EnginePinsPath is the canonical manifest of pinned upstream distros and tags.
const ThirdpartySrcDir = "thirdparty-src"
ThirdpartySrcDir is the root the pinned upstream source is pulled into and generated from.
Variables ¶
This section is empty.
Functions ¶
func GenerateEngineConfig ¶
func GenerateEngineConfig() error
GenerateEngineConfig generates config.yaml structs from thirdparty-src/.
func PinTag ¶
func PinTag(pins *EnginePins, distro, prefix string) (string, error)
PinTag resolves the newest non-RC tag matching prefix, pins it in thirdparty-src/pins.json, and re-pulls that version's source when the pin moved. Returns the resolved tag.
func PullAllEngineSources ¶
func PullAllEngineSources() error
PullAllEngineSources pulls all files pinned in thirdparty-src/pins.json.
func PullEngineSource ¶
func PullEngineSource(p SourcePull) error
PullEngineSource pulls the specified source files into DestDir.
func RemoteTags ¶
RemoteTags lists every non-RC upstream tag on a minor line ("v1.36").
func TagMinor ¶
TagMinor returns the thirdparty-src directory name for a tag's minor line ("v1.35.8+k3s1" -> "v1_35").
func TagVersion ¶
TagVersion parses the leading major.minor.patch of an upstream tag ("v1.35.8+k3s1").
func UpdateAllPins ¶
func UpdateAllPins() error
UpdateAllPins refreshes every pinned minor line in thirdparty-src/pins.json.
Types ¶
type EnginePins ¶
type EnginePins struct {
Distros []PinDistro `json:"distros"`
}
EnginePins is the on-disk form of thirdparty-src/pins.json.
func ReadEnginePins ¶
func ReadEnginePins() (EnginePins, error)
ReadEnginePins loads and parses thirdparty-src/pins.json.
func (*EnginePins) Distro ¶
func (p *EnginePins) Distro(name string) (*PinDistro, error)
Distro returns the pinned entry for a distro name.
func (EnginePins) Pulls ¶
func (p EnginePins) Pulls() ([]SourcePull, error)
Pulls flattens the pins into one pull per pinned tag.
func (EnginePins) Write ¶
func (p EnginePins) Write() error
Write rewrites thirdparty-src/pins.json from the in-memory pins.