diff --git a/platform/host_api.go b/platform/host_api.go index b803e72..6ce4299 100644 --- a/platform/host_api.go +++ b/platform/host_api.go @@ -797,7 +797,7 @@ func (bh *BraveHost) StopUnit(name string) error { fmt.Println("Stopping unit: ", name) err = Stop(lxdServer, name) if err != nil { - return errors.New("Failed to stop unit: " + err.Error()) + return errors.New("failed to stop unit: " + err.Error()) } return nil @@ -811,7 +811,7 @@ func (bh *BraveHost) StartUnit(name string) error { if remoteName == shared.BravetoolsRemote { err := bh.Backend.Start() if err != nil { - return errors.New("Failed to start backend: " + err.Error()) + return errors.New("failed to start backend: " + err.Error()) } } @@ -828,7 +828,7 @@ func (bh *BraveHost) StartUnit(name string) error { fmt.Println("Starting unit: ", name) err = Start(lxdServer, name) if err != nil { - return errors.New("Failed to start unit: " + err.Error()) + return errors.New("failed to start unit: " + err.Error()) } return nil diff --git a/platform/operations.go b/platform/operations.go index 3fcda75..cb4a11f 100644 --- a/platform/operations.go +++ b/platform/operations.go @@ -529,7 +529,20 @@ func Launch(ctx context.Context, localLxd lxd.InstanceServer, name string, alias a := strings.Split(alias, "/") if len(a) < 3 { - alias = alias + "/" + runtime.GOARCH + arch, err := GetLXDServerArch(localLxd) + imageArch := arch + + switch arch { + case "aarch64": + imageArch = "arm64" + case "x86_64": + imageArch = "amd64" + } + + if err != nil { + return fingerprint, err + } + alias = alias + "/" + imageArch } operation := shared.Info("Importing " + alias) @@ -565,12 +578,12 @@ func Launch(ctx context.Context, localLxd lxd.InstanceServer, name string, alias op, err := localLxd.CreateContainer(req) if err != nil { - return fingerprint, errors.New("Failed to create unit: " + err.Error()) + return fingerprint, errors.New("failed to create unit: " + err.Error()) } err = op.Wait() if err != nil { - return fingerprint, errors.New("Error waiting: " + err.Error()) + return fingerprint, errors.New("error waiting: " + err.Error()) } // Wait for container to be properly set up while checking for interrupts diff --git a/shared/bravefile.go b/shared/bravefile.go index 8e7d55f..de2b07c 100644 --- a/shared/bravefile.go +++ b/shared/bravefile.go @@ -5,7 +5,6 @@ import ( "errors" "fmt" "net/http" - "runtime" "strings" "gopkg.in/yaml.v2" @@ -80,10 +79,11 @@ type Bravefile struct { // NewBravefile .. func NewBravefile() *Bravefile { + return &Bravefile{ - Base: ImageDescription{ - Architecture: runtime.GOARCH, - }, + // Base: ImageDescription{ + // Architecture: runtime.GOARCH, + // }, PlatformService: Service{ Resources: Resources{ CPU: DefaultUnitCpuLimit,