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

kubectl kuttl test leaves garbage kubeconfig file around #297

Open
porridge opened this issue Jun 9, 2021 · 3 comments
Open

kubectl kuttl test leaves garbage kubeconfig file around #297

porridge opened this issue Jun 9, 2021 · 3 comments
Milestone

Comments

@porridge
Copy link
Member

porridge commented Jun 9, 2021

What happened:

After kubectl kuttl test runs, a kubeconfig file appears in current directory.

What you expected to happen:

No garbage left behind.

How to reproduce it (as minimally and precisely as possible):

$ cat kuttl-test.yaml 
apiVersion: kuttl.dev/v1beta1
kind: TestSuite
testDirs:
- ./empty
$ ls kubeconfig 
ls: kubeconfig: No such file or directory
$ kubectl kuttl test --namespace blah
=== RUN   kuttl
    harness.go:457: starting setup
    harness.go:248: running tests using configured kubeconfig.
    harness.go:285: Successful connection to cluster at: https://kubernetes.docker.internal:6443
    harness.go:353: running tests
    harness.go:74: going to run test suite with timeout of 30 seconds for each step
    harness.go:365: testsuite: ./empty has 0 tests
=== RUN   kuttl/harness
=== CONT  kuttl
    harness.go:399: run tests finished
    harness.go:508: cleaning up
    harness.go:563: removing temp folder: ""
--- PASS: kuttl (1.22s)
    --- PASS: kuttl/harness (0.00s)
PASS
$ ls -l kubeconfig
-rw-r--r--  1 marcin  staff  5484 Jun  9 12:24 kubeconfig
$

Anything else we need to know?:

👋🏻

Environment:

  • Kubernetes version (use kubectl version):
Client Version: version.Info{Major:"1", Minor:"19", GitVersion:"v1.19.7", GitCommit:"1dd5338295409edcfff11505e7bb246f0d325d15", GitTreeState:"clean", BuildDate:"2021-01-13T13:23:52Z", GoVersion:"go1.15.5", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"19", GitVersion:"v1.19.7", GitCommit:"1dd5338295409edcfff11505e7bb246f0d325d15", GitTreeState:"clean", BuildDate:"2021-01-13T13:15:20Z", GoVersion:"go1.15.5", Compiler:"gc", Platform:"linux/amd64"}
  • KUTTL version (use kubectl kuttl version): KUTTL Version: version.Info{GitVersion:"0.10.0", GitCommit:"fc8c0f2", BuildDate:"2021-05-19T13:16:03Z", GoVersion:"go1.16.3", Compiler:"gc", Platform:"darwin/amd64"}
  • Cloud provider or hardware configuration: my laptop, docker for mac
  • OS (e.g. from /etc/os-release): MacOS
  • Kernel (e.g. uname -a): Darwin Marcins-MBP 20.5.0 Darwin Kernel Version 20.5.0: Sat May 8 05:10:33 PDT 2021; root:xnu-7195.121.3~9/RELEASE_X86_64 x86_64
  • Install tools: krew
@kensipe kensipe added this to the 0.12.0 milestone Sep 2, 2021
@kensipe
Copy link
Member

kensipe commented Sep 2, 2021

scheduling for the next release... thank you sir!

@porridge
Copy link
Member Author

A related issue is that a hardcoded static kubeconfig filename apparently causes concurrent kuttl runs in the same directory to step on each other's toes.

@ccremer
Copy link

ccremer commented Aug 2, 2022

To add, the kubeconfig file is created even if we provide a non-kuttl-managed cluster via KUBECONFIG environment var (it creates a copy of $KUBECONFIG).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants