Allow setting the platform of the image to download (#15)

This commit is contained in:
Itxaka
2023-05-17 10:04:20 +02:00
committed by GitHub
parent 60c5f9c587
commit 40db3d970e
3 changed files with 22 additions and 6 deletions

View File

@@ -11,6 +11,7 @@ import (
"os"
"os/exec"
"os/signal"
"runtime"
"strings"
"github.com/denisbrodbeck/machineid"
@@ -246,3 +247,8 @@ func GetInterfaceIP(in string) string {
}
return ""
}
// GetCurrentPlatform returns the current platform in docker style `linux/amd64` for use with image utils
func GetCurrentPlatform() string {
return fmt.Sprintf("%s/%s", runtime.GOOS, runtime.GOARCH)
}