airshipctl/pkg/util/configreader.go
Dmitry Ukov 1f2e20e106 [AIR-137] Add isogen subcommand for bootstrap
This is just a frame for command that will execute docker container
with ISO builder scripts

Change-Id: I59a5c494785af3cbcffd3b9f6a488d93f73f4878
2019-09-26 13:51:18 +04:00

18 lines
327 B
Go

package util
import (
"io/ioutil"
"sigs.k8s.io/yaml"
)
// ReadYAMLFile reads YAML-formatted configuration file and
// de-serializes it to a given object
func ReadYAMLFile(filePath string, cfg interface{}) error {
data, err := ioutil.ReadFile(filePath)
if err != nil {
return err
}
return yaml.Unmarshal(data, cfg)
}