Skip to content

Commit

Permalink
Add docker desktop K8s support
Browse files Browse the repository at this point in the history
  • Loading branch information
jeff-mccoy committed Feb 8, 2022
1 parent 0fa1ef8 commit 56ea728
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
17 changes: 11 additions & 6 deletions cli/internal/k8s/distro.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ import (
)

const (
DistroIsUnknown = "unknown"
DistroIsK3s = "k3s"
DistroIsK3d = "k3d"
DistroIsKind = "kind"
DistroIsMicroK8s = "microk8s"
DistroIsEKSAnywhere = "eksanywhere"
DistroIsUnknown = "unknown"
DistroIsK3s = "k3s"
DistroIsK3d = "k3d"
DistroIsKind = "kind"
DistroIsMicroK8s = "microk8s"
DistroIsEKSAnywhere = "eksanywhere"
DistroIsDockerDesktop = "dockerdesktop"

// todo: more distros
)
Expand Down Expand Up @@ -51,6 +52,10 @@ func DetectDistro() (string, error) {
}
}

if node.GetName() == "docker-desktop" {
return DistroIsDockerDesktop, nil
}

}

namespaces, err := GetNamespaces()
Expand Down
6 changes: 6 additions & 0 deletions cli/internal/packager/seed.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,12 @@ func preSeedRegistry(tempPath tempPaths) {
inject.command = "kind"
inject.args = []string{"load", "image-archive", tempPath.seedImages, "--name", clusterName}

case k8s.DistroIsDockerDesktop:
state.StorageClass = "hostpath"
state.Registry.SeedType = config.ZarfSeedTypeCLIInject
inject.command = "docker"
inject.args = []string{"load", "-i", tempPath.seedImages}

default:
state.Registry.SeedType = config.ZarfSeedTypeRuntimeRegistry
}
Expand Down

0 comments on commit 56ea728

Please sign in to comment.