mirror of
https://github.com/kairos-io/kairos-agent.git
synced 2025-09-06 19:40:08 +00:00
gear: Extract netboot artifacts
This changeset also adds a `config_url` and `options` keyword in the c3os config. Along with that the config logic is changed so the configuration is taken also from boot commands and merged in the final installed config file.
This commit is contained in:
committed by
Itxaka
parent
63cd28d1cb
commit
49e4bd9503
29
internal/machine/bootcmdline_test.go
Normal file
29
internal/machine/bootcmdline_test.go
Normal file
@@ -0,0 +1,29 @@
|
||||
package machine_test
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"os"
|
||||
|
||||
. "github.com/c3os-io/c3os/internal/machine"
|
||||
. "github.com/onsi/ginkgo/v2"
|
||||
. "github.com/onsi/gomega"
|
||||
)
|
||||
|
||||
var _ = Describe("BootCMDLine", func() {
|
||||
Context("parses data", func() {
|
||||
|
||||
It("returns cmdline if provided", func() {
|
||||
f, err := ioutil.TempFile("", "test")
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
defer os.RemoveAll(f.Name())
|
||||
|
||||
err = ioutil.WriteFile(f.Name(), []byte(`config_url="foo bar" baz.bar=""`), os.ModePerm)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
|
||||
b, err := DotToYAML(f.Name())
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
|
||||
Expect(string(b)).To(Equal("baz:\n bar: \"\"\nconfig_url: foo bar\n"))
|
||||
})
|
||||
})
|
||||
})
|
Reference in New Issue
Block a user