fixed generated cloud config

This commit is contained in:
ston1th 2020-06-01 16:55:54 +02:00
commit 20ac152a2b

View file

@ -8,6 +8,8 @@ import (
"net/url"
)
var cloudConfig = []byte("#cloud-config\n")
func parseUserData(s string) (u *UserData, err error) {
s, err = url.QueryUnescape(s)
if err != nil {
@ -29,7 +31,11 @@ func MarshalUserData(u *UserData) ([]byte, error) {
if u == nil {
return nil, nil
}
return yaml.Marshal(u)
b, err := yaml.Marshal(u)
if err == nil {
b = append(cloudConfig, b...)
}
return b, err
}
type UserData struct {