1
0
mirror of https://github.com/rancher/os.git synced 2025-09-16 23:21:19 +00:00

Throw error if running install / upgrade on non-amd64

Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
This commit is contained in:
Sven Dowideit
2017-03-13 16:49:28 +10:00
parent d1d0c30924
commit 8080d01ac9
2 changed files with 10 additions and 0 deletions

View File

@@ -9,6 +9,7 @@ import (
"os" "os"
"os/exec" "os/exec"
"path/filepath" "path/filepath"
"runtime"
"strconv" "strconv"
"strings" "strings"
@@ -84,6 +85,10 @@ var installCommand = cli.Command{
} }
func installAction(c *cli.Context) error { func installAction(c *cli.Context) error {
if runtime.GOARCH != "amd64" {
log.Fatalf("ros install / upgrade only supported on 'amd64', not '%s'", runtime.GOARCH)
}
if c.Args().Present() { if c.Args().Present() {
log.Fatalf("invalid arguments %v", c.Args()) log.Fatalf("invalid arguments %v", c.Args())
} }

View File

@@ -6,6 +6,7 @@ import (
"net/http" "net/http"
"net/url" "net/url"
"os" "os"
"runtime"
"strings" "strings"
"golang.org/x/net/context" "golang.org/x/net/context"
@@ -167,6 +168,10 @@ func getLatestImage() (string, error) {
} }
func osUpgrade(c *cli.Context) error { func osUpgrade(c *cli.Context) error {
if runtime.GOARCH != "amd64" {
log.Fatalf("ros install / upgrade only supported on 'amd64', not '%s'", runtime.GOARCH)
}
image := c.String("image") image := c.String("image")
if image == "" { if image == "" {