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

remove unnecessarily duplication since types collapsed #40867

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion cmd/kubelet/app/BUILD
Expand Up @@ -29,7 +29,6 @@ go_library(
srcs = [
"auth.go",
"bootstrap.go",
"clientgo.go",
"plugins.go",
"server.go",
"server_linux.go",
Expand Down
120 changes: 0 additions & 120 deletions cmd/kubelet/app/clientgo.go

This file was deleted.

25 changes: 4 additions & 21 deletions cmd/kubelet/app/server.go
Expand Up @@ -396,6 +396,10 @@ func run(s *options.KubeletServer, kubeDeps *kubelet.KubeletDeps) (err error) {
if err != nil {
glog.Warningf("New kubeClient from clientConfig error: %v", err)
}
externalKubeClient, err = clientgoclientset.NewForConfig(clientConfig)
if err != nil {
glog.Warningf("New kubeClient from clientConfig error: %v", err)
Copy link
Contributor

Choose a reason for hiding this comment

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

It's not really something the admin will understand.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's not really something the admin will understand.

Prexisting from the original

}
// make a separate client for events
eventClientConfig := *clientConfig
eventClientConfig.QPS = float32(s.EventRecordQPS)
Expand All @@ -413,27 +417,6 @@ func run(s *options.KubeletServer, kubeDeps *kubelet.KubeletDeps) (err error) {
}
}

// client-go and kuberenetes generated clients are incompatible because the runtime
// and runtime/serializer types have been duplicated in client-go. This means that
// you can't reasonably convert from one to the other and its impossible for a single
// type to fulfill both interfaces. Because of that, we have to build the clients
// up from scratch twice.
// TODO eventually the kubelet should only use the client-go library
clientGoConfig, err := createAPIServerClientGoConfig(s)
if err == nil {
externalKubeClient, err = clientgoclientset.NewForConfig(clientGoConfig)
if err != nil {
glog.Warningf("New kubeClient from clientConfig error: %v", err)
}
} else {
if s.RequireKubeConfig {
return fmt.Errorf("invalid kubeconfig: %v", err)
}
if standaloneMode {
glog.Warningf("No API client: %v", err)
}
}

kubeDeps, err = UnsecuredKubeletDeps(s)
if err != nil {
return err
Expand Down