Unmarshal yaml after auto size calculation and fix tests

because we want the user's preferences to be applied last, thus
overriding whatever calculations we may do automatically.

Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
This commit is contained in:
Dimitris Karakasilis
2023-10-02 12:28:33 +03:00
parent 80f83ba676
commit e0dfc79ed5
2 changed files with 26 additions and 13 deletions

View File

@@ -463,6 +463,8 @@ upgrade:
recovery: true
system:
uri: docker:test/image:latest
recovery-system:
uri: docker:test/image:latest
cloud-init-paths:
- /what
`)
@@ -502,6 +504,12 @@ cloud-init-paths:
ghwTest = v1mock.GhwMock{}
ghwTest.AddDisk(mainDisk)
ghwTest.CreateDevices()
fs, cleanup, err = vfst.NewTestFS(nil)
err = fsutils.MkdirAll(fs, filepath.Dir(constants.IsoBaseTree), constants.DirPerm)
Expect(err).ShouldNot(HaveOccurred())
_, err = fs.Create(constants.IsoBaseTree)
Expect(err).ShouldNot(HaveOccurred())
})
AfterEach(func() {
@@ -509,7 +517,11 @@ cloud-init-paths:
ghwTest.Clean()
})
It("Reads properly the cloud config for install", func() {
cfg, err := config.Scan(collector.Directories([]string{dir}...), collector.NoLogs)
cfg, err := config.Scan(collector.Directories([]string{dir}...),
collector.NoLogs,
)
cfg.Fs = fs
Expect(err).ToNot(HaveOccurred())
// Once we got the cfg override the fs to our test fs
cfg.Runner = runner