1
0
mirror of https://github.com/rancher/os.git synced 2025-09-01 14:48:55 +00:00

Services in compose format

This commit is contained in:
Darren Shepherd
2015-04-15 22:57:59 -07:00
parent adc6825ee6
commit 0b5eb352ba
12 changed files with 328 additions and 141 deletions

View File

@@ -476,13 +476,11 @@ func isCompose(content string) bool {
func toCompose(bytes []byte) ([]byte, error) {
result := make(map[interface{}]interface{})
compose := make(map[interface{}]interface{})
err := yaml.Unmarshal(bytes, &result)
err := yaml.Unmarshal(bytes, &compose)
if err != nil {
return nil, err
}
result["services"] = map[interface{}]interface{}{
"cloud-config": compose,
}
result["services"] = compose
return yaml.Marshal(result)
}