Spencer Smith f85750cdca feat: generate and use v1 machine configs
This PR will implement the v1 machine config proposal. This will allow
for a streamlined config for talos nodes.

Signed-off-by: Spencer Smith <robertspencersmith@gmail.com>
2019-08-26 19:36:14 -04:00

25 lines
724 B
Go

/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package userdata
import (
"strings"
ud "github.com/talos-systems/talos/pkg/userdata"
"github.com/talos-systems/talos/pkg/userdata/download"
)
// UserData provides an abstraction to call the appropriate method to
// load user data
// TODO: Merge this in to internal/pkg/userdata
func UserData(location string) (userData *ud.UserData, err error) {
if strings.HasPrefix(location, "http") {
userData, err = download.Download(location, nil)
} else {
userData, err = ud.Open(location)
}
return userData, err
}