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

Change clientset to use config from config.GetConfig() #468

Merged
merged 5 commits into from
Nov 26, 2020

Conversation

Janek3d
Copy link
Contributor

@Janek3d Janek3d commented Nov 20, 2020

During debugging in VS Code on cluster deployed on AWS, I was getting error that GetClientset function could not locate kubeconfig file despite providing "kubeconfig" flag and "KUBECONFIG" variable in launch.json file. After some digging I found that GetClientset uses getClientConfig function which was simply ignoring this flag and variable. I decided to get clientsert by using more direct function GetClientsetFromConfig and config gathered by config.GetConfig. I also deleted GetConfig function which was not used anywhere.

@Dysproz
Copy link
Collaborator

Dysproz commented Nov 23, 2020

/gcbrun

Copy link
Collaborator

@Dysproz Dysproz left a comment

Choose a reason for hiding this comment

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

Great input Janusz!

@@ -91,7 +91,7 @@ func main() {
os.Exit(1)
}

clientset, err := v1alpha1.GetClientset()
clientset, err := v1alpha1.GetClientsetFromConfig(cfg)
Copy link

Choose a reason for hiding this comment

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

In my opinion you can also delete GetClientsetFromConfig and move clientset, err := kubernetes.NewForConfig(config) here. I really don't see a point of having a function that only calls one other function.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I changed it to kubernetes.NewForConfig(cfg).

@Janek3d Janek3d requested a review from kaweue November 25, 2020 13:09
@Janek3d
Copy link
Contributor Author

Janek3d commented Nov 25, 2020

/gcbrun

@Janek3d Janek3d merged commit 98b9c2a into Juniper:master Nov 26, 2020
lrebeja pushed a commit that referenced this pull request Dec 2, 2020
* Change GetClientConfig function to get config from config.GetConfig

* Change GetClientset to GetClientsetFromConfig in main.go
Remove GetClientset and GetClientConfig in exec_to_pod.go

* fix

* Delete GetClientsetFromConfig

* Update BUILD.bazel
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

Successfully merging this pull request may close these issues.

None yet

3 participants