Skip to content

Commit

Permalink
fix framework empty values
Browse files Browse the repository at this point in the history
Signed-off-by: Itxaka <[email protected]>
  • Loading branch information
Itxaka committed Jan 29, 2025
1 parent 4e16aa6 commit 1e0b2a5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
7 changes: 7 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,13 @@ func main() {
logger := types.NewKairosLogger("kairos-init", config.DefaultConfig.Level, false)
logger.Infof("Starting kairos-init version %s", values.GetVersion())
logger.Debug(litter.Sdump(values.GetFullVersion()))

// If the framework version is set in the config use that, otherwise use the version from the values which usually its the latest
if config.DefaultConfig.FrameworkVersion == "" {
logger.Logger.Debug().Str("version", values.GetFrameworkVersion()).Msg("Setting framework version from config")
config.DefaultConfig.FrameworkVersion = values.GetFrameworkVersion()
}

logger.Debug(litter.Sdump(config.DefaultConfig))

var err error
Expand Down
11 changes: 2 additions & 9 deletions pkg/stages/stages.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func GetKairosReleaseStage(sis values.System, log types.KairosLogger) []schema.S
KAIROS_PRETTY_NAME="kairos-standard-ubuntu-24.04 v3.2.4-36-g24ca209-v1.32.0-k3s1"
VERSION_ID and VERSION are the same
RELEASE is the short version of VERSION and VERSION_ID, is it used anywhere?
RELEASE is the short version of VERSION and VERSION_ID, the version without the k3s version
IMAGE_REPO is a mix of REGISTRY_AND_ORG and IMAGE_LABEL, useless?
ARTIFACT is just the IMAGE_LABEL with the OS and OS VERSION in front, useless?
Expand Down Expand Up @@ -314,13 +314,6 @@ func GetCleanupStage(_ values.System, _ types.KairosLogger) []schema.Stage {
}

func GetInstallFrameworkStage(_ values.System, _ types.KairosLogger) []schema.Stage {
var frameworkVersion string
// If the framework version is set in the config use that, otherwise use the version from the values which usually its the latest
if config.DefaultConfig.FrameworkVersion != "" {
frameworkVersion = config.DefaultConfig.FrameworkVersion
} else {
frameworkVersion = values.GetFrameworkVersion()
}
return []schema.Stage{
{
Name: "Create kairos directory",
Expand All @@ -336,7 +329,7 @@ func GetInstallFrameworkStage(_ values.System, _ types.KairosLogger) []schema.St
Name: "Install framework",
UnpackImages: []schema.UnpackImageConf{
{
Source: fmt.Sprintf("quay.io/kairos/framework:%s", frameworkVersion),
Source: fmt.Sprintf("quay.io/kairos/framework:%s", config.DefaultConfig.FrameworkVersion),
Target: "/",
},
},
Expand Down

0 comments on commit 1e0b2a5

Please sign in to comment.