Skip to content

Commit

Permalink
Drop luet init from BuildConfig (rancher#310)
Browse files Browse the repository at this point in the history
We are already calling NewConfig inside BuildConfig and that will make
sure that a luet instance is properly created.

This fixes the issue of having temp files in the dir running elemental
as the BuildConfig luet was misconfigured with no tempDir and no FS

Signed-off-by: Itxaka <[email protected]>

Signed-off-by: Itxaka <[email protected]>
  • Loading branch information
Itxaka authored Aug 11, 2022
1 parent ed5c1b9 commit 07f8e36
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
4 changes: 0 additions & 4 deletions cmd/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ import (
"github.com/rancher/elemental-cli/internal/version"
"github.com/rancher/elemental-cli/pkg/config"
"github.com/rancher/elemental-cli/pkg/constants"
"github.com/rancher/elemental-cli/pkg/luet"
v1 "github.com/rancher/elemental-cli/pkg/types/v1"
"github.com/rancher/elemental-cli/pkg/utils"
)
Expand Down Expand Up @@ -106,12 +105,9 @@ func ReadConfigBuild(configDir string, flags *pflag.FlagSet, mounter mount.Inter
configDir = "."
}

l := luet.NewLuet(luet.WithLogger(logger))

cfg := config.NewBuildConfig(
config.WithLogger(logger),
config.WithMounter(mounter),
config.WithLuet(l),
)

configLogger(cfg.Logger, cfg.Fs)
Expand Down
1 change: 1 addition & 0 deletions pkg/luet/luet.go
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,7 @@ func (l Luet) createLuetConfig() *luetTypes.LuetConfig {
if l.TmpDir != "" {
config.System.TmpDirBase = l.TmpDir
config.System.PkgsCachePath = l.TmpDir
config.System.DatabasePath = l.TmpDir
}
return config
}

0 comments on commit 07f8e36

Please sign in to comment.