Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
OS=Linux ARCH=aarch64 make

- name: upload artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: artifacts-linux
path: _output/binaries/
Expand All @@ -95,7 +95,7 @@ jobs:
CGO_ENABLED=1 OS=Darwin ARCH=arm64 make

- name: upload artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: artifacts-macos
path: _output/binaries/
Expand All @@ -107,11 +107,11 @@ jobs:

steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: artifacts-linux
path: _output/binaries/
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: artifacts-macos
path: _output/binaries/
Expand Down
9 changes: 5 additions & 4 deletions environment/vm/lima/lima.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func New(host environment.HostActions) environment.VM {
var envs []string
envHome := limautil.EnvLimaHome + "=" + limaHome
envLimaInstance := envLimaInstance + "=" + config.CurrentProfile().ID
envSSHForward := "LIMA_SSH_PORT_FORWARDER=true"
envSSHForward := envLimaSSHForwarder + "=" + osutil.EnvVar(envLimaSSHForwarder).ValOr("true")
envBinary := osutil.EnvColimaBinary + "=" + osutil.Executable()
envs = append(envs, envHome, envLimaInstance, envSSHForward, envBinary)

Expand All @@ -46,9 +46,10 @@ func New(host environment.HostActions) environment.VM {
}

const (
envLimaInstance = "LIMA_INSTANCE"
lima = "lima"
limactl = limautil.LimactlCommand
envLimaInstance = "LIMA_INSTANCE"
envLimaSSHForwarder = "LIMA_SSH_PORT_FORWARDER"
lima = "lima"
limactl = limautil.LimactlCommand
)

var _ environment.VM = (*limaVM)(nil)
Expand Down
8 changes: 8 additions & 0 deletions util/osutil/os.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@ func (e EnvVar) Val() string {
return os.Getenv(string(e))
}

// Or returns the environment variable value if set, otherwise returns val.
func (e EnvVar) ValOr(val string) string {
if v := os.Getenv(string(e)); v != "" {
return v
}
return val
}

const EnvColimaBinary = "COLIMA_BINARY"

// Executable returns the path name for the executable that started
Expand Down
Loading