New "inject kubeconfig into local env" breaks tilt setups with multiple clusters

Open
#6,642 2 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
go, kubernetes
Domain
devops, tooling

Research direction

Start by reviewing PR #6619 and the local command's environment handling, then reproduce the issue by checking whether KUBECONFIG is set. Confirm the behavior with a setup using multiple clusters and verify that local commands can use the default kubeconfig without breaking the new behavior.

Written by the indexing model from the issue text.

Description

bug

Related to https://github.com/tilt-dev/tilt/pull/6619

Expected Behavior

Previously calls to local would use the default .kube/config that allowed commands run by local to access multiple clusters.

Current Behavior

As of v0.36.0 these commands fail with "context x does not exist".

Steps to Reproduce

To reproduce the error you'd need a full client that depends on multiple clusters. A minimal reproduction would be to check env to see if KUBECONFIG is set or not. It should be unset so that it uses the default kube config file.

Context

Could we get an option or some other way to disable this behaviour?

The current workaround I found was to use

env = {"KUBECONFIG": os.getenv("KUBECONFIG", "")}

That seems to work for now, but I'm not sure if it will continue to work in the future.

Dominant language
Go
Stars
10.1k
Forks
413
Avg merge
1d 10h
Merged PRs (30d)
6

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from tilt-dev/tilt

All issues in tilt-dev/tilt

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.