Skip to content

Commit

Permalink
Merge pull request #1448 from dgageot/fix-1447
Browse files Browse the repository at this point in the history
Support new K8s context name in Docker Desktop
  • Loading branch information
dgageot authored Jan 11, 2019
2 parents a436989 + 2952800 commit 17fefe2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pkg/skaffold/build/local/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ func NewBuilder(cfg *latest.LocalBuild, kubeContext string) (*Builder, error) {
return nil, errors.Wrap(err, "getting docker client")
}

localCluster := kubeContext == constants.DefaultMinikubeContext || kubeContext == constants.DefaultDockerForDesktopContext
localCluster := isLocal(kubeContext)

var pushImages bool
if cfg.Push == nil {
pushImages = !localCluster
Expand All @@ -64,6 +65,12 @@ func NewBuilder(cfg *latest.LocalBuild, kubeContext string) (*Builder, error) {
}, nil
}

func isLocal(kubeContext string) bool {
return kubeContext == constants.DefaultMinikubeContext ||
kubeContext == constants.DefaultDockerForDesktopContext ||
kubeContext == constants.DefaultDockerDesktopContext
}

// Labels are labels specific to local builder.
func (b *Builder) Labels() map[string]string {
labels := map[string]string{
Expand Down
1 change: 1 addition & 0 deletions pkg/skaffold/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ const (

DefaultMinikubeContext = "minikube"
DefaultDockerForDesktopContext = "docker-for-desktop"
DefaultDockerDesktopContext = "docker-desktop"
GCSBucketSuffix = "_cloudbuild"

HelmOverridesFilename = "skaffold-overrides.yaml"
Expand Down

0 comments on commit 17fefe2

Please sign in to comment.