🐛 Read upgrade/install values from config (#55)

We were ignoring the values in the /etc/elemental/config.yaml file that
we loaded into viper by not reading those values and their keys into the
final spec.

This meant that for example the defautl entry name was being lost as we
generated a new install spec from scratch and ignored those values that
we read on the config

Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>
This commit is contained in:
Itxaka
2023-06-08 09:50:19 +00:00
committed by GitHub
parent acff689bea
commit 14e562bb16
3 changed files with 9 additions and 5 deletions

View File

@@ -3,6 +3,7 @@ package agent
import (
"encoding/json"
"fmt"
"github.com/sanity-io/litter"
"github.com/sirupsen/logrus"
"os"
"sync"
@@ -89,6 +90,7 @@ func Reset(debug bool, dir ...string) error {
if debug {
resetConfig.Logger.SetLevel(logrus.DebugLevel)
}
resetConfig.Logger.Debugf("Full config: %s\n", litter.Sdump(resetConfig))
resetSpec, err := elementalConfig.ReadResetSpec(resetConfig)
if err != nil {
return err