Add gke package, add kubenetes.Dialer type.
Updates golang/go#18817
Change-Id: Ifee53384486b0692899b77be2eaa42ca9006ef8e
Reviewed-on: https://go-review.googlesource.com/36016
Reviewed-by: Chris Broadfoot <cbro@golang.org>
diff --git a/kubernetes/client.go b/kubernetes/client.go
index 5aa82d6..80604d5 100644
--- a/kubernetes/client.go
+++ b/kubernetes/client.go
@@ -51,6 +51,14 @@
}, nil
}
+// Close closes any idle HTTP connections still connected to the Kubernetes master.
+func (c *Client) Close() error {
+ if tr, ok := c.httpClient.Transport.(*http.Transport); ok {
+ tr.CloseIdleConnections()
+ }
+ return nil
+}
+
// RunLongLivedPod creates a new pod resource in the default pod namespace with
// the given pod API specification. It assumes the pod runs a
// long-lived server (i.e. if the container exit quickly quickly, even