refuse to run the dashboard if not on amd64 (#843)

This commit is contained in:
blotus 2021-07-01 13:41:16 +02:00 committed by GitHub
parent bb37e2e70d
commit 556f93827a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -6,6 +6,7 @@ import (
"os/exec"
"os/user"
"path/filepath"
"runtime"
"strconv"
"strings"
"unicode"
@ -53,6 +54,11 @@ cscli dashboard stop
cscli dashboard remove
`,
PersistentPreRun: func(cmd *cobra.Command, args []string) {
if runtime.GOARCH != "amd64" {
log.Fatalf("cscli dashboard is only available on amd64, but you are running %s", runtime.GOARCH)
}
if err := csConfig.LoadAPIServer(); err != nil || csConfig.DisableAPI {
log.Fatal("Local API is disabled, please run this command on the local API machine")
}