1
0
mirror of https://github.com/rancher/os.git synced 2025-09-13 13:39:53 +00:00

cloudinit tests pass :)

Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
This commit is contained in:
Sven Dowideit
2017-02-23 01:29:01 +00:00
parent 4f177ee605
commit be2c4044ce
72 changed files with 2683 additions and 1185 deletions

View File

@@ -20,22 +20,21 @@ import (
"github.com/rancher/os/config/cloudinit/pkg"
)
type HttpClient struct {
type HTTPClient struct {
Resources map[string]string
Err error
}
func (t *HttpClient) GetRetry(url string) ([]byte, error) {
func (t *HTTPClient) GetRetry(url string) ([]byte, error) {
if t.Err != nil {
return nil, t.Err
}
if val, ok := t.Resources[url]; ok {
return []byte(val), nil
} else {
return nil, pkg.ErrNotFound{fmt.Errorf("not found: %q", url)}
}
return nil, pkg.ErrNotFound{fmt.Errorf("not found: %q", url)}
}
func (t *HttpClient) Get(url string) ([]byte, error) {
func (t *HTTPClient) Get(url string) ([]byte, error) {
return t.GetRetry(url)
}