GoogleContainerTools / GoogleContainerTools/skaffold

skaffold build: --kube-context flag does not default correctly.

Open
#4,477 9 comments 1 reaction 0 assignees View on GitHub
area/build cloud-code/cloud-run has-workaround kind/bug priority/p3
Dominant language
Go
Stars
15.9k
Forks
1.7k
Avg merge
3d 9h
Merged PRs (30d)
10

Description

### Expected behavior
`skaffold build --kube-context=''` and `skaffold build` output the same thing, given that the [cli docs](https://skaffold.dev/docs/references/cli/#skaffold-build) specify that the default for this command is `--kube-context=''`.

### Actual behavior
`skaffold build` seems to take the active context as the kube-context and not `''` as documented.

When I am trying to deploy images to GCR for a later deployment (to Cloud Run), I am not paying attention to what my active context is, but sometimes it is a stopped minikube cluster. I would expect when running `skaffold build` with the implicit default of `--kube-context=''`, it acts as a 'contextless' build that doesn't assume a local build, but I instead get the error...
```
Failed to build the app. Error: creating runner: creating builder: getting docker client: getting minikube env: running [minikube docker-env --shell none]
- stdout: "* The control plane node must be running for this command\n - To fix this, run: \"minikube start\"\n"
- stderr: ""
- cause: exit status 69
```

### Information

- Skaffold version: v1.12.0
- Operating system: macOS v10.15.4

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.