Skip to content

Commit 88029fe

Browse files
committed
Only show the podman --remote flag on linux
On macOS and Windows, "podman-remote" is called "podman". On Linux, make sure that it calls the $CONTAINER_HOST... Signed-off-by: Anders F Björklund <[email protected]>
1 parent b6fdde0 commit 88029fe

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

examples/podman.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,4 @@ portForwards:
5656
message: |
5757
To run `podman` on the host (assumes podman-remote is installed):
5858
$ export CONTAINER_HOST=unix://{{.Dir}}/sock/podman.sock
59-
$ podman --remote ...
59+
$ podman{{if eq .HostOS "linux"}}-remote{{end}} ...

pkg/limayaml/default.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ networks:
199199
# Message. Information to be shown to the user, given as a Go template for the instance.
200200
# The same template variables as for listing instances can be used, for example {{.Dir}}.
201201
# You can view the complete list of variables using `limactl list --list-fields` command.
202+
# It also includes {{.HostOS}} and {{.HostArch}} vars, for the runtime GOOS and GOARCH.
202203
# message: |
203204
# This will be shown to the user.
204205

pkg/store/instance.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"fmt"
77
"os"
88
"path/filepath"
9+
"runtime"
910
"strconv"
1011
"strings"
1112
"syscall"
@@ -170,13 +171,19 @@ func ReadPIDFile(path string) (int, error) {
170171

171172
type FormatData struct {
172173
Instance
174+
HostOS string
175+
HostArch string
173176
LimaHome string
174177
IdentityFile string
175178
}
176179

177180
func AddGlobalFields(inst *Instance) (FormatData, error) {
178181
var data FormatData
179182
data.Instance = *inst
183+
// Add HostOS
184+
data.HostOS = runtime.GOOS
185+
// Add HostArch
186+
data.HostArch = runtime.GOARCH
180187
// Add IdentityFile
181188
configDir, err := dirnames.LimaConfigDir()
182189
if err != nil {

0 commit comments

Comments
 (0)