mirror of
https://github.com/kubernetes/client-go.git
synced 2025-06-28 16:07:29 +00:00
Merge pull request #82365 from jkaniuk/pod-gc
Pod GC controller - use node lister Kubernetes-commit: 2c4cba8aa0fb6db7dbf7ba1c8cb57f1245eb409c
This commit is contained in:
commit
464ec5ba04
4
Godeps/Godeps.json
generated
4
Godeps/Godeps.json
generated
@ -344,11 +344,11 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api",
|
"ImportPath": "k8s.io/api",
|
||||||
"Rev": "816a9b7df678"
|
"Rev": "4cb0a757333c"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery",
|
"ImportPath": "k8s.io/apimachinery",
|
||||||
"Rev": "6c8691705fc5"
|
"Rev": "62ce3d1e6a82"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/gengo",
|
"ImportPath": "k8s.io/gengo",
|
||||||
|
8
go.mod
8
go.mod
@ -27,8 +27,8 @@ require (
|
|||||||
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45
|
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45
|
||||||
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c
|
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c
|
||||||
google.golang.org/appengine v1.5.0 // indirect
|
google.golang.org/appengine v1.5.0 // indirect
|
||||||
k8s.io/api v0.0.0-20191016225839-816a9b7df678
|
k8s.io/api v0.0.0-20191024025707-4cb0a757333c
|
||||||
k8s.io/apimachinery v0.0.0-20191020214737-6c8691705fc5
|
k8s.io/apimachinery v0.0.0-20191024025529-62ce3d1e6a82
|
||||||
k8s.io/klog v1.0.0
|
k8s.io/klog v1.0.0
|
||||||
k8s.io/utils v0.0.0-20191010214722-8d271d903fe4
|
k8s.io/utils v0.0.0-20191010214722-8d271d903fe4
|
||||||
sigs.k8s.io/yaml v1.1.0
|
sigs.k8s.io/yaml v1.1.0
|
||||||
@ -42,6 +42,6 @@ replace (
|
|||||||
golang.org/x/sys => golang.org/x/sys v0.0.0-20190209173611-3b5209105503
|
golang.org/x/sys => golang.org/x/sys v0.0.0-20190209173611-3b5209105503
|
||||||
golang.org/x/text => golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db
|
golang.org/x/text => golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db
|
||||||
golang.org/x/time => golang.org/x/time v0.0.0-20161028155119-f51c12702a4d
|
golang.org/x/time => golang.org/x/time v0.0.0-20161028155119-f51c12702a4d
|
||||||
k8s.io/api => k8s.io/api v0.0.0-20191016225839-816a9b7df678
|
k8s.io/api => k8s.io/api v0.0.0-20191024025707-4cb0a757333c
|
||||||
k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20191020214737-6c8691705fc5
|
k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20191024025529-62ce3d1e6a82
|
||||||
)
|
)
|
||||||
|
4
go.sum
4
go.sum
@ -180,8 +180,8 @@ gopkg.in/yaml.v2 v2.2.4 h1:/eiJrUcujPVeJ3xlSWaiNi3uSVmDGBK1pDHUHAnao1I=
|
|||||||
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||||
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||||
k8s.io/api v0.0.0-20191016225839-816a9b7df678/go.mod h1:LZQaT8MvVpl7Bg2lYFcQm7+Mpdxq8p1NFl3yh+5DCwY=
|
k8s.io/api v0.0.0-20191024025707-4cb0a757333c/go.mod h1:wThzAkkfqqxz0ERi8QQEOwQfkBFM27QYtPxuvBI9p+0=
|
||||||
k8s.io/apimachinery v0.0.0-20191020214737-6c8691705fc5/go.mod h1:92mWDd8Ji2sw2157KIgino5wCxffA8KSvhW2oY4ypdw=
|
k8s.io/apimachinery v0.0.0-20191024025529-62ce3d1e6a82/go.mod h1:92mWDd8Ji2sw2157KIgino5wCxffA8KSvhW2oY4ypdw=
|
||||||
k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0=
|
k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0=
|
||||||
k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk=
|
k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk=
|
||||||
k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk=
|
k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk=
|
||||||
|
@ -35,14 +35,17 @@ type DelayingInterface interface {
|
|||||||
|
|
||||||
// NewDelayingQueue constructs a new workqueue with delayed queuing ability
|
// NewDelayingQueue constructs a new workqueue with delayed queuing ability
|
||||||
func NewDelayingQueue() DelayingInterface {
|
func NewDelayingQueue() DelayingInterface {
|
||||||
return newDelayingQueue(clock.RealClock{}, "")
|
return NewDelayingQueueWithCustomClock(clock.RealClock{}, "")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// NewNamedDelayingQueue constructs a new named workqueue with delayed queuing ability
|
||||||
func NewNamedDelayingQueue(name string) DelayingInterface {
|
func NewNamedDelayingQueue(name string) DelayingInterface {
|
||||||
return newDelayingQueue(clock.RealClock{}, name)
|
return NewDelayingQueueWithCustomClock(clock.RealClock{}, name)
|
||||||
}
|
}
|
||||||
|
|
||||||
func newDelayingQueue(clock clock.Clock, name string) DelayingInterface {
|
// NewDelayingQueueWithCustomClock constructs a new named workqueue
|
||||||
|
// with ability to inject real or fake clock for testing purposes
|
||||||
|
func NewDelayingQueueWithCustomClock(clock clock.Clock, name string) DelayingInterface {
|
||||||
ret := &delayingType{
|
ret := &delayingType{
|
||||||
Interface: NewNamed(name),
|
Interface: NewNamed(name),
|
||||||
clock: clock,
|
clock: clock,
|
||||||
|
@ -29,7 +29,7 @@ import (
|
|||||||
|
|
||||||
func TestSimpleQueue(t *testing.T) {
|
func TestSimpleQueue(t *testing.T) {
|
||||||
fakeClock := clock.NewFakeClock(time.Now())
|
fakeClock := clock.NewFakeClock(time.Now())
|
||||||
q := newDelayingQueue(fakeClock, "")
|
q := NewDelayingQueueWithCustomClock(fakeClock, "")
|
||||||
|
|
||||||
first := "foo"
|
first := "foo"
|
||||||
|
|
||||||
@ -71,7 +71,7 @@ func TestSimpleQueue(t *testing.T) {
|
|||||||
|
|
||||||
func TestDeduping(t *testing.T) {
|
func TestDeduping(t *testing.T) {
|
||||||
fakeClock := clock.NewFakeClock(time.Now())
|
fakeClock := clock.NewFakeClock(time.Now())
|
||||||
q := newDelayingQueue(fakeClock, "")
|
q := NewDelayingQueueWithCustomClock(fakeClock, "")
|
||||||
|
|
||||||
first := "foo"
|
first := "foo"
|
||||||
|
|
||||||
@ -130,7 +130,7 @@ func TestDeduping(t *testing.T) {
|
|||||||
|
|
||||||
func TestAddTwoFireEarly(t *testing.T) {
|
func TestAddTwoFireEarly(t *testing.T) {
|
||||||
fakeClock := clock.NewFakeClock(time.Now())
|
fakeClock := clock.NewFakeClock(time.Now())
|
||||||
q := newDelayingQueue(fakeClock, "")
|
q := NewDelayingQueueWithCustomClock(fakeClock, "")
|
||||||
|
|
||||||
first := "foo"
|
first := "foo"
|
||||||
second := "bar"
|
second := "bar"
|
||||||
@ -179,7 +179,7 @@ func TestAddTwoFireEarly(t *testing.T) {
|
|||||||
|
|
||||||
func TestCopyShifting(t *testing.T) {
|
func TestCopyShifting(t *testing.T) {
|
||||||
fakeClock := clock.NewFakeClock(time.Now())
|
fakeClock := clock.NewFakeClock(time.Now())
|
||||||
q := newDelayingQueue(fakeClock, "")
|
q := NewDelayingQueueWithCustomClock(fakeClock, "")
|
||||||
|
|
||||||
first := "foo"
|
first := "foo"
|
||||||
second := "bar"
|
second := "bar"
|
||||||
@ -217,7 +217,7 @@ func TestCopyShifting(t *testing.T) {
|
|||||||
|
|
||||||
func BenchmarkDelayingQueue_AddAfter(b *testing.B) {
|
func BenchmarkDelayingQueue_AddAfter(b *testing.B) {
|
||||||
fakeClock := clock.NewFakeClock(time.Now())
|
fakeClock := clock.NewFakeClock(time.Now())
|
||||||
q := newDelayingQueue(fakeClock, "")
|
q := NewDelayingQueueWithCustomClock(fakeClock, "")
|
||||||
|
|
||||||
// Add items
|
// Add items
|
||||||
for n := 0; n < b.N; n++ {
|
for n := 0; n < b.N; n++ {
|
||||||
|
Loading…
Reference in New Issue
Block a user