mirror of
https://github.com/kairos-io/provider-kairos.git
synced 2025-09-16 07:09:20 +00:00
Use FindYAMLWithKey
Signed-off-by: Ettore Di Giacinto <mudler@users.noreply.github.com>
This commit is contained in:
@@ -36,7 +36,7 @@ bb:
|
||||
err := ioutil.WriteFile(filepath.Join(d, "test"), []byte(cc), os.ModePerm)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
err = ioutil.WriteFile(filepath.Join(d, "b"), []byte(`
|
||||
fooz:
|
||||
fooz: "bar"
|
||||
`), os.ModePerm)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
|
||||
@@ -50,14 +50,14 @@ fooz:
|
||||
|
||||
err = yaml.Unmarshal(content, &res)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
hasHeader, _ := config.HasHeader(string(content), "#node-config")
|
||||
Expect(hasHeader).To(BeTrue())
|
||||
|
||||
Expect(res).To(Equal(map[interface{}]interface{}{
|
||||
"kairos": map[interface{}]interface{}{"network_token": "baz"},
|
||||
"bb": map[interface{}]interface{}{"nothing": "foo"},
|
||||
}))
|
||||
})
|
||||
|
||||
hasHeader, _ := config.HasHeader(string(content), "#node-config")
|
||||
Expect(hasHeader).To(BeTrue(), string(content))
|
||||
})
|
||||
})
|
||||
})
|
||||
|
Reference in New Issue
Block a user