Skip to content
This repository has been archived by the owner on May 15, 2024. It is now read-only.

Add an option to run local development #25

Merged
merged 2 commits into from
Aug 8, 2022

Conversation

yaacov
Copy link
Member

@yaacov yaacov commented Jul 28, 2022

Problem:
It is not convenient to set up the API server for local development,
for example, when developing the UI it is sometimes nice to have a way to connect to a local forklift-must-gather-api server.

What happen:
Currently the server is hard coded to use in cluster configuration files:

"/var/run/secrets/kubernetes.io/serviceaccount/token"
"/var/run/secrets/kubernetes.io/serviceaccount/ca.crt"

Settings this files on a developer machine requires root access.

Suggested solution:
Allow to use local kubeconfig file ( default or using $KUBECONFIG ) using an environment variable flag.

var description default value
USE_KUBECONFIG use local user's kubeconfig when fetching data from k8s server ("false"/"true") "false"

For example:

PORT=9200 USE_KUBECONFIG=true go run pkg/must-gather-api.go

Ref: #11

Signed-off-by: yzamir [email protected]

@yaacov
Copy link
Member Author

yaacov commented Jul 28, 2022

@fbladilo hi, tests fail on main too ... ( fails on my laptop too ) can I run tests locally ?

Copy link
Collaborator

@aufi aufi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yaacov Thanks for the PR, looks good to me 👍

@yaacov
Copy link
Member Author

yaacov commented Aug 2, 2022

@aufi can we merge it?

@aufi
Copy link
Collaborator

aufi commented Aug 8, 2022

Build error is unrelated, merging.

@aufi aufi merged commit 7d65625 into kubev2v:main Aug 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants