mirror of
https://github.com/rancher/os.git
synced 2025-09-16 06:59:12 +00:00
Refactor a little so 'ros os list' also uses the configured proxy info
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
This commit is contained in:
@@ -3,7 +3,6 @@ package control
|
||||
import (
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"os"
|
||||
"runtime"
|
||||
@@ -22,6 +21,7 @@ import (
|
||||
"github.com/rancher/os/compose"
|
||||
"github.com/rancher/os/config"
|
||||
"github.com/rancher/os/docker"
|
||||
"github.com/rancher/os/util/network"
|
||||
)
|
||||
|
||||
type Images struct {
|
||||
@@ -83,7 +83,6 @@ func osSubcommands() []cli.Command {
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: this and the getLatestImage should probably move to utils/network and be suitably cached.
|
||||
func getImages() (*Images, error) {
|
||||
upgradeURL, err := getUpgradeURL()
|
||||
if err != nil {
|
||||
@@ -108,12 +107,7 @@ func getImages() (*Images, error) {
|
||||
u.RawQuery = q.Encode()
|
||||
upgradeURL = u.String()
|
||||
|
||||
resp, err := http.Get(upgradeURL)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
body, err = ioutil.ReadAll(resp.Body)
|
||||
body, err = network.LoadFromNetwork(upgradeURL)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
Reference in New Issue
Block a user