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

fix: handle colima host #1228

Merged
merged 1 commit into from
Mar 9, 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
15 changes: 15 additions & 0 deletions pkg/client/host.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,21 @@ func GetHostIP(ctx context.Context, runtime runtimes.Runtime, cluster *k3d.Clust

}

// Colima
if rtimeInfo.InfoName == "colima" {
toolsNode, err := EnsureToolsNode(ctx, runtime, cluster)
if err != nil {
return nil, fmt.Errorf("failed to ensure that k3d-tools node is running to get host IP :%w", err)
}

limaIP, err := resolveHostnameFromInside(ctx, runtime, toolsNode, "host.lima.internal", ResolveHostCmdGetEnt)
if err == nil {
return limaIP, nil
}

l.Log().Debugf("[GetHostIP on colima] failed to resolve 'host.lima.internal' from inside the k3d-tools node: %v", err)
}

ip, err := runtime.GetHostIP(ctx, cluster.Network.Name)
if err != nil {
return nil, fmt.Errorf("runtime failed to get host IP: %w", err)
Expand Down
1 change: 1 addition & 0 deletions pkg/runtimes/docker/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ func (d Docker) Info() (*runtimeTypes.RuntimeInfo, error) {
CgroupVersion: info.CgroupVersion,
CgroupDriver: info.CgroupDriver,
Filesystem: "UNKNOWN",
InfoName: info.Name,
}

// Get the backing filesystem for the storage driver
Expand Down
1 change: 1 addition & 0 deletions pkg/runtimes/types/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ type RuntimeInfo struct {
CgroupVersion string `json:"cgroupversion,omitempty"`
CgroupDriver string `json:"cgroupdriver,omitempty"`
Filesystem string `json:"filesystem,omitempty"`
InfoName string `json:"infoname,omitempty"`
}

type NodeLogsOpts struct {
Expand Down