Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Scorecard should use namespace from user's kubeconfig context #3422

Closed
joelanford opened this issue Jul 14, 2020 · 0 comments · Fixed by #3478
Closed

Scorecard should use namespace from user's kubeconfig context #3422

joelanford opened this issue Jul 14, 2020 · 0 comments · Fixed by #3478
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug. scorecard Issue relates to the scorecard subcomponent
Milestone

Comments

@joelanford
Copy link
Member

Bug Report

What did you do?

  1. Created a namespace called scorecard-test
  2. Updated my ~/.kube/config file to make scorecard-test my current context namespace
  3. Ran operator-sdk alpha scorecard ./internal/scorecard/alpha/testdata/bundle --skip-cleanup
  4. Ran kubectl get pods

What did you expect to see?
I expected to see the scorecard pods in the scorecard-test namespace.

What did you see instead? Under which circumstances?
I found the scorecard pods in the default namespace.

Environment

  • operator-sdk version:

operator-sdk version: "v0.19.0-17-g2594430b", commit: "2594430b796836fb2e1b1b79b5970beae5346a37", kubernetes version: "v1.18.2", go version: "go1.14.4 linux/amd64"

  • go version:

go version go1.13.10 linux/amd64

  • Kubernetes version information:

Client Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.5", GitCommit:"e6503f8d8f769ace2f338794c914a96fc335df0f", GitTreeState:"clean", BuildDate:"2020-06-26T03:47:41Z", GoVersion:"go1.13.9", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.2", GitCommit:"52c56ce7a8272c798dbc29846288d7cd9fbae032", GitTreeState:"clean", BuildDate:"2020-04-16T11:48:36Z", GoVersion:"go1.13.9", Compiler:"gc", Platform:"linux/amd64"}

  • Kubernetes cluster kind: minikube

  • Are you writing your operator in ansible, helm, or go? N/A

Possible Solution
When loading the config, get the current context's namespace and use that as the default when --namespace is not defined.

Additional context
Add any other context about the problem here.

@joelanford joelanford added this to the v1.0.0 milestone Jul 14, 2020
@joelanford joelanford added scorecard Issue relates to the scorecard subcomponent kind/bug Categorizes issue or PR as related to a bug. labels Jul 14, 2020
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. scorecard Issue relates to the scorecard subcomponent
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants