Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

misc: fix multiple startup errors #757

Merged
merged 5 commits into from
Jul 27, 2023
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
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ build:

.PHONY: test
test:
go test -v -ldflags="$(LD_FLAGS)" ./cmd/...
go test -v -ldflags="$(LD_FLAGS)" ./...

.PHONY: vmnet
vmnet:
Expand Down
7 changes: 6 additions & 1 deletion config/dirs.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"path/filepath"
"sync"

"github.com/abiosoft/colima/util"
"github.com/abiosoft/colima/util/fsutil"
"github.com/abiosoft/colima/util/osutil"
"github.com/abiosoft/colima/util/shautil"
Expand Down Expand Up @@ -43,9 +44,13 @@ var (
configBaseDir = requiredDir{
dir: func() (string, error) {
dir, err := os.UserHomeDir()
if err != nil {
return "", err
}
dir = filepath.Join(dir, ".colima")
_, err = os.Stat(dir)
if err == nil {
// TODO: remove macOS when QEMU_SYSTEM_ARCH is handled properly upstream.
if err == nil || util.MacOS() {
return dir, nil
}
// else
Expand Down
2 changes: 1 addition & 1 deletion environment/container/kubernetes/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (

const (
Name = "kubernetes"
DefaultVersion = "v1.27.1+k3s1"
DefaultVersion = "v1.27.3+k3s1"

ConfigKey = "kubernetes_config"
)
Expand Down
4 changes: 2 additions & 2 deletions environment/vm/lima/yaml.go
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ type Config struct {
Disk string `yaml:"disk,omitempty"`
Mounts []Mount `yaml:"mounts,omitempty"`
MountType MountType `yaml:"mountType,omitempty" json:"mountType,omitempty"`
SSH SSH `yaml:"ssh,omitempty"`
SSH SSH `yaml:"ssh"`
Containerd Containerd `yaml:"containerd"`
Env map[string]string `yaml:"env,omitempty"`
DNS []net.IP `yaml:"dns"`
Expand All @@ -407,7 +407,7 @@ type Mount struct {
}

type SSH struct {
LocalPort int `yaml:"localPort"`
LocalPort int `yaml:"localPort,omitempty"`
LoadDotSSHPubKeys bool `yaml:"loadDotSSHPubKeys"`
ForwardAgent bool `yaml:"forwardAgent"` // default: false
}
Expand Down