mirror of
https://github.com/kubernetes/client-go.git
synced 2025-06-25 14:41:53 +00:00
Merge pull request #76796 from dims/remove-unused-methods
Remove unused code Kubernetes-commit: 29163600feb394577caa87f58064226e0349ff0e
This commit is contained in:
commit
59781b88d0
4
Godeps/Godeps.json
generated
4
Godeps/Godeps.json
generated
@ -184,11 +184,11 @@
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/api",
|
||||
"Rev": "b8e4ab4b136a"
|
||||
"Rev": "c5cad27821f6"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery",
|
||||
"Rev": "b3683fe6b520"
|
||||
"Rev": "b874eabb9a4e"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/klog",
|
||||
|
8
go.mod
8
go.mod
@ -27,8 +27,8 @@ require (
|
||||
golang.org/x/oauth2 v0.0.0-20170412232759-a6bd8cefa181
|
||||
golang.org/x/time v0.0.0-20161028155119-f51c12702a4d
|
||||
google.golang.org/appengine v1.5.0 // indirect
|
||||
k8s.io/api v0.0.0-20190418212532-b8e4ab4b136a
|
||||
k8s.io/apimachinery v0.0.0-20190418212431-b3683fe6b520
|
||||
k8s.io/api v0.0.0-20190419092548-c5cad27821f6
|
||||
k8s.io/apimachinery v0.0.0-20190419212445-b874eabb9a4e
|
||||
k8s.io/klog v0.3.0
|
||||
k8s.io/utils v0.0.0-20190221042446-c2654d5206da
|
||||
sigs.k8s.io/yaml v1.1.0
|
||||
@ -37,6 +37,6 @@ require (
|
||||
replace (
|
||||
golang.org/x/sys => golang.org/x/sys v0.0.0-20190209173611-3b5209105503
|
||||
golang.org/x/tools => golang.org/x/tools v0.0.0-20190313210603-aa82965741a9
|
||||
k8s.io/api => k8s.io/api v0.0.0-20190418212532-b8e4ab4b136a
|
||||
k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20190418212431-b3683fe6b520
|
||||
k8s.io/api => k8s.io/api v0.0.0-20190419092548-c5cad27821f6
|
||||
k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20190419212445-b874eabb9a4e
|
||||
)
|
||||
|
4
go.sum
4
go.sum
@ -87,8 +87,8 @@ gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkep
|
||||
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
|
||||
gopkg.in/yaml.v2 v2.2.1 h1:mUhvW9EsL+naU5Q3cakzfE91YhliOondGd6ZrsDBHQE=
|
||||
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
k8s.io/api v0.0.0-20190418212532-b8e4ab4b136a/go.mod h1:B0cvvXrD9UkqARVdlFhdZB9SNL0TzJ13UB/p410skE4=
|
||||
k8s.io/apimachinery v0.0.0-20190418212431-b3683fe6b520/go.mod h1:tXkZEnPhecLuffcJcEuO/iNpM8w0n42dM5fNrr9OVVE=
|
||||
k8s.io/api v0.0.0-20190419092548-c5cad27821f6/go.mod h1:B0cvvXrD9UkqARVdlFhdZB9SNL0TzJ13UB/p410skE4=
|
||||
k8s.io/apimachinery v0.0.0-20190419212445-b874eabb9a4e/go.mod h1:tXkZEnPhecLuffcJcEuO/iNpM8w0n42dM5fNrr9OVVE=
|
||||
k8s.io/klog v0.3.0 h1:0VPpR+sizsiivjIfIAQH/rl8tan6jvWkS7lU+0di3lE=
|
||||
k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk=
|
||||
k8s.io/kube-openapi v0.0.0-20190228160746-b3a7cee44a30 h1:TRb4wNWoBVrH9plmkp2q86FIDppkbrEXdXlxU3a3BMI=
|
||||
|
@ -30,10 +30,6 @@ import (
|
||||
var scaleConverter = NewScaleConverter()
|
||||
var codecs = serializer.NewCodecFactory(scaleConverter.Scheme())
|
||||
|
||||
// restInterfaceProvider turns a restclient.Config into a restclient.Interface.
|
||||
// It's overridable for the purposes of testing.
|
||||
type restInterfaceProvider func(*restclient.Config) (restclient.Interface, error)
|
||||
|
||||
// scaleClient is an implementation of ScalesGetter
|
||||
// which makes use of a RESTMapper and a generic REST
|
||||
// client to support an discoverable resource.
|
||||
|
6
tools/cache/reflector.go
vendored
6
tools/cache/reflector.go
vendored
@ -25,7 +25,6 @@ import (
|
||||
"net"
|
||||
"net/url"
|
||||
"reflect"
|
||||
"strings"
|
||||
"sync"
|
||||
"syscall"
|
||||
"time"
|
||||
@ -113,11 +112,6 @@ func NewNamedReflector(name string, lw ListerWatcher, expectedType interface{},
|
||||
return r
|
||||
}
|
||||
|
||||
func makeValidPrometheusMetricLabel(in string) string {
|
||||
// this isn't perfect, but it removes our common characters
|
||||
return strings.NewReplacer("/", "_", ".", "_", "-", "_", ":", "_").Replace(in)
|
||||
}
|
||||
|
||||
// internalPackages are packages that ignored when creating a default reflector name. These packages are in the common
|
||||
// call chains to NewReflector, so they'd be low entropy names for reflectors
|
||||
var internalPackages = []string{"client-go/tools/cache/"}
|
||||
|
17
tools/cache/reflector_metrics.go
vendored
17
tools/cache/reflector_metrics.go
vendored
@ -94,23 +94,6 @@ var metricsFactory = struct {
|
||||
metricsProvider: noopMetricsProvider{},
|
||||
}
|
||||
|
||||
func newReflectorMetrics(name string) *reflectorMetrics {
|
||||
var ret *reflectorMetrics
|
||||
if len(name) == 0 {
|
||||
return ret
|
||||
}
|
||||
return &reflectorMetrics{
|
||||
numberOfLists: metricsFactory.metricsProvider.NewListsMetric(name),
|
||||
listDuration: metricsFactory.metricsProvider.NewListDurationMetric(name),
|
||||
numberOfItemsInList: metricsFactory.metricsProvider.NewItemsInListMetric(name),
|
||||
numberOfWatches: metricsFactory.metricsProvider.NewWatchesMetric(name),
|
||||
numberOfShortWatches: metricsFactory.metricsProvider.NewShortWatchesMetric(name),
|
||||
watchDuration: metricsFactory.metricsProvider.NewWatchDurationMetric(name),
|
||||
numberOfItemsInWatch: metricsFactory.metricsProvider.NewItemsInWatchMetric(name),
|
||||
lastResourceVersion: metricsFactory.metricsProvider.NewLastResourceVersionMetric(name),
|
||||
}
|
||||
}
|
||||
|
||||
// SetReflectorMetricsProvider sets the metrics provider
|
||||
func SetReflectorMetricsProvider(metricsProvider MetricsProvider) {
|
||||
metricsFactory.setProviders.Do(func() {
|
||||
|
@ -296,16 +296,6 @@ func makeUserIdentificationConfig(info clientauth.Info) *restclient.Config {
|
||||
return config
|
||||
}
|
||||
|
||||
// makeUserIdentificationFieldsConfig returns a client.Config capable of being merged using mergo for only server identification information
|
||||
func makeServerIdentificationConfig(info clientauth.Info) restclient.Config {
|
||||
config := restclient.Config{}
|
||||
config.CAFile = info.CAFile
|
||||
if info.Insecure != nil {
|
||||
config.Insecure = *info.Insecure
|
||||
}
|
||||
return config
|
||||
}
|
||||
|
||||
func canIdentifyUser(config restclient.Config) bool {
|
||||
return len(config.Username) > 0 ||
|
||||
(len(config.CertFile) > 0 || len(config.CertData) > 0) ||
|
||||
|
@ -23,7 +23,6 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"k8s.io/klog"
|
||||
@ -289,12 +288,6 @@ func (s *fileStore) filename(qualifier string) string {
|
||||
return s.pairNamePrefix + "-" + qualifier + pemExtension
|
||||
}
|
||||
|
||||
// withoutExt returns the given filename after removing the extension. The
|
||||
// extension to remove will be the result of filepath.Ext().
|
||||
func withoutExt(filename string) string {
|
||||
return strings.TrimSuffix(filename, filepath.Ext(filename))
|
||||
}
|
||||
|
||||
func loadX509KeyPair(certFile, keyFile string) (*tls.Certificate, error) {
|
||||
cert, err := tls.LoadX509KeyPair(certFile, keyFile)
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user